-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #46605 - estebank:macro-backtrace-spans, r=pnkfelix
Use spans for -Z external-macro-backtrace ``` % rustc ui/type-check/cannot_infer_local_or_vec.rs -Z external-macro-backtrace error[E0282]: type annotations needed --> <vec macros>:3:1 | 1 | / ( $ elem : expr ; $ n : expr ) => ( 2 | | $ crate :: vec :: from_elem ( $ elem , $ n ) ) ; ( $ ( $ x : expr ) , * ) => ( 3 | | < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ) ) ; ( $ ( $ x : expr , ) * ) | | ^^^^^^^^^^^^^^^^^^^^^ | | | | | cannot infer type for `T` 4 | | => ( vec ! [ $ ( $ x ) , * ] ) | |______________________________- in this expansion of `vec!` | ::: ui/type-check/cannot_infer_local_or_vec.rs | 12 | let x = vec![]; | - ------ in this macro invocation | | | consider giving `x` a type error: aborting due to previous error ```
- Loading branch information
Showing
4 changed files
with
144 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,78 @@ | ||
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` | ||
--> $DIR/main.rs:19:20 | ||
| | ||
19 | () => { syntax error }; //~ ERROR expected one of | ||
| ^^^^^ expected one of 8 possible tokens here | ||
$DIR/main.rs:24:5: 24:13 note: in this expansion of pong! (defined in $DIR/main.rs) | ||
18 | / macro_rules! pong { | ||
19 | | () => { syntax error }; | ||
| | ^^^^^ expected one of 8 possible tokens here | ||
20 | | } | ||
| |_- in this expansion of `pong!` | ||
... | ||
26 | pong!(); | ||
| -------- in this macro invocation | ||
|
||
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` | ||
--> $DIR/main.rs:19:20 | ||
| | ||
19 | () => { syntax error }; //~ ERROR expected one of | ||
| ^^^^^ expected one of 8 possible tokens here | ||
$DIR/main.rs:25:5: 25:13 note: in this expansion of ping! (defined in <ping macros>) | ||
<ping macros>:1:11: 1:24 note: in this expansion of pong! (defined in $DIR/main.rs) | ||
18 | / macro_rules! pong { | ||
19 | | () => { syntax error }; | ||
| | ^^^^^ expected one of 8 possible tokens here | ||
20 | | } | ||
| |_- in this expansion of `pong!` | ||
... | ||
27 | ping!(); | ||
| -------- in this macro invocation | ||
| | ||
::: <ping macros> | ||
| | ||
1 | ( ) => { pong ! ( ) ; } | ||
| ------------------------- | ||
| | | | ||
| | in this macro invocation | ||
| in this expansion of `ping!` | ||
|
||
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` | ||
--> $DIR/main.rs:19:20 | ||
| | ||
18 | / macro_rules! pong { | ||
19 | | () => { syntax error }; | ||
| | ^^^^^ expected one of 8 possible tokens here | ||
20 | | } | ||
| |_- in this expansion of `pong!` (#5) | ||
... | ||
28 | deep!(); | ||
| -------- in this macro invocation (#1) | ||
| | ||
::: <deep macros> | ||
| | ||
1 | ( ) => { foo ! ( ) ; } | ||
| ------------------------ | ||
| | | | ||
| | in this macro invocation (#2) | ||
| in this expansion of `deep!` (#1) | ||
| | ||
::: <foo macros> | ||
| | ||
1 | ( ) => { bar ! ( ) ; } | ||
| ------------------------ | ||
| | | | ||
| | in this macro invocation (#3) | ||
| in this expansion of `foo!` (#2) | ||
| | ||
::: <bar macros> | ||
| | ||
1 | ( ) => { ping ! ( ) ; } | ||
| ------------------------- | ||
| | | | ||
| | in this macro invocation (#4) | ||
| in this expansion of `bar!` (#3) | ||
| | ||
::: <ping macros> | ||
| | ||
1 | ( ) => { pong ! ( ) ; } | ||
| ------------------------- | ||
| | | | ||
| | in this macro invocation (#5) | ||
| in this expansion of `ping!` (#4) | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to 3 previous errors | ||
|