diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
commit | 9918693037dce8aa4bb6f08741b6812923486c18 (patch) | |
tree | 21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /tests/ui/proc-macro | |
parent | Releasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff) | |
download | rustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
88 files changed, 392 insertions, 122 deletions
diff --git a/tests/ui/proc-macro/allowed-attr-stmt-expr.stdout b/tests/ui/proc-macro/allowed-attr-stmt-expr.stdout index 4f8730053..8459f4e63 100644 --- a/tests/ui/proc-macro/allowed-attr-stmt-expr.stdout +++ b/tests/ui/proc-macro/allowed-attr-stmt-expr.stdout @@ -1,4 +1,5 @@ -PRINT-ATTR INPUT (DISPLAY): struct ItemWithSemi ; +PRINT-ATTR INPUT (DISPLAY): struct ItemWithSemi; +PRINT-ATTR RE-COLLECTED (DISPLAY): struct ItemWithSemi ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", @@ -45,7 +46,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/allowed-attr-stmt-expr.rs:53:27: 53:29 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): #[expect_let] let string = "Hello, world!" ; +PRINT-ATTR INPUT (DISPLAY): #[expect_let] let string = "Hello, world!"; +PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_let] let string = "Hello, world!" ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', @@ -87,7 +89,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/allowed-attr-stmt-expr.rs:57:33: 57:34 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string) ; +PRINT-ATTR INPUT (DISPLAY): #[expect_my_macro_stmt] my_macro!("{}", string); +PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', @@ -140,7 +143,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/allowed-attr-stmt-expr.rs:61:28: 61:29 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {}) ; +PRINT-ATTR INPUT (DISPLAY): second_make_stmt!(#[allow(dead_code)] struct Bar {}); +PRINT-ATTR RE-COLLECTED (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {}) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "second_make_stmt", @@ -288,7 +292,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/allowed-attr-stmt-expr.rs:68:18: 68:20 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): #[rustc_dummy] struct NonBracedStruct ; +PRINT-ATTR INPUT (DISPLAY): #[rustc_dummy] struct NonBracedStruct; +PRINT-ATTR RE-COLLECTED (DISPLAY): #[rustc_dummy] struct NonBracedStruct ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', diff --git a/tests/ui/proc-macro/ambiguous-builtin-attrs-test.stderr b/tests/ui/proc-macro/ambiguous-builtin-attrs-test.stderr index 316eb636b..346cebf63 100644 --- a/tests/ui/proc-macro/ambiguous-builtin-attrs-test.stderr +++ b/tests/ui/proc-macro/ambiguous-builtin-attrs-test.stderr @@ -4,6 +4,6 @@ error[E0425]: cannot find value `NonExistent` in this scope LL | NonExistent; | ^^^^^^^^^^^ not found in this scope -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/proc-macro/attr-complex-fn.stdout b/tests/ui/proc-macro/attr-complex-fn.stdout index b12eb587f..7c23d1eca 100644 --- a/tests/ui/proc-macro/attr-complex-fn.stdout +++ b/tests/ui/proc-macro/attr-complex-fn.stdout @@ -1,4 +1,5 @@ -PRINT-ATTR INPUT (DISPLAY): fn foo < T : MyTrait < MyStruct < { true } >> > () {} +PRINT-ATTR INPUT (DISPLAY): fn foo<T: MyTrait<MyStruct<{ true }>>>() {} +PRINT-ATTR RE-COLLECTED (DISPLAY): fn foo < T : MyTrait < MyStruct < { true } >>> () {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", @@ -76,7 +77,9 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/attr-complex-fn.rs:19:42: 19:44 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): impl < T > MyTrait < T > for MyStruct < { true } > { #! [rustc_dummy] } +PRINT-ATTR INPUT (DISPLAY): impl<T> MyTrait<T> for MyStruct<{ true }> { #![rustc_dummy] } +PRINT-ATTR RE-COLLECTED (DISPLAY): impl < T > MyTrait < T > for MyStruct < { true } > { #![rustc_dummy] } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): impl < T > MyTrait < T > for MyStruct < { true } > { #! [rustc_dummy] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "impl", diff --git a/tests/ui/proc-macro/attr-stmt-expr.stdout b/tests/ui/proc-macro/attr-stmt-expr.stdout index c6d77e0ed..5e09198bb 100644 --- a/tests/ui/proc-macro/attr-stmt-expr.stdout +++ b/tests/ui/proc-macro/attr-stmt-expr.stdout @@ -29,7 +29,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/attr-stmt-expr.rs:45:27: 45:29 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): #[expect_let] let string = "Hello, world!" ; +PRINT-ATTR INPUT (DISPLAY): #[expect_let] let string = "Hello, world!"; +PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_let] let string = "Hello, world!" ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', @@ -71,7 +72,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/attr-stmt-expr.rs:49:33: 49:34 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string) ; +PRINT-ATTR INPUT (DISPLAY): #[expect_my_macro_stmt] my_macro!("{}", string); +PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', @@ -124,7 +126,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/attr-stmt-expr.rs:53:28: 53:29 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {}) ; +PRINT-ATTR INPUT (DISPLAY): second_make_stmt!(#[allow(dead_code)] struct Bar {}); +PRINT-ATTR RE-COLLECTED (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {}) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "second_make_stmt", diff --git a/tests/ui/proc-macro/attribute-after-derive.stdout b/tests/ui/proc-macro/attribute-after-derive.stdout index 1b17d6047..6d9531df8 100644 --- a/tests/ui/proc-macro/attribute-after-derive.stdout +++ b/tests/ui/proc-macro/attribute-after-derive.stdout @@ -1,4 +1,5 @@ -PRINT-ATTR INPUT (DISPLAY): #[derive(Print)] struct AttributeDerive { #[cfg(FALSE)] field : u8, } +PRINT-ATTR INPUT (DISPLAY): #[derive(Print)] struct AttributeDerive { #[cfg(FALSE)] field: u8, } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[derive(Print)] struct AttributeDerive { #[cfg(FALSE)] field : u8, } PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', @@ -130,7 +131,8 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: $DIR/attribute-after-derive.rs:23:24: 26:2 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): struct DeriveAttribute { #[cfg(FALSE)] field : u8, } +PRINT-ATTR INPUT (DISPLAY): struct DeriveAttribute { #[cfg(FALSE)] field: u8, } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): struct DeriveAttribute { #[cfg(FALSE)] field : u8, } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", diff --git a/tests/ui/proc-macro/attribute-spans-preserved.stdout b/tests/ui/proc-macro/attribute-spans-preserved.stdout index cf9a97491..190098d02 100644 --- a/tests/ui/proc-macro/attribute-spans-preserved.stdout +++ b/tests/ui/proc-macro/attribute-spans-preserved.stdout @@ -1 +1 @@ -fn main() { let y : u32 = "z" ; { let x : u32 = "y" ; } } +fn main() { let y : u32 = "z" ; { let x: u32 = "y"; } } diff --git a/tests/ui/proc-macro/auxiliary/attr-stmt-expr-rpass.rs b/tests/ui/proc-macro/auxiliary/attr-stmt-expr-rpass.rs index 5b386b46b..76346d9a1 100644 --- a/tests/ui/proc-macro/auxiliary/attr-stmt-expr-rpass.rs +++ b/tests/ui/proc-macro/auxiliary/attr-stmt-expr-rpass.rs @@ -10,14 +10,14 @@ use proc_macro::TokenStream; #[proc_macro_attribute] pub fn expect_let(attr: TokenStream, item: TokenStream) -> TokenStream { assert!(attr.to_string().is_empty()); - assert_eq!(item.to_string(), "let string = \"Hello, world!\" ;"); + assert_eq!(item.to_string(), "let string = \"Hello, world!\";"); item } #[proc_macro_attribute] pub fn expect_print_stmt(attr: TokenStream, item: TokenStream) -> TokenStream { assert!(attr.to_string().is_empty()); - assert_eq!(item.to_string(), "println! (\"{}\", string) ;"); + assert_eq!(item.to_string(), "println!(\"{}\", string);"); item } @@ -31,7 +31,7 @@ pub fn expect_expr(attr: TokenStream, item: TokenStream) -> TokenStream { #[proc_macro_attribute] pub fn expect_print_expr(attr: TokenStream, item: TokenStream) -> TokenStream { assert!(attr.to_string().is_empty()); - assert_eq!(item.to_string(), "println! (\"{}\", string)"); + assert_eq!(item.to_string(), "println!(\"{}\", string)"); item } @@ -40,7 +40,6 @@ pub fn no_output(attr: TokenStream, item: TokenStream) -> TokenStream { assert!(attr.to_string().is_empty()); assert!(!item.to_string().is_empty()); "".parse().unwrap() - } #[proc_macro_attribute] diff --git a/tests/ui/proc-macro/auxiliary/attr-stmt-expr.rs b/tests/ui/proc-macro/auxiliary/attr-stmt-expr.rs index 4d6dc06b4..7a29894bb 100644 --- a/tests/ui/proc-macro/auxiliary/attr-stmt-expr.rs +++ b/tests/ui/proc-macro/auxiliary/attr-stmt-expr.rs @@ -31,7 +31,7 @@ pub fn expect_expr(attr: TokenStream, item: TokenStream) -> TokenStream { #[proc_macro_attribute] pub fn expect_my_macro_expr(attr: TokenStream, item: TokenStream) -> TokenStream { assert!(attr.to_string().is_empty()); - assert_eq!(item.to_string(), "my_macro! (\"{}\", string)"); + assert_eq!(item.to_string(), "my_macro!(\"{}\", string)"); item } diff --git a/tests/ui/proc-macro/auxiliary/derive-a.rs b/tests/ui/proc-macro/auxiliary/derive-a.rs index 79a3864bf..cd2be5fd8 100644 --- a/tests/ui/proc-macro/auxiliary/derive-a.rs +++ b/tests/ui/proc-macro/auxiliary/derive-a.rs @@ -10,6 +10,6 @@ use proc_macro::TokenStream; #[proc_macro_derive(A)] pub fn derive(input: TokenStream) -> TokenStream { let input = input.to_string(); - assert!(input.contains("struct A ;")); + assert!(input.contains("struct A;")); "".parse().unwrap() } diff --git a/tests/ui/proc-macro/auxiliary/derive-atob.rs b/tests/ui/proc-macro/auxiliary/derive-atob.rs index 207b7fd32..e78e5bb8f 100644 --- a/tests/ui/proc-macro/auxiliary/derive-atob.rs +++ b/tests/ui/proc-macro/auxiliary/derive-atob.rs @@ -10,6 +10,6 @@ use proc_macro::TokenStream; #[proc_macro_derive(AToB)] pub fn derive(input: TokenStream) -> TokenStream { let input = input.to_string(); - assert_eq!(input, "struct A ;"); + assert_eq!(input, "struct A;"); "struct B;".parse().unwrap() } diff --git a/tests/ui/proc-macro/auxiliary/derive-b-rpass.rs b/tests/ui/proc-macro/auxiliary/derive-b-rpass.rs index 641a95f78..3e6af67a9 100644 --- a/tests/ui/proc-macro/auxiliary/derive-b-rpass.rs +++ b/tests/ui/proc-macro/auxiliary/derive-b-rpass.rs @@ -10,7 +10,7 @@ use proc_macro::TokenStream; #[proc_macro_derive(B, attributes(B, C))] pub fn derive(input: TokenStream) -> TokenStream { let input = input.to_string(); - assert!(input.contains("#[B [arbitrary tokens]]")); + assert!(input.contains("#[B[arbitrary tokens]]")); assert!(input.contains("struct B {")); assert!(input.contains("#[C]")); "".parse().unwrap() diff --git a/tests/ui/proc-macro/auxiliary/derive-ctod.rs b/tests/ui/proc-macro/auxiliary/derive-ctod.rs index 2efe5a913..dbf44ed1b 100644 --- a/tests/ui/proc-macro/auxiliary/derive-ctod.rs +++ b/tests/ui/proc-macro/auxiliary/derive-ctod.rs @@ -10,6 +10,6 @@ use proc_macro::TokenStream; #[proc_macro_derive(CToD)] pub fn derive(input: TokenStream) -> TokenStream { let input = input.to_string(); - assert_eq!(input, "struct C ;"); + assert_eq!(input, "struct C;"); "struct D;".parse().unwrap() } diff --git a/tests/ui/proc-macro/auxiliary/derive-same-struct.rs b/tests/ui/proc-macro/auxiliary/derive-same-struct.rs index 7598d632c..ce7a50d23 100644 --- a/tests/ui/proc-macro/auxiliary/derive-same-struct.rs +++ b/tests/ui/proc-macro/auxiliary/derive-same-struct.rs @@ -10,12 +10,12 @@ use proc_macro::TokenStream; #[proc_macro_derive(AToB)] pub fn derive1(input: TokenStream) -> TokenStream { println!("input1: {:?}", input.to_string()); - assert_eq!(input.to_string(), "struct A ;"); + assert_eq!(input.to_string(), "struct A;"); "#[derive(BToC)] struct B;".parse().unwrap() } #[proc_macro_derive(BToC)] pub fn derive2(input: TokenStream) -> TokenStream { - assert_eq!(input.to_string(), "struct B ;"); + assert_eq!(input.to_string(), "struct B;"); "struct C;".parse().unwrap() } diff --git a/tests/ui/proc-macro/auxiliary/derive-union.rs b/tests/ui/proc-macro/auxiliary/derive-union.rs index 05883170c..d950e1e77 100644 --- a/tests/ui/proc-macro/auxiliary/derive-union.rs +++ b/tests/ui/proc-macro/auxiliary/derive-union.rs @@ -12,7 +12,7 @@ pub fn derive(input: TokenStream) -> TokenStream { let input = input.to_string(); assert!(input.contains("#[repr(C)]")); assert!(input.contains("union Test {")); - assert!(input.contains("a : u8,")); + assert!(input.contains("a: u8,")); assert!(input.contains("}")); "".parse().unwrap() } diff --git a/tests/ui/proc-macro/auxiliary/edition-gated-async-move-syntax.rs b/tests/ui/proc-macro/auxiliary/edition-gated-async-move-syntax.rs new file mode 100644 index 000000000..ce7e60356 --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/edition-gated-async-move-syntax.rs @@ -0,0 +1,39 @@ +// force-host +// no-prefer-dynamic + +// Proc macro helper for issue #89699, used by tests/ui/proc-macro/edition-gated-async-move- +// syntax-issue89699.rs, emitting an `async move` closure. This syntax is only available in +// editions 2018 and up, but is used in edition 2015 in the test. + +#![crate_type = "proc-macro"] + +extern crate proc_macro; +use proc_macro::*; + +#[proc_macro_attribute] +pub fn foo(_attr: TokenStream, item: TokenStream) -> TokenStream { + let tt = item.into_iter().next().unwrap(); + let sp = tt.span(); + let mut arg = TokenStream::new(); + let mut g = Group::new(Delimiter::Brace, TokenStream::new()); + g.set_span(sp); + arg.extend([ + TokenTree::Ident(Ident::new("async", sp)), + TokenTree::Ident(Ident::new("move", sp)), + TokenTree::Group(g), + ]); + let mut body = TokenStream::new(); + body.extend([ + TokenTree::Ident(Ident::new("async_main", sp)), + TokenTree::Group(Group::new(Delimiter::Parenthesis, arg)), + ]); + + let mut ret = TokenStream::new(); + ret.extend([ + TokenTree::Ident(Ident::new("fn", sp)), + TokenTree::Ident(Ident::new("main", sp)), + TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())), + TokenTree::Group(Group::new(Delimiter::Brace, body)), + ]); + ret +} diff --git a/tests/ui/proc-macro/auxiliary/env.rs b/tests/ui/proc-macro/auxiliary/env.rs new file mode 100644 index 000000000..58bcb08bf --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/env.rs @@ -0,0 +1,28 @@ +// force-host +// no-prefer-dynamic + +#![crate_type = "proc-macro"] +#![feature(proc_macro_tracked_env)] + +extern crate proc_macro; + +use proc_macro::TokenStream; +use proc_macro::tracked_env::var; + +#[proc_macro] +pub fn generate_const(input: TokenStream) -> TokenStream { + let the_const = match var("THE_CONST") { + Ok(x) if x == "12" => { + "const THE_CONST: u32 = 12;" + } + _ => { + "const THE_CONST: u32 = 0;" + } + }; + let another = if var("ANOTHER").is_ok() { + "const ANOTHER: u32 = 1;" + } else { + "const ANOTHER: u32 = 2;" + }; + format!("{the_const}{another}").parse().unwrap() +} diff --git a/tests/ui/proc-macro/auxiliary/expand-with-a-macro.rs b/tests/ui/proc-macro/auxiliary/expand-with-a-macro.rs index d779d57af..5155a4b85 100644 --- a/tests/ui/proc-macro/auxiliary/expand-with-a-macro.rs +++ b/tests/ui/proc-macro/auxiliary/expand-with-a-macro.rs @@ -11,7 +11,7 @@ use proc_macro::TokenStream; #[proc_macro_derive(A)] pub fn derive(input: TokenStream) -> TokenStream { let input = input.to_string(); - assert!(input.contains("struct A ;")); + assert!(input.contains("struct A;")); r#" impl A { fn a(&self) { diff --git a/tests/ui/proc-macro/auxiliary/issue-79825.rs b/tests/ui/proc-macro/auxiliary/issue-79825.rs index 930891b1d..69cf5904f 100644 --- a/tests/ui/proc-macro/auxiliary/issue-79825.rs +++ b/tests/ui/proc-macro/auxiliary/issue-79825.rs @@ -8,7 +8,7 @@ use proc_macro::TokenStream; #[proc_macro_attribute] pub fn assert_input(args: TokenStream, input: TokenStream) -> TokenStream { - assert_eq!(input.to_string(), "trait Alias = Sized ;"); + assert_eq!(input.to_string(), "trait Alias = Sized;"); assert!(args.is_empty()); TokenStream::new() } diff --git a/tests/ui/proc-macro/capture-macro-rules-invoke.stdout b/tests/ui/proc-macro/capture-macro-rules-invoke.stdout index 01d71ff98..71e34119b 100644 --- a/tests/ui/proc-macro/capture-macro-rules-invoke.stdout +++ b/tests/ui/proc-macro/capture-macro-rules-invoke.stdout @@ -14,6 +14,8 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ PRINT-BANG INPUT (DISPLAY): 1 + 1, { "a" }, let a = 1;, String, my_name, 'a, my_val = 30, std::option::Option, pub(in some::path) , [a b c], -30 PRINT-BANG RE-COLLECTED (DISPLAY): 1 + 1, { "a" }, let a = 1, String, my_name, 'a, my_val = 30, +std::option::Option, pub(in some::path), [a b c], -30 +PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): 1 + 1, { "a" }, let a = 1, String, my_name, 'a, my_val = 30, std :: option :: Option, pub(in some :: path), [a b c], - 30 PRINT-BANG INPUT (DEBUG): TokenStream [ Group { diff --git a/tests/ui/proc-macro/capture-unglued-token.stdout b/tests/ui/proc-macro/capture-unglued-token.stdout index a0d2178f0..84b7ca355 100644 --- a/tests/ui/proc-macro/capture-unglued-token.stdout +++ b/tests/ui/proc-macro/capture-unglued-token.stdout @@ -1,5 +1,5 @@ PRINT-BANG INPUT (DISPLAY): Vec<u8> -PRINT-BANG RE-COLLECTED (DISPLAY): Vec < u8 > +PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): Vec < u8 > PRINT-BANG INPUT (DEBUG): TokenStream [ Group { delimiter: None, diff --git a/tests/ui/proc-macro/cfg-eval-fail.stderr b/tests/ui/proc-macro/cfg-eval-fail.stderr index df8b6d5f3..945ad46bf 100644 --- a/tests/ui/proc-macro/cfg-eval-fail.stderr +++ b/tests/ui/proc-macro/cfg-eval-fail.stderr @@ -4,5 +4,5 @@ error: removing an expression is not supported in this position LL | let _ = #[cfg_eval] #[cfg(FALSE)] 0; | ^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/cfg-eval-inner.stdout b/tests/ui/proc-macro/cfg-eval-inner.stdout index 9d25def58..43ae47c20 100644 --- a/tests/ui/proc-macro/cfg-eval-inner.stdout +++ b/tests/ui/proc-macro/cfg-eval-inner.stdout @@ -1,4 +1,16 @@ -PRINT-ATTR INPUT (DISPLAY): impl Foo < +PRINT-ATTR INPUT (DISPLAY): impl +Foo<[u8; +{ + #![rustc_dummy(cursed_inner)] #![allow(unused)] struct Inner + { field: [u8; { #![rustc_dummy(another_cursed_inner)] 1 }] } 0 +}]> { #![rustc_dummy(evaluated_attr)] fn bar() {} } +PRINT-ATTR RE-COLLECTED (DISPLAY): impl Foo < +[u8; +{ + #![rustc_dummy(cursed_inner)] #![allow(unused)] struct Inner + { field: [u8; { #![rustc_dummy(another_cursed_inner)] 1 }] } 0 +}] > { #![rustc_dummy(evaluated_attr)] fn bar() {} } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): impl Foo < [u8 ; { #! [rustc_dummy(cursed_inner)] #! [allow(unused)] struct Inner @@ -35,7 +47,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ stream: TokenStream [ Punct { ch: '#', - spacing: Alone, + spacing: Joint, span: $DIR/cfg-eval-inner.rs:19:5: 19:6 (#0), }, Punct { @@ -130,7 +142,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ stream: TokenStream [ Punct { ch: '#', - spacing: Alone, + spacing: Joint, span: $DIR/cfg-eval-inner.rs:23:13: 23:14 (#0), }, Punct { @@ -195,7 +207,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ stream: TokenStream [ Punct { ch: '#', - spacing: Alone, + spacing: Joint, span: $DIR/cfg-eval-inner.rs:32:5: 32:6 (#0), }, Punct { diff --git a/tests/ui/proc-macro/cfg-eval.stdout b/tests/ui/proc-macro/cfg-eval.stdout index 6732caf08..e26e16f5a 100644 --- a/tests/ui/proc-macro/cfg-eval.stdout +++ b/tests/ui/proc-macro/cfg-eval.stdout @@ -1,4 +1,5 @@ -PRINT-ATTR INPUT (DISPLAY): struct S1 { #[cfg(all())] #[allow()] field_true : u8, } +PRINT-ATTR INPUT (DISPLAY): struct S1 { #[cfg(all())] #[allow()] field_true: u8, } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): struct S1 { #[cfg(all())] #[allow()] field_true : u8, } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", diff --git a/tests/ui/proc-macro/custom-attr-only-one-derive.rs b/tests/ui/proc-macro/custom-attr-only-one-derive.rs index 2cd5b4873..901394384 100644 --- a/tests/ui/proc-macro/custom-attr-only-one-derive.rs +++ b/tests/ui/proc-macro/custom-attr-only-one-derive.rs @@ -1,8 +1,6 @@ // run-pass // aux-build:custom-attr-only-one-derive.rs -#![feature(rust_2018_preview)] - #[macro_use] extern crate custom_attr_only_one_derive; diff --git a/tests/ui/proc-macro/define-two.stderr b/tests/ui/proc-macro/define-two.stderr index bf1bd8427..a39ce366f 100644 --- a/tests/ui/proc-macro/define-two.stderr +++ b/tests/ui/proc-macro/define-two.stderr @@ -9,6 +9,6 @@ LL | #[proc_macro_derive(A)] | = note: `A` must be defined only once in the macro namespace of this module -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0428`. diff --git a/tests/ui/proc-macro/derive-helper-legacy-limits.stderr b/tests/ui/proc-macro/derive-helper-legacy-limits.stderr index 186f38a00..f5cd45543 100644 --- a/tests/ui/proc-macro/derive-helper-legacy-limits.stderr +++ b/tests/ui/proc-macro/derive-helper-legacy-limits.stderr @@ -4,5 +4,5 @@ error: cannot find attribute `empty_helper` in this scope LL | #[empty_helper] | ^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/derive-same-struct.stdout b/tests/ui/proc-macro/derive-same-struct.stdout index 7478d9741..77605de5e 100644 --- a/tests/ui/proc-macro/derive-same-struct.stdout +++ b/tests/ui/proc-macro/derive-same-struct.stdout @@ -1 +1 @@ -input1: "struct A ;" +input1: "struct A;" diff --git a/tests/ui/proc-macro/derive-still-gated.stderr b/tests/ui/proc-macro/derive-still-gated.stderr index 99289fdfe..25777f72b 100644 --- a/tests/ui/proc-macro/derive-still-gated.stderr +++ b/tests/ui/proc-macro/derive-still-gated.stderr @@ -4,5 +4,5 @@ error: cannot find attribute `derive_Empty` in this scope LL | #[derive_Empty] | ^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/disappearing-resolution.stderr b/tests/ui/proc-macro/disappearing-resolution.stderr index 5b969549a..e6d086868 100644 --- a/tests/ui/proc-macro/disappearing-resolution.stderr +++ b/tests/ui/proc-macro/disappearing-resolution.stderr @@ -19,7 +19,11 @@ note: ...and refers to the derive macro `Empty` which is defined here --> $DIR/auxiliary/test-macros.rs:25:1 | LL | pub fn empty_derive(_: TokenStream) -> TokenStream { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider importing it directly + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ you could import this directly +help: import `Empty` directly + | +LL | use test_macros::Empty; + | ~~~~~~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/proc-macro/doc-comment-preserved.stdout b/tests/ui/proc-macro/doc-comment-preserved.stdout index f4160d7da..b0ea180d9 100644 --- a/tests/ui/proc-macro/doc-comment-preserved.stdout +++ b/tests/ui/proc-macro/doc-comment-preserved.stdout @@ -5,7 +5,7 @@ PRINT-BANG INPUT (DISPLAY): /** * DOC * ******* */ - pub struct S ; + pub struct S; PRINT-BANG RE-COLLECTED (DISPLAY): #[doc = "\n*******\n* DOC *\n* DOC *\n* DOC *\n*******\n"] pub struct S ; PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { diff --git a/tests/ui/proc-macro/dollar-crate-issue-57089.stdout b/tests/ui/proc-macro/dollar-crate-issue-57089.stdout index de4f0c000..7f97ac9db 100644 --- a/tests/ui/proc-macro/dollar-crate-issue-57089.stdout +++ b/tests/ui/proc-macro/dollar-crate-issue-57089.stdout @@ -1,4 +1,5 @@ -PRINT-BANG INPUT (DISPLAY): struct M($crate :: S) ; +PRINT-BANG INPUT (DISPLAY): struct M($crate :: S); +PRINT-BANG RE-COLLECTED (DISPLAY): struct M($crate :: S) ; PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "struct", @@ -38,7 +39,8 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/dollar-crate-issue-57089.rs:17:32: 17:33 (#3), }, ] -PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S) ; +PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S); +PRINT-ATTR RE-COLLECTED (DISPLAY): struct A($crate :: S) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", diff --git a/tests/ui/proc-macro/dollar-crate-issue-62325.stdout b/tests/ui/proc-macro/dollar-crate-issue-62325.stdout index c7e72bf4f..96161049e 100644 --- a/tests/ui/proc-macro/dollar-crate-issue-62325.stdout +++ b/tests/ui/proc-macro/dollar-crate-issue-62325.stdout @@ -1,4 +1,5 @@ -PRINT-ATTR INPUT (DISPLAY): struct A(identity! ($crate :: S)) ; +PRINT-ATTR INPUT (DISPLAY): struct A(identity! ($crate :: S)); +PRINT-ATTR RE-COLLECTED (DISPLAY): struct A(identity! ($crate :: S)) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", @@ -53,7 +54,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/dollar-crate-issue-62325.rs:19:35: 19:36 (#3), }, ] -PRINT-ATTR INPUT (DISPLAY): struct B(identity! ($crate :: S)) ; +PRINT-ATTR INPUT (DISPLAY): struct B(identity! ($crate :: S)); +PRINT-ATTR RE-COLLECTED (DISPLAY): struct B(identity! ($crate :: S)) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", diff --git a/tests/ui/proc-macro/dollar-crate.stdout b/tests/ui/proc-macro/dollar-crate.stdout index 0f5f87cec..a6bdab004 100644 --- a/tests/ui/proc-macro/dollar-crate.stdout +++ b/tests/ui/proc-macro/dollar-crate.stdout @@ -1,4 +1,5 @@ -PRINT-BANG INPUT (DISPLAY): struct M($crate :: S) ; +PRINT-BANG INPUT (DISPLAY): struct M($crate :: S); +PRINT-BANG RE-COLLECTED (DISPLAY): struct M($crate :: S) ; PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "struct", @@ -38,7 +39,8 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/dollar-crate.rs:20:36: 20:37 (#3), }, ] -PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S) ; +PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S); +PRINT-ATTR RE-COLLECTED (DISPLAY): struct A($crate :: S) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", @@ -78,7 +80,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/dollar-crate.rs:24:32: 24:33 (#3), }, ] -PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S) ; +PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S); +PRINT-DERIVE RE-COLLECTED (DISPLAY): struct D($crate :: S) ; PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", @@ -118,7 +121,8 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: $DIR/dollar-crate.rs:27:32: 27:33 (#3), }, ] -PRINT-BANG INPUT (DISPLAY): struct M($crate :: S) ; +PRINT-BANG INPUT (DISPLAY): struct M($crate :: S); +PRINT-BANG RE-COLLECTED (DISPLAY): struct M($crate :: S) ; PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "struct", @@ -158,7 +162,8 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/auxiliary/dollar-crate-external.rs:7:32: 7:33 (#14), }, ] -PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S) ; +PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S); +PRINT-ATTR RE-COLLECTED (DISPLAY): struct A($crate :: S) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", @@ -198,7 +203,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/auxiliary/dollar-crate-external.rs:11:28: 11:29 (#14), }, ] -PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S) ; +PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S); +PRINT-DERIVE RE-COLLECTED (DISPLAY): struct D($crate :: S) ; PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", diff --git a/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs b/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs new file mode 100644 index 000000000..1a9d4601a --- /dev/null +++ b/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.rs @@ -0,0 +1,10 @@ +// aux-build:edition-gated-async-move-syntax.rs +// edition: 2015 + +// Non-regression test for issue #89699, where a proc-macro emitting syntax only available in +// edition 2018 and up (`async move`) is used on edition 2015 + +extern crate edition_gated_async_move_syntax; + +#[edition_gated_async_move_syntax::foo] +fn foo() {} //~ ERROR `async move` blocks are only allowed in Rust 2018 or later diff --git a/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.stderr b/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.stderr new file mode 100644 index 000000000..5123b823f --- /dev/null +++ b/tests/ui/proc-macro/edition-gated-async-move-syntax-issue89699.stderr @@ -0,0 +1,8 @@ +error: `async move` blocks are only allowed in Rust 2018 or later + --> $DIR/edition-gated-async-move-syntax-issue89699.rs:10:1 + | +LL | fn foo() {} + | ^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/proc-macro/env.rs b/tests/ui/proc-macro/env.rs new file mode 100644 index 000000000..1b1d1873e --- /dev/null +++ b/tests/ui/proc-macro/env.rs @@ -0,0 +1,17 @@ +// aux-build:env.rs +// run-pass +// rustc-env: THE_CONST=1 +// compile-flags: -Zunstable-options --env THE_CONST=12 --env ANOTHER=4 + +#![crate_name = "foo"] + +extern crate env; + +use env::generate_const; + +generate_const!(); + +fn main() { + assert_eq!(THE_CONST, 12); + assert_eq!(ANOTHER, 1); +} diff --git a/tests/ui/proc-macro/expand-to-derive.stdout b/tests/ui/proc-macro/expand-to-derive.stdout index 39f009183..9f03a469a 100644 --- a/tests/ui/proc-macro/expand-to-derive.stdout +++ b/tests/ui/proc-macro/expand-to-derive.stdout @@ -1,6 +1,11 @@ PRINT-DERIVE INPUT (DISPLAY): struct Foo { field : + [bool ; { #[rustc_dummy] struct Inner { other_inner_field: u8, } 0 }] +} +PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): struct Foo +{ + field : [bool ; { #[rustc_dummy] struct Inner { other_inner_field : u8, } 0 }] } PRINT-DERIVE INPUT (DEBUG): TokenStream [ diff --git a/tests/ui/proc-macro/expand-to-unstable.stderr b/tests/ui/proc-macro/expand-to-unstable.stderr index b27dcd7e6..dda590ee8 100644 --- a/tests/ui/proc-macro/expand-to-unstable.stderr +++ b/tests/ui/proc-macro/expand-to-unstable.stderr @@ -7,6 +7,6 @@ LL | #[derive(Unstable)] = help: add `#![feature(core_intrinsics)]` to the crate attributes to enable = note: this error originates in the derive macro `Unstable` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/proc-macro/export-macro.stderr b/tests/ui/proc-macro/export-macro.stderr index 36a6a9bb3..410770eca 100644 --- a/tests/ui/proc-macro/export-macro.stderr +++ b/tests/ui/proc-macro/export-macro.stderr @@ -4,5 +4,5 @@ error: cannot export macro_rules! macros from a `proc-macro` crate type currentl LL | macro_rules! foo { | ^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout b/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout index 40181efc0..eda2f433b 100644 --- a/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout +++ b/tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout @@ -122,7 +122,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #3 bytes(306..355), }, ] -PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0; } ; 0 }, } +PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0; }; 0 }, } PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 } ; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { @@ -202,7 +202,8 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #7 bytes(430..483), }, ] -PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { {} } ; 0 }, } +PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { {} }; 0 }, } +PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { {} } ; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "enum", @@ -280,7 +281,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #11 bytes(430..483), }, ] -PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH; } ; 0 }, } +PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH; }; 0 }, } PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH } ; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { @@ -358,7 +359,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #15 bytes(430..483), }, ] -PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0 + 1; } ; 0 }, } +PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0 + 1; }; 0 }, } PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 + 1 } ; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { @@ -449,7 +450,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ span: #19 bytes(430..483), }, ] -PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH + 1; } ; 0 }, } +PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH + 1; }; 0 }, } PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH + 1 } ; 0 }, } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { diff --git a/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr b/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr index 9441cdcc8..1c12a2804 100644 --- a/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr +++ b/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr @@ -30,6 +30,6 @@ LL | #[derive(Empty)] = note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202> = note: `#[warn(legacy_derive_helpers)]` on by default -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/proc-macro/import.stderr b/tests/ui/proc-macro/import.stderr index aae621193..c5d1648ab 100644 --- a/tests/ui/proc-macro/import.stderr +++ b/tests/ui/proc-macro/import.stderr @@ -4,6 +4,6 @@ error[E0432]: unresolved import `test_macros::empty_derive` LL | use test_macros::empty_derive; | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `empty_derive` in the root -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0432`. diff --git a/tests/ui/proc-macro/inert-attribute-order.stdout b/tests/ui/proc-macro/inert-attribute-order.stdout index cc2155459..86b272179 100644 --- a/tests/ui/proc-macro/inert-attribute-order.stdout +++ b/tests/ui/proc-macro/inert-attribute-order.stdout @@ -1,7 +1,11 @@ PRINT-ATTR INPUT (DISPLAY): /// 1 -#[rustfmt :: attr2] #[doc = "3"] #[doc = "4"] #[rustfmt :: attr5] /// 6 -#[print_attr(nodebug)] struct S ; -PRINT-ATTR RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt :: attr2] #[doc = "3"] #[doc = "4"] +#[rustfmt::attr2] #[doc = "3"] #[doc = "4"] #[rustfmt::attr5] /// 6 +#[print_attr(nodebug)] struct S; +PRINT-ATTR RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt::attr2] #[doc = "3"] #[doc = "4"] #[rustfmt::attr5] +#[doc = " 6"] #[print_attr(nodebug)] struct S ; +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt :: attr2] #[doc = "3"] #[doc = "4"] #[rustfmt :: attr5] #[doc = " 6"] #[print_attr(nodebug)] struct S ; -PRINT-ATTR INPUT (DISPLAY): #[doc = " 1"] #[rustfmt :: attr2] #[doc = "3"] #[doc = "4"] +PRINT-ATTR INPUT (DISPLAY): #[doc = " 1"] #[rustfmt::attr2] #[doc = "3"] #[doc = "4"] #[rustfmt::attr5] +#[doc = " 6"] struct S ; +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt :: attr2] #[doc = "3"] #[doc = "4"] #[rustfmt :: attr5] #[doc = " 6"] struct S ; diff --git a/tests/ui/proc-macro/inner-attr-non-inline-mod.stdout b/tests/ui/proc-macro/inner-attr-non-inline-mod.stdout index 6261d82e2..aaec40669 100644 --- a/tests/ui/proc-macro/inner-attr-non-inline-mod.stdout +++ b/tests/ui/proc-macro/inner-attr-non-inline-mod.stdout @@ -1,4 +1,5 @@ -PRINT-ATTR INPUT (DISPLAY): #[deny(unused_attributes)] mod module_with_attrs { #! [rustfmt :: skip] } +PRINT-ATTR INPUT (DISPLAY): #[deny(unused_attributes)] mod module_with_attrs { #![rustfmt::skip] } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[deny(unused_attributes)] mod module_with_attrs { #! [rustfmt :: skip] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', diff --git a/tests/ui/proc-macro/inner-attrs.stdout b/tests/ui/proc-macro/inner-attrs.stdout index ee8adf0b4..037ec044e 100644 --- a/tests/ui/proc-macro/inner-attrs.stdout +++ b/tests/ui/proc-macro/inner-attrs.stdout @@ -6,6 +6,8 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ }, ] PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(second)] fn foo() +{ #![print_target_and_args(third)] #![print_target_and_args(fourth)] } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[print_target_and_args(second)] fn foo() { #! [print_target_and_args(third)] #! [print_target_and_args(fourth)] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { @@ -121,6 +123,8 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ }, ] PRINT-ATTR INPUT (DISPLAY): fn foo() +{ #![print_target_and_args(third)] #![print_target_and_args(fourth)] } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn foo() { #! [print_target_and_args(third)] #! [print_target_and_args(fourth)] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { @@ -210,7 +214,8 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ span: $DIR/inner-attrs.rs:20:30: 20:35 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): fn foo() { #! [print_target_and_args(fourth)] } +PRINT-ATTR INPUT (DISPLAY): fn foo() { #![print_target_and_args(fourth)] } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn foo() { #! [print_target_and_args(fourth)] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", @@ -298,6 +303,8 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ }, ] PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(mod_second)] mod inline_mod +{ #![print_target_and_args(mod_third)] #![print_target_and_args(mod_fourth)] } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[print_target_and_args(mod_second)] mod inline_mod { #! [print_target_and_args(mod_third)] #! [print_target_and_args(mod_fourth)] @@ -411,6 +418,8 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ }, ] PRINT-ATTR INPUT (DISPLAY): mod inline_mod +{ #![print_target_and_args(mod_third)] #![print_target_and_args(mod_fourth)] } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): mod inline_mod { #! [print_target_and_args(mod_third)] #! [print_target_and_args(mod_fourth)] @@ -498,7 +507,8 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ span: $DIR/inner-attrs.rs:27:30: 27:39 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): mod inline_mod { #! [print_target_and_args(mod_fourth)] } +PRINT-ATTR INPUT (DISPLAY): mod inline_mod { #![print_target_and_args(mod_fourth)] } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): mod inline_mod { #! [print_target_and_args(mod_fourth)] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "mod", @@ -569,6 +579,8 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ }, ] PRINT-DERIVE INPUT (DISPLAY): struct MyDerivePrint +{ field: [u8; { match true { _ => { #![rustc_dummy(third)] true } }; 0 }] } +PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): struct MyDerivePrint { field : [u8 ; { match true { _ => { #! [rustc_dummy(third)] true } } ; 0 }] @@ -639,7 +651,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ stream: TokenStream [ Punct { ch: '#', - spacing: Alone, + spacing: Joint, span: $DIR/inner-attrs.rs:40:17: 40:18 (#0), }, Punct { @@ -705,7 +717,9 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ span: $DIR/inner-attrs.rs:49:29: 49:40 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ; +PRINT-ATTR INPUT (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }); +PRINT-ATTR RE-COLLECTED (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ; +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Group { delimiter: Parenthesis, @@ -819,7 +833,9 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ span: $DIR/inner-attrs.rs:56:29: 56:40 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ; +PRINT-ATTR INPUT (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }); +PRINT-ATTR RE-COLLECTED (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ; +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Group { delimiter: Parenthesis, diff --git a/tests/ui/proc-macro/invalid-punct-ident-1.stderr b/tests/ui/proc-macro/invalid-punct-ident-1.stderr index 78aa84401..0013bfd16 100644 --- a/tests/ui/proc-macro/invalid-punct-ident-1.stderr +++ b/tests/ui/proc-macro/invalid-punct-ident-1.stderr @@ -6,5 +6,5 @@ LL | invalid_punct!(); | = help: message: unsupported character `'`'` -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/invalid-punct-ident-2.stderr b/tests/ui/proc-macro/invalid-punct-ident-2.stderr index 66979e756..3de2139d5 100644 --- a/tests/ui/proc-macro/invalid-punct-ident-2.stderr +++ b/tests/ui/proc-macro/invalid-punct-ident-2.stderr @@ -6,5 +6,5 @@ LL | invalid_ident!(); | = help: message: `"*"` is not a valid identifier -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/invalid-punct-ident-3.stderr b/tests/ui/proc-macro/invalid-punct-ident-3.stderr index c096bc8c0..158ba0d4f 100644 --- a/tests/ui/proc-macro/invalid-punct-ident-3.stderr +++ b/tests/ui/proc-macro/invalid-punct-ident-3.stderr @@ -6,5 +6,5 @@ LL | invalid_raw_ident!(); | = help: message: `self` cannot be a raw identifier -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/issue-107113-wrap.stderr b/tests/ui/proc-macro/issue-107113-wrap.stderr index 4122253d2..b54105114 100644 --- a/tests/ui/proc-macro/issue-107113-wrap.stderr +++ b/tests/ui/proc-macro/issue-107113-wrap.stderr @@ -11,6 +11,6 @@ LL | #[issue_107113::main] found unit type `()` = note: this error originates in the attribute macro `issue_107113::main` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/proc-macro/issue-37788.stderr b/tests/ui/proc-macro/issue-37788.stderr index 0a116d6f8..9ce783073 100644 --- a/tests/ui/proc-macro/issue-37788.stderr +++ b/tests/ui/proc-macro/issue-37788.stderr @@ -12,6 +12,6 @@ LL | std::cell::Cell::new(0) = note: expected unit type `()` found struct `Cell<{integer}>` -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/proc-macro/issue-38586.stderr b/tests/ui/proc-macro/issue-38586.stderr index ddd0a0874..004915564 100644 --- a/tests/ui/proc-macro/issue-38586.stderr +++ b/tests/ui/proc-macro/issue-38586.stderr @@ -6,6 +6,6 @@ LL | #[derive(A)] | = note: this error originates in the derive macro `A` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/proc-macro/issue-50493.stderr b/tests/ui/proc-macro/issue-50493.stderr index 23e103dbf..1cd358313 100644 --- a/tests/ui/proc-macro/issue-50493.stderr +++ b/tests/ui/proc-macro/issue-50493.stderr @@ -4,6 +4,6 @@ error[E0742]: visibilities can only be restricted to ancestor modules LL | pub(in restricted) field: usize, | ^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0742`. diff --git a/tests/ui/proc-macro/issue-59191-replace-root-with-fn.stderr b/tests/ui/proc-macro/issue-59191-replace-root-with-fn.stderr index f7516c7d3..08e679a7c 100644 --- a/tests/ui/proc-macro/issue-59191-replace-root-with-fn.stderr +++ b/tests/ui/proc-macro/issue-59191-replace-root-with-fn.stderr @@ -1,4 +1,4 @@ error: requires `sized` lang_item -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/issue-66286.stderr b/tests/ui/proc-macro/issue-66286.stderr index fe2464b3b..fc4c2062f 100644 --- a/tests/ui/proc-macro/issue-66286.stderr +++ b/tests/ui/proc-macro/issue-66286.stderr @@ -9,6 +9,6 @@ help: use angle brackets instead LL | pub extern fn foo(_: Vec<u32>) -> u32 { | ~ ~ -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0214`. diff --git a/tests/ui/proc-macro/issue-75734-pp-paren.stdout b/tests/ui/proc-macro/issue-75734-pp-paren.stdout index 2f7c013e9..ee135366f 100644 --- a/tests/ui/proc-macro/issue-75734-pp-paren.stdout +++ b/tests/ui/proc-macro/issue-75734-pp-paren.stdout @@ -1,4 +1,5 @@ -PRINT-ATTR INPUT (DISPLAY): fn main() { & | _ : u8 | {} ; mul_2! (1 + 1) ; } +PRINT-ATTR INPUT (DISPLAY): fn main() { &|_: u8| {}; mul_2!(1 + 1); } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn main() { &| _ : u8 | {} ; mul_2! (1 + 1) ; } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", diff --git a/tests/ui/proc-macro/issue-75801.stderr b/tests/ui/proc-macro/issue-75801.stderr index ee0a9bd77..3b5f9e3b5 100644 --- a/tests/ui/proc-macro/issue-75801.stderr +++ b/tests/ui/proc-macro/issue-75801.stderr @@ -7,6 +7,6 @@ LL | let _bar: u32 = $arg; LL | foo!("baz"); | ^^^^^ expected `u32`, found `&str` -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/proc-macro/issue-75930-derive-cfg.stdout b/tests/ui/proc-macro/issue-75930-derive-cfg.stdout index 31a1c44b6..47f26451d 100644 --- a/tests/ui/proc-macro/issue-75930-derive-cfg.stdout +++ b/tests/ui/proc-macro/issue-75930-derive-cfg.stdout @@ -1,5 +1,53 @@ PRINT-ATTR INPUT (DISPLAY): #[print_helper(a)] #[allow(dead_code)] #[derive(Print)] #[print_helper(b)] -struct Foo < #[cfg(FALSE)] A, B > +struct Foo<#[cfg(FALSE)] A, B> +{ + #[cfg(FALSE)] first: String, #[cfg_attr(FALSE, deny(warnings))] second: + bool, third: + [u8; + { + #[cfg(FALSE)] struct Bar; #[cfg(not(FALSE))] struct Inner; + #[cfg(FALSE)] let a = 25; match true + { + #[cfg(FALSE)] true => {}, #[cfg_attr(not(FALSE), allow(warnings))] + false => {}, _ => {} + }; #[print_helper(should_be_removed)] fn removed_fn() + { #![cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn kept_fn() + { #![cfg(not(FALSE))] let my_val = true; } enum TupleEnum + { + Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32, + #[cfg(FALSE)] String, u8) + } struct + TupleStruct(#[cfg(FALSE)] String, #[cfg(not(FALSE))] i32, + #[cfg(FALSE)] bool, u8); fn plain_removed_fn() + { #![cfg_attr(not(FALSE), cfg(FALSE))] } 0 + }], #[print_helper(d)] fourth: B +} +PRINT-ATTR RE-COLLECTED (DISPLAY): #[print_helper(a)] #[allow(dead_code)] #[derive(Print)] #[print_helper(b)] +struct Foo <#[cfg(FALSE)] A, B > +{ + #[cfg(FALSE)] first: String, #[cfg_attr(FALSE, deny(warnings))] second: + bool, third: + [u8; + { + #[cfg(FALSE)] struct Bar; #[cfg(not(FALSE))] struct Inner; + #[cfg(FALSE)] let a = 25; match true + { + #[cfg(FALSE)] true => {}, #[cfg_attr(not(FALSE), allow(warnings))] + false => {}, _ => {} + }; #[print_helper(should_be_removed)] fn removed_fn() + { #![cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn kept_fn() + { #![cfg(not(FALSE))] let my_val = true; } enum TupleEnum + { + Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32, + #[cfg(FALSE)] String, u8) + } struct + TupleStruct(#[cfg(FALSE)] String, #[cfg(not(FALSE))] i32, + #[cfg(FALSE)] bool, u8); fn plain_removed_fn() + { #![cfg_attr(not(FALSE), cfg(FALSE))] } 0 + }], #[print_helper(d)] fourth: B +} +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[print_helper(a)] #[allow(dead_code)] #[derive(Print)] #[print_helper(b)] +struct Foo <#[cfg(FALSE)] A, B > { #[cfg(FALSE)] first : String, #[cfg_attr(FALSE, deny(warnings))] second : bool, third : @@ -1272,7 +1320,20 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ span: $DIR/issue-75930-derive-cfg.rs:55:32: 102:2 (#0), }, ] -PRINT-DERIVE INPUT (DISPLAY): #[print_helper(a)] #[allow(dead_code)] #[print_helper(b)] struct Foo < B > +PRINT-DERIVE INPUT (DISPLAY): #[print_helper(a)] #[allow(dead_code)] #[print_helper(b)] struct Foo <B > +{ + second: bool, third: + [u8; + { + #[cfg(not(FALSE))] struct Inner; match true + { #[allow(warnings)] false => {}, _ => {} }; #[print_helper(c)] + #[cfg(not(FALSE))] fn kept_fn() + { #![cfg(not(FALSE))] let my_val = true; } enum TupleEnum + { Foo(#[cfg(not(FALSE))] i32, u8) } struct + TupleStruct(#[cfg(not(FALSE))] i32, u8); 0 + }], #[print_helper(d)] fourth: B +} +PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): #[print_helper(a)] #[allow(dead_code)] #[print_helper(b)] struct Foo <B > { second : bool, third : [u8 ; diff --git a/tests/ui/proc-macro/issue-76270-panic-in-libproc-macro.stderr b/tests/ui/proc-macro/issue-76270-panic-in-libproc-macro.stderr index d69de23a4..7bf85104d 100644 --- a/tests/ui/proc-macro/issue-76270-panic-in-libproc-macro.stderr +++ b/tests/ui/proc-macro/issue-76270-panic-in-libproc-macro.stderr @@ -6,5 +6,5 @@ LL | proc_macro_panic::panic_in_libproc_macro!(); | = help: message: `""` is not a valid identifier -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout b/tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout index ae5e94008..37ecf3a8d 100644 --- a/tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout +++ b/tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout @@ -46,7 +46,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ stream: TokenStream [ Punct { ch: '#', - spacing: Alone, + spacing: Joint, span: $DIR/issue-78675-captured-inner-attrs.rs:28:9: 28:16 (#0), }, Punct { diff --git a/tests/ui/proc-macro/issue-79148.stderr b/tests/ui/proc-macro/issue-79148.stderr index a3b2de01d..8adc4c6e0 100644 --- a/tests/ui/proc-macro/issue-79148.stderr +++ b/tests/ui/proc-macro/issue-79148.stderr @@ -11,6 +11,6 @@ LL | cause_ice!(); | ^^^^^^^^^^^^ = note: this error originates in the macro `cause_ice` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0364`. diff --git a/tests/ui/proc-macro/issue-81543-item-parse-err.stderr b/tests/ui/proc-macro/issue-81543-item-parse-err.stderr index ca5241760..50f9c71eb 100644 --- a/tests/ui/proc-macro/issue-81543-item-parse-err.stderr +++ b/tests/ui/proc-macro/issue-81543-item-parse-err.stderr @@ -4,5 +4,5 @@ error: expected identifier, found `32` LL | fn 32() {} | ^^ expected identifier -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/issue-83469-global-alloc-invalid-stmt.stderr b/tests/ui/proc-macro/issue-83469-global-alloc-invalid-stmt.stderr index ec0e3c4c7..02fcaf542 100644 --- a/tests/ui/proc-macro/issue-83469-global-alloc-invalid-stmt.stderr +++ b/tests/ui/proc-macro/issue-83469-global-alloc-invalid-stmt.stderr @@ -4,5 +4,5 @@ error: allocators must be statics LL | fn inner() {} | ^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/issue-86781-bad-inner-doc.stderr b/tests/ui/proc-macro/issue-86781-bad-inner-doc.stderr index a92f07522..aeb824303 100644 --- a/tests/ui/proc-macro/issue-86781-bad-inner-doc.stderr +++ b/tests/ui/proc-macro/issue-86781-bad-inner-doc.stderr @@ -12,6 +12,6 @@ help: to annotate the struct, change the doc comment from inner to outer style LL | /// Inner doc comment | ~ -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0753`. diff --git a/tests/ui/proc-macro/item-error.stderr b/tests/ui/proc-macro/item-error.stderr index b544be6e9..71d0ee10a 100644 --- a/tests/ui/proc-macro/item-error.stderr +++ b/tests/ui/proc-macro/item-error.stderr @@ -10,6 +10,6 @@ LL ~ struct A<'a> { LL ~ a: &'a u64 | -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0106`. diff --git a/tests/ui/proc-macro/keep-expr-tokens.stdout b/tests/ui/proc-macro/keep-expr-tokens.stdout index fcd72a0e0..8e4d4785e 100644 --- a/tests/ui/proc-macro/keep-expr-tokens.stdout +++ b/tests/ui/proc-macro/keep-expr-tokens.stdout @@ -1,4 +1,5 @@ -PRINT-ATTR INPUT (DISPLAY): #[rustc_dummy] { 1 + 1 ; } +PRINT-ATTR INPUT (DISPLAY): #[rustc_dummy] { 1 +1; } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[rustc_dummy] { 1 + 1 ; } PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', diff --git a/tests/ui/proc-macro/lifetimes.stderr b/tests/ui/proc-macro/lifetimes.stderr index 0c99809ed..315b4c591 100644 --- a/tests/ui/proc-macro/lifetimes.stderr +++ b/tests/ui/proc-macro/lifetimes.stderr @@ -9,5 +9,5 @@ LL | type A = single_quote_alone!(); | = note: this error originates in the macro `single_quote_alone` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/lints_in_proc_macros.stderr b/tests/ui/proc-macro/lints_in_proc_macros.stderr index 4dd8be7d9..244d21860 100644 --- a/tests/ui/proc-macro/lints_in_proc_macros.stderr +++ b/tests/ui/proc-macro/lints_in_proc_macros.stderr @@ -6,6 +6,6 @@ LL | bang_proc_macro2!(); | = note: this error originates in the macro `bang_proc_macro2` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/proc-macro/load-panic-backtrace.stderr b/tests/ui/proc-macro/load-panic-backtrace.stderr index c1a642713..18f513586 100644 --- a/tests/ui/proc-macro/load-panic-backtrace.stderr +++ b/tests/ui/proc-macro/load-panic-backtrace.stderr @@ -8,5 +8,5 @@ LL | #[derive(Panic)] | = help: message: panic-derive -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/load-panic.stderr b/tests/ui/proc-macro/load-panic.stderr index f0d62f690..bb429ad63 100644 --- a/tests/ui/proc-macro/load-panic.stderr +++ b/tests/ui/proc-macro/load-panic.stderr @@ -6,5 +6,5 @@ LL | #[derive(Panic)] | = help: message: panic-derive -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/macro-brackets.stderr b/tests/ui/proc-macro/macro-brackets.stderr index d35163752..f14b5fed6 100644 --- a/tests/ui/proc-macro/macro-brackets.stderr +++ b/tests/ui/proc-macro/macro-brackets.stderr @@ -9,6 +9,6 @@ help: you can cast a `char` to a `u32`, since a `char` always occupies 4 bytes LL | id![static X: u32 = 'a' as u32;]; | ++++++ -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/proc-macro/macro-rules-derive-cfg.stdout b/tests/ui/proc-macro/macro-rules-derive-cfg.stdout index aee0f966d..89817a1ef 100644 --- a/tests/ui/proc-macro/macro-rules-derive-cfg.stdout +++ b/tests/ui/proc-macro/macro-rules-derive-cfg.stdout @@ -4,6 +4,15 @@ PRINT-DERIVE INPUT (DISPLAY): struct Foo [bool ; { let a = #[rustc_dummy(first)] #[rustc_dummy(second)] + { #![allow(unused)] 30 }; 0 + }] +} +PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): struct Foo +{ + val : + [bool ; + { + let a = #[rustc_dummy(first)] #[rustc_dummy(second)] { #! [allow(unused)] 30 } ; 0 }] } @@ -111,7 +120,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ stream: TokenStream [ Punct { ch: '#', - spacing: Alone, + spacing: Joint, span: $DIR/macro-rules-derive-cfg.rs:27:5: 27:6 (#0), }, Punct { diff --git a/tests/ui/proc-macro/macro-rules-derive.stderr b/tests/ui/proc-macro/macro-rules-derive.stderr index 517cbabd5..e7cd44746 100644 --- a/tests/ui/proc-macro/macro-rules-derive.stderr +++ b/tests/ui/proc-macro/macro-rules-derive.stderr @@ -9,6 +9,6 @@ LL | produce_it!(MyName); | = note: this error originates in the macro `produce_it` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0412`. diff --git a/tests/ui/proc-macro/macros-in-extern-derive.stderr b/tests/ui/proc-macro/macros-in-extern-derive.stderr index efd9ff225..c7d2881ad 100644 --- a/tests/ui/proc-macro/macros-in-extern-derive.stderr +++ b/tests/ui/proc-macro/macros-in-extern-derive.stderr @@ -6,6 +6,6 @@ LL | #[derive(Copy)] LL | fn f(); | ------- not a `struct`, `enum` or `union` -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0774`. diff --git a/tests/ui/proc-macro/meta-macro-hygiene.stdout b/tests/ui/proc-macro/meta-macro-hygiene.stdout index eeb7179e6..6d10cc604 100644 --- a/tests/ui/proc-macro/meta-macro-hygiene.stdout +++ b/tests/ui/proc-macro/meta-macro-hygiene.stdout @@ -32,13 +32,13 @@ macro_rules! produce_it */ { () => { - meta_macro :: print_def_site! ($crate :: dummy! ()) ; + meta_macro::print_def_site!($crate::dummy!()); // `print_def_site!` will respan the `$crate` identifier // with `Span::def_site()`. This should cause it to resolve // relative to `meta_macro`, *not* `make_macro` (despite // the fact that `print_def_site` is produced by a // `macro_rules!` macro in `make_macro`). - } ; + }; } fn main /* 0#0 */() { ; } diff --git a/tests/ui/proc-macro/nested-derive-cfg.stdout b/tests/ui/proc-macro/nested-derive-cfg.stdout index 9a562c971..c94808c3c 100644 --- a/tests/ui/proc-macro/nested-derive-cfg.stdout +++ b/tests/ui/proc-macro/nested-derive-cfg.stdout @@ -1,4 +1,6 @@ PRINT-DERIVE INPUT (DISPLAY): struct Foo +{ my_array: [bool; { struct Inner { non_removed_inner_field: usize } 0 }] } +PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): struct Foo { my_array : [bool ; { struct Inner { non_removed_inner_field : usize } 0 }] } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { diff --git a/tests/ui/proc-macro/no-macro-use-attr.stderr b/tests/ui/proc-macro/no-macro-use-attr.stderr index a9e5256a0..3dda3cc7d 100644 --- a/tests/ui/proc-macro/no-macro-use-attr.stderr +++ b/tests/ui/proc-macro/no-macro-use-attr.stderr @@ -16,5 +16,5 @@ error: fatal error triggered by #[rustc_error] LL | fn main() {} | ^^^^^^^^^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/proc-macro/non-root.stderr b/tests/ui/proc-macro/non-root.stderr index 90f94b677..ecc0202c1 100644 --- a/tests/ui/proc-macro/non-root.stderr +++ b/tests/ui/proc-macro/non-root.stderr @@ -4,5 +4,5 @@ error: functions tagged with `#[proc_macro]` must currently reside in the root o LL | pub fn foo(arg: TokenStream) -> TokenStream { arg } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/nonterminal-expansion.stdout b/tests/ui/proc-macro/nonterminal-expansion.stdout index b2557af18..c671f6239 100644 --- a/tests/ui/proc-macro/nonterminal-expansion.stdout +++ b/tests/ui/proc-macro/nonterminal-expansion.stdout @@ -1,5 +1,5 @@ PRINT-ATTR_ARGS INPUT (DISPLAY): a, line!(), b -PRINT-ATTR_ARGS RE-COLLECTED (DISPLAY): a, line! (), b +PRINT-ATTR_ARGS DEEP-RE-COLLECTED (DISPLAY): a, line! (), b PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "a", diff --git a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout index c437853ac..5c70e780f 100644 --- a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout +++ b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout @@ -1,5 +1,5 @@ PRINT-BANG INPUT (DISPLAY): struct S; -PRINT-BANG RE-COLLECTED (DISPLAY): struct S ; +PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): struct S ; PRINT-BANG INPUT (DEBUG): TokenStream [ Group { delimiter: None, @@ -51,11 +51,11 @@ macro_rules! outer /* 0#0 */ { - ($item : item) => + ($item:item) => { - macro inner() { print_bang! { $item } } inner! () ; + macro inner() { print_bang! { $item } } inner!(); - } ; + }; } struct S /* 0#0 */; diff --git a/tests/ui/proc-macro/pretty-print-tts.stdout b/tests/ui/proc-macro/pretty-print-tts.stdout index f52e97a86..fbe8640a0 100644 --- a/tests/ui/proc-macro/pretty-print-tts.stdout +++ b/tests/ui/proc-macro/pretty-print-tts.stdout @@ -1,4 +1,5 @@ -PRINT-BANG INPUT (DISPLAY): { #! [rustc_dummy] let a = "hello".len() ; matches! (a, 5) ; } +PRINT-BANG INPUT (DISPLAY): { #![rustc_dummy] let a = "hello".len(); matches!(a, 5); } +PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): { #! [rustc_dummy] let a = "hello".len() ; matches! (a, 5) ; } PRINT-BANG INPUT (DEBUG): TokenStream [ Group { delimiter: Brace, diff --git a/tests/ui/proc-macro/raw-ident.stderr b/tests/ui/proc-macro/raw-ident.stderr index 905a5f946..a72067021 100644 --- a/tests/ui/proc-macro/raw-ident.stderr +++ b/tests/ui/proc-macro/raw-ident.stderr @@ -6,5 +6,5 @@ LL | make_bad_struct!(S); | = note: this error originates in the macro `make_bad_struct` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/shadow.stderr b/tests/ui/proc-macro/shadow.stderr index e7d95cc83..6f50d89f5 100644 --- a/tests/ui/proc-macro/shadow.stderr +++ b/tests/ui/proc-macro/shadow.stderr @@ -9,6 +9,6 @@ LL | extern crate test_macros; | = note: `test_macros` must be defined only once in the type namespace of this module -error: aborting due to previous error +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0259`. diff --git a/tests/ui/proc-macro/signature.stderr b/tests/ui/proc-macro/signature.stderr index ba5c8c157..2a53145a6 100644 --- a/tests/ui/proc-macro/signature.stderr +++ b/tests/ui/proc-macro/signature.stderr @@ -7,5 +7,5 @@ LL | pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 { = note: expected signature `fn(proc_macro::TokenStream) -> proc_macro::TokenStream` found signature `unsafe extern "C" fn(i32, u32) -> u32` -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/test-same-crate.stderr b/tests/ui/proc-macro/test-same-crate.stderr index 5d12e149c..3cab0ae67 100644 --- a/tests/ui/proc-macro/test-same-crate.stderr +++ b/tests/ui/proc-macro/test-same-crate.stderr @@ -6,5 +6,5 @@ LL | fn t() { crate::mac!(A) } | = help: you can define integration tests in a directory named `tests` -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/trailing-plus.stdout b/tests/ui/proc-macro/trailing-plus.stdout index b90057cd6..b20401190 100644 --- a/tests/ui/proc-macro/trailing-plus.stdout +++ b/tests/ui/proc-macro/trailing-plus.stdout @@ -1,4 +1,5 @@ -PRINT-ATTR INPUT (DISPLAY): fn foo < T > () where T : Copy + {} +PRINT-ATTR INPUT (DISPLAY): fn foo<T>() where T: Copy + {} +PRINT-ATTR RE-COLLECTED (DISPLAY): fn foo < T > () where T : Copy + {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", diff --git a/tests/ui/proc-macro/two-crate-types-1.stderr b/tests/ui/proc-macro/two-crate-types-1.stderr index deaba1cf2..a7524fd3b 100644 --- a/tests/ui/proc-macro/two-crate-types-1.stderr +++ b/tests/ui/proc-macro/two-crate-types-1.stderr @@ -1,4 +1,4 @@ error: cannot mix `proc-macro` crate type with others -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/two-crate-types-2.stderr b/tests/ui/proc-macro/two-crate-types-2.stderr index deaba1cf2..a7524fd3b 100644 --- a/tests/ui/proc-macro/two-crate-types-2.stderr +++ b/tests/ui/proc-macro/two-crate-types-2.stderr @@ -1,4 +1,4 @@ error: cannot mix `proc-macro` crate type with others -error: aborting due to previous error +error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/weird-braces.stdout b/tests/ui/proc-macro/weird-braces.stdout index 9bf562217..7da769ef0 100644 --- a/tests/ui/proc-macro/weird-braces.stdout +++ b/tests/ui/proc-macro/weird-braces.stdout @@ -5,7 +5,18 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ span: $DIR/weird-braces.rs:16:25: 16:36 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(second_outer)] impl Bar < { 1 > 0 } > for Foo < +PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(second_outer)] impl Bar<{ 1 > 0 }> for Foo<{ true }> +{ + #![print_target_and_args(first_inner)] + #![print_target_and_args(second_inner)] +} +PRINT-ATTR RE-COLLECTED (DISPLAY): #[print_target_and_args(second_outer)] impl Bar < { 1 > 0 } > for Foo < +{ true } > +{ + #![print_target_and_args(first_inner)] + #![print_target_and_args(second_inner)] +} +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[print_target_and_args(second_outer)] impl Bar < { 1 > 0 } > for Foo < { true } > { #! [print_target_and_args(first_inner)] #! @@ -180,7 +191,17 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ span: $DIR/weird-braces.rs:17:25: 17:37 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } > +PRINT-ATTR INPUT (DISPLAY): impl Bar<{ 1 > 0 }> for Foo<{ true }> +{ + #![print_target_and_args(first_inner)] + #![print_target_and_args(second_inner)] +} +PRINT-ATTR RE-COLLECTED (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } > +{ + #![print_target_and_args(first_inner)] + #![print_target_and_args(second_inner)] +} +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } > { #! [print_target_and_args(first_inner)] #! [print_target_and_args(second_inner)] @@ -329,7 +350,11 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ span: $DIR/weird-braces.rs:19:30: 19:41 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } > +PRINT-ATTR INPUT (DISPLAY): impl Bar<{ 1 > 0 }> for Foo<{ true }> +{ #![print_target_and_args(second_inner)] } +PRINT-ATTR RE-COLLECTED (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } > +{ #![print_target_and_args(second_inner)] } +PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } > { #! [print_target_and_args(second_inner)] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { @@ -445,7 +470,8 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ span: $DIR/weird-braces.rs:20:30: 20:42 (#0), }, ] -PRINT-ATTR INPUT (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } > {} +PRINT-ATTR INPUT (DISPLAY): impl Bar<{ 1 > 0 }> for Foo<{ true }> {} +PRINT-ATTR RE-COLLECTED (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } > {} PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "impl", |