Skip to content

Commit

Permalink
--bless some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Mar 10, 2020
1 parent b3bc427 commit cf2d423
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 200 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ LL | produces_async! {}
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: you can escape reserved keywords to use them as identifiers
|
LL | () => (pub fn r#async () { })
| ^^^^^^^
LL | r#async
|

error: aborting due to previous error

Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ LL | r#async = consumes_async_raw!(async);
| ^^^^^ no rules expected this token in macro call

error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
--> <::edition_kw_macro_2015::passes_ident macros>:1:22
--> $DIR/auxiliary/edition-kw-macro-2015.rs:27:23
|
LL | ($ i : ident) => ($ i)
| ^ expected one of `move`, `|`, or `||`
LL | ($i: ident) => ($i)
| ^ expected one of `move`, `|`, or `||`
|
::: $DIR/edition-keywords-2018-2015-parsing.rs:16:8
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ LL | produces_async! {}
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: you can escape reserved keywords to use them as identifiers
|
LL | () => (pub fn r#async () { })
| ^^^^^^^
LL | r#async
|

error: aborting due to previous error

Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ LL | r#async = consumes_async_raw!(async);
| ^^^^^ no rules expected this token in macro call

error: macro expansion ends with an incomplete expression: expected one of `move`, `|`, or `||`
--> <::edition_kw_macro_2018::passes_ident macros>:1:22
--> $DIR/auxiliary/edition-kw-macro-2018.rs:27:23
|
LL | ($ i : ident) => ($ i)
| ^ expected one of `move`, `|`, or `||`
LL | ($i: ident) => ($i)
| ^ expected one of `move`, `|`, or `||`
|
::: $DIR/edition-keywords-2018-2018-parsing.rs:16:8
|
Expand Down
104 changes: 54 additions & 50 deletions src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,70 @@ LL | pong!();
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error`
--> $DIR/main.rs:10:20
|
LL | / macro_rules! pong {
LL | | () => { syntax error };
| | ^^^^^ expected one of 8 possible tokens
LL | | }
| |_- in this expansion of `pong!`
LL | / macro_rules! pong {
LL | | () => { syntax error };
| | ^^^^^ expected one of 8 possible tokens
LL | | }
| |__- in this expansion of `pong!`
...
LL | ping!();
| -------- in this macro invocation
LL | ping!();
| -------- in this macro invocation
|
::: <::ping::ping macros>:1:1
::: $DIR/auxiliary/ping.rs:5:1
|
LL | () => { pong ! () ; }
| ---------------------
| | |
| | in this macro invocation
| in this expansion of `ping!`
LL | / macro_rules! ping {
LL | | () => {
LL | | pong!();
| | -------- in this macro invocation
LL | | }
LL | | }
| |_- in this expansion of `ping!`

error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error`
--> $DIR/main.rs:10:20
|
LL | / macro_rules! pong {
LL | | () => { syntax error };
| | ^^^^^ expected one of 8 possible tokens
LL | | }
| |_- in this expansion of `pong!` (#5)
LL | / macro_rules! pong {
LL | | () => { syntax error };
| | ^^^^^ expected one of 8 possible tokens
LL | | }
| |__- in this expansion of `pong!` (#5)
...
LL | deep!();
| -------- in this macro invocation (#1)
LL | deep!();
| -------- in this macro invocation (#1)
|
::: <::ping::deep macros>:1:1
::: $DIR/auxiliary/ping.rs:5:1
|
LL | () => { foo ! () ; }
| --------------------
| | |
| | in this macro invocation (#2)
| in this expansion of `deep!` (#1)
|
::: <::ping::foo macros>:1:1
|
LL | () => { bar ! () ; }
| --------------------
| | |
| | in this macro invocation (#3)
| in this expansion of `foo!` (#2)
|
::: <::ping::bar macros>:1:1
|
LL | () => { ping ! () ; }
| ---------------------
| | |
| | in this macro invocation (#4)
| in this expansion of `bar!` (#3)
|
::: <::ping::ping macros>:1:1
|
LL | () => { pong ! () ; }
| ---------------------
| | |
| | in this macro invocation (#5)
| in this expansion of `ping!` (#4)
LL | / macro_rules! ping {
LL | | () => {
LL | | pong!();
| | -------- in this macro invocation (#5)
LL | | }
LL | | }
| |_- in this expansion of `ping!` (#4)
...
LL | / macro_rules! deep {
LL | | () => {
LL | | foo!();
| | ------- in this macro invocation (#2)
LL | | }
LL | | }
| |__- in this expansion of `deep!` (#1)
...
LL | / macro_rules! foo {
LL | | () => {
LL | | bar!();
| | ------- in this macro invocation (#3)
LL | | }
LL | | }
| |__- in this expansion of `foo!` (#2)
...
LL | / macro_rules! bar {
LL | | () => {
LL | | ping!();
| | -------- in this macro invocation (#4)
LL | | }
LL | | }
| |__- in this expansion of `bar!` (#3)

error: aborting due to 3 previous errors

10 changes: 7 additions & 3 deletions src/test/ui/macros/unknown-builtin.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ LL | macro_rules! unknown { () => () }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: cannot find a built-in macro with name `line`
--> <::core::macros::builtin::line macros>:1:1
--> $SRC_DIR/libcore/macros/mod.rs:LL:COL
|
LL | () => { } ;
| ^^^^^^^^^^^
LL | / macro_rules! line {
LL | | () => {
LL | | /* compiler built-in */
LL | | };
LL | | }
| |_____^

error: aborting due to 2 previous errors

7 changes: 5 additions & 2 deletions src/test/ui/methods/method-on-ambiguous-numeric-type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ LL | ($ident:ident) => { let $ident: i32 = 42; }
error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
--> $DIR/method-on-ambiguous-numeric-type.rs:30:9
|
LL | mac!(bar);
| ---------- you must specify a type for this binding, like `i32`
LL | bar.pow(2);
| ^^^
|
help: you must specify a type for this binding, like `i32`
|
LL | ($ident:ident) => { let $ident: i32 = 42; }
| ^^^^^^^^^^^

error: aborting due to 5 previous errors

Expand Down
19 changes: 4 additions & 15 deletions src/test/ui/proc-macro/mixed-site-span.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,10 @@ LL | local_def;
| ^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `ItemUse` in crate `$crate`
--> $DIR/auxiliary/mixed-site-span.rs:14:1
|
LL | / pub fn proc_macro_rules(input: TokenStream) -> TokenStream {
LL | | if input.is_empty() {
LL | | let id = |s| TokenTree::from(Ident::new(s, Span::mixed_site()));
LL | | let item_def = id("ItemDef");
... |
LL | | }
LL | | }
| |_^ not found in `$crate`
|
::: $DIR/mixed-site-span.rs:26:1
|
LL | pass_dollar_crate!();
| --------------------- in this macro invocation
--> $DIR/mixed-site-span.rs:26:1
|
LL | pass_dollar_crate!();
| ^^^^^^^^^^^^^^^^^^^^^ not found in `$crate`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: possible candidate is found in another module, you can import it into scope
Expand Down
Loading

0 comments on commit cf2d423

Please sign in to comment.