From 1443c7646d37eb69c434268ec8b27cd0cf82d9f2 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 20 Mar 2021 02:52:07 +0300 Subject: [PATCH] parser: Remove support for inner attributes on non-block expressions --- compiler/rustc_ast_pretty/src/pprust/state.rs | 35 +- compiler/rustc_parse/src/parser/expr.rs | 14 +- src/test/pretty/ast-stmt-expr-attr.rs | 30 +- src/test/pretty/stmt_expr_attributes.rs | 59 +- src/test/ui/lint/expr_attr_paren_order.rs | 6 +- src/test/ui/lint/expr_attr_paren_order.stderr | 8 +- .../ui/parser/stmt_expr_attrs_placement.rs | 16 + .../parser/stmt_expr_attrs_placement.stderr | 58 +- src/test/ui/proc-macro/inner-attrs.rs | 32 +- src/test/ui/proc-macro/inner-attrs.stderr | 40 +- src/test/ui/proc-macro/inner-attrs.stdout | 557 ++++++------------ src/test/ui/proc-macro/simple-tuple.rs | 19 - src/test/ui/proc-macro/simple-tuple.stdout | 79 --- 13 files changed, 316 insertions(+), 637 deletions(-) delete mode 100644 src/test/ui/proc-macro/simple-tuple.rs delete mode 100644 src/test/ui/proc-macro/simple-tuple.stdout diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 789d2c296e291..fdcb68cf421c1 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -366,10 +366,6 @@ pub trait PrintState<'a>: std::ops::Deref + std::ops::Dere self.print_either_attributes(attrs, ast::AttrStyle::Inner, false, true) } - fn print_inner_attributes_no_trailing_hardbreak(&mut self, attrs: &[ast::Attribute]) { - self.print_either_attributes(attrs, ast::AttrStyle::Inner, false, false) - } - fn print_outer_attributes(&mut self, attrs: &[ast::Attribute]) { self.print_either_attributes(attrs, ast::AttrStyle::Outer, false, true) } @@ -1675,32 +1671,24 @@ impl<'a> State<'a> { } } - fn print_expr_vec(&mut self, exprs: &[P], attrs: &[ast::Attribute]) { + fn print_expr_vec(&mut self, exprs: &[P]) { self.ibox(INDENT_UNIT); self.s.word("["); - self.print_inner_attributes_inline(attrs); self.commasep_exprs(Inconsistent, exprs); self.s.word("]"); self.end(); } - fn print_expr_anon_const(&mut self, expr: &ast::AnonConst, attrs: &[ast::Attribute]) { + fn print_expr_anon_const(&mut self, expr: &ast::AnonConst) { self.ibox(INDENT_UNIT); self.s.word("const"); - self.print_inner_attributes_inline(attrs); self.print_expr(&expr.value); self.end(); } - fn print_expr_repeat( - &mut self, - element: &ast::Expr, - count: &ast::AnonConst, - attrs: &[ast::Attribute], - ) { + fn print_expr_repeat(&mut self, element: &ast::Expr, count: &ast::AnonConst) { self.ibox(INDENT_UNIT); self.s.word("["); - self.print_inner_attributes_inline(attrs); self.print_expr(element); self.word_space(";"); self.print_expr(&count.value); @@ -1713,11 +1701,9 @@ impl<'a> State<'a> { path: &ast::Path, fields: &[ast::ExprField], rest: &ast::StructRest, - attrs: &[ast::Attribute], ) { self.print_path(path, true, 0); self.s.word("{"); - self.print_inner_attributes_inline(attrs); self.commasep_cmnt( Consistent, fields, @@ -1752,9 +1738,8 @@ impl<'a> State<'a> { self.s.word("}"); } - fn print_expr_tup(&mut self, exprs: &[P], attrs: &[ast::Attribute]) { + fn print_expr_tup(&mut self, exprs: &[P]) { self.popen(); - self.print_inner_attributes_inline(attrs); self.commasep_exprs(Inconsistent, exprs); if exprs.len() == 1 { self.s.word(","); @@ -1865,19 +1850,19 @@ impl<'a> State<'a> { self.print_expr_maybe_paren(expr, parser::PREC_PREFIX); } ast::ExprKind::Array(ref exprs) => { - self.print_expr_vec(&exprs[..], attrs); + self.print_expr_vec(exprs); } ast::ExprKind::ConstBlock(ref anon_const) => { - self.print_expr_anon_const(anon_const, attrs); + self.print_expr_anon_const(anon_const); } ast::ExprKind::Repeat(ref element, ref count) => { - self.print_expr_repeat(element, count, attrs); + self.print_expr_repeat(element, count); } ast::ExprKind::Struct(ref se) => { - self.print_expr_struct(&se.path, &se.fields, &se.rest, attrs); + self.print_expr_struct(&se.path, &se.fields, &se.rest); } ast::ExprKind::Tup(ref exprs) => { - self.print_expr_tup(&exprs[..], attrs); + self.print_expr_tup(exprs); } ast::ExprKind::Call(ref func, ref args) => { self.print_expr_call(func, &args[..]); @@ -1955,7 +1940,6 @@ impl<'a> State<'a> { self.print_expr_as_cond(expr); self.s.space(); self.bopen(); - self.print_inner_attributes_no_trailing_hardbreak(attrs); for arm in arms { self.print_arm(arm); } @@ -2253,7 +2237,6 @@ impl<'a> State<'a> { ast::ExprKind::MacCall(ref m) => self.print_mac(m), ast::ExprKind::Paren(ref e) => { self.popen(); - self.print_inner_attributes_inline(attrs); self.print_expr(e); self.pclose(); } diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index e155b3fa77391..56c97b5947682 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1216,10 +1216,9 @@ impl<'a> Parser<'a> { } } - fn parse_tuple_parens_expr(&mut self, mut attrs: AttrVec) -> PResult<'a, P> { + fn parse_tuple_parens_expr(&mut self, attrs: AttrVec) -> PResult<'a, P> { let lo = self.token.span; self.expect(&token::OpenDelim(token::Paren))?; - attrs.extend(self.parse_inner_attributes()?); // `(#![foo] a, b, ...)` is OK. let (es, trailing_comma) = match self.parse_seq_to_end( &token::CloseDelim(token::Paren), SeqSep::trailing_allowed(token::Comma), @@ -1239,12 +1238,10 @@ impl<'a> Parser<'a> { self.maybe_recover_from_bad_qpath(expr, true) } - fn parse_array_or_repeat_expr(&mut self, mut attrs: AttrVec) -> PResult<'a, P> { + fn parse_array_or_repeat_expr(&mut self, attrs: AttrVec) -> PResult<'a, P> { let lo = self.token.span; self.bump(); // `[` - attrs.extend(self.parse_inner_attributes()?); - let close = &token::CloseDelim(token::Bracket); let kind = if self.eat(close) { // Empty vector @@ -1950,7 +1947,7 @@ impl<'a> Parser<'a> { } /// Parses a `match ... { ... }` expression (`match` token already eaten). - fn parse_match_expr(&mut self, mut attrs: AttrVec) -> PResult<'a, P> { + fn parse_match_expr(&mut self, attrs: AttrVec) -> PResult<'a, P> { let match_span = self.prev_token.span; let lo = self.prev_token.span; let scrutinee = self.parse_expr_res(Restrictions::NO_STRUCT_LITERAL, None)?; @@ -1965,7 +1962,6 @@ impl<'a> Parser<'a> { } return Err(e); } - attrs.extend(self.parse_inner_attributes()?); let mut arms: Vec = Vec::new(); while self.token != token::CloseDelim(token::Brace) { @@ -2293,15 +2289,13 @@ impl<'a> Parser<'a> { pub(super) fn parse_struct_expr( &mut self, pth: ast::Path, - mut attrs: AttrVec, + attrs: AttrVec, recover: bool, ) -> PResult<'a, P> { let mut fields = Vec::new(); let mut base = ast::StructRest::None; let mut recover_async = false; - attrs.extend(self.parse_inner_attributes()?); - let mut async_block_err = |e: &mut DiagnosticBuilder<'_>, span: Span| { recover_async = true; e.span_label(span, "`async` blocks are only allowed in Rust 2018 or later"); diff --git a/src/test/pretty/ast-stmt-expr-attr.rs b/src/test/pretty/ast-stmt-expr-attr.rs index 5b975424512d4..de42a8c4ed5ed 100644 --- a/src/test/pretty/ast-stmt-expr-attr.rs +++ b/src/test/pretty/ast-stmt-expr-attr.rs @@ -5,15 +5,15 @@ fn main() { } #[cfg(FALSE)] fn syntax() { let _ = #[attr] box 0; - let _ = #[attr] [#![attr] ]; - let _ = #[attr] [#![attr] 0]; - let _ = #[attr] [#![attr] 0; 0]; - let _ = #[attr] [#![attr] 0, 0, 0]; + let _ = #[attr] []; + let _ = #[attr] [0]; + let _ = #[attr] [0; 0]; + let _ = #[attr] [0, 0, 0]; let _ = #[attr] foo(); let _ = #[attr] x.foo(); - let _ = #[attr] (#![attr] ); - let _ = #[attr] (#![attr] #[attr] 0,); - let _ = #[attr] (#![attr] #[attr] 0, 0); + let _ = #[attr] (); + let _ = #[attr] (#[attr] 0,); + let _ = #[attr] (#[attr] 0, 0); let _ = #[attr] 0 + #[attr] 0; let _ = #[attr] 0 / #[attr] 0; let _ = #[attr] 0 & #[attr] 0; @@ -43,10 +43,10 @@ fn syntax() { #![attr] }; let _ = - #[attr] match true { - #![attr] - #[attr] - _ => false, + #[attr] match true + { + #[attr] + _ => false, }; let _ = #[attr] || #[attr] foo; let _ = #[attr] move || #[attr] foo; @@ -119,10 +119,10 @@ fn syntax() { let _ = #[attr] foo![# ! [attr]]; let _ = #[attr] foo! { }; let _ = #[attr] foo! { # ! [attr] }; - let _ = #[attr] Foo{#![attr] bar: baz,}; - let _ = #[attr] Foo{#![attr] ..foo}; - let _ = #[attr] Foo{#![attr] bar: baz, ..foo}; - let _ = #[attr] (#![attr] 0); + let _ = #[attr] Foo{bar: baz,}; + let _ = #[attr] Foo{..foo}; + let _ = #[attr] Foo{bar: baz, ..foo}; + let _ = #[attr] (0); { #[attr] diff --git a/src/test/pretty/stmt_expr_attributes.rs b/src/test/pretty/stmt_expr_attributes.rs index 619cce685d75f..54a8438f1d041 100644 --- a/src/test/pretty/stmt_expr_attributes.rs +++ b/src/test/pretty/stmt_expr_attributes.rs @@ -41,16 +41,9 @@ fn _3() { fn _4() { #[rustc_dummy] - match () { - #![rustc_dummy] - _ => (), - } + match () { _ => (), } - let _ = - #[rustc_dummy] match () { - #![rustc_dummy] - () => (), - }; + let _ = #[rustc_dummy] match () { () => (), }; } fn _5() { @@ -71,14 +64,14 @@ fn _5() { fn _6() { #[rustc_dummy] - [#![rustc_dummy] 1, 2, 3]; + [1, 2, 3]; - let _ = #[rustc_dummy] [#![rustc_dummy] 1, 2, 3]; + let _ = #[rustc_dummy] [1, 2, 3]; #[rustc_dummy] - [#![rustc_dummy] 1; 4]; + [1; 4]; - let _ = #[rustc_dummy] [#![rustc_dummy] 1; 4]; + let _ = #[rustc_dummy] [1; 4]; } struct Foo { @@ -90,24 +83,24 @@ struct Bar(()); fn _7() { #[rustc_dummy] - Foo{#![rustc_dummy] data: (),}; + Foo{data: (),}; - let _ = #[rustc_dummy] Foo{#![rustc_dummy] data: (),}; + let _ = #[rustc_dummy] Foo{data: (),}; } fn _8() { #[rustc_dummy] - (#![rustc_dummy] ); + (); #[rustc_dummy] - (#![rustc_dummy] 0); + (0); #[rustc_dummy] - (#![rustc_dummy] 0,); + (0,); #[rustc_dummy] - (#![rustc_dummy] 0, 1); + (0, 1); } fn _9() { @@ -138,15 +131,15 @@ fn _10() { fn _11() { let _ = #[rustc_dummy] box 0; - let _: [(); 0] = #[rustc_dummy] [#![rustc_dummy] ]; - let _ = #[rustc_dummy] [#![rustc_dummy] 0, 0]; - let _ = #[rustc_dummy] [#![rustc_dummy] 0; 0]; + let _: [(); 0] = #[rustc_dummy] []; + let _ = #[rustc_dummy] [0, 0]; + let _ = #[rustc_dummy] [0; 0]; let _ = #[rustc_dummy] foo(); let _ = #[rustc_dummy] 1i32.clone(); - let _ = #[rustc_dummy] (#![rustc_dummy] ); - let _ = #[rustc_dummy] (#![rustc_dummy] 0); - let _ = #[rustc_dummy] (#![rustc_dummy] 0,); - let _ = #[rustc_dummy] (#![rustc_dummy] 0, 0); + let _ = #[rustc_dummy] (); + let _ = #[rustc_dummy] (0); + let _ = #[rustc_dummy] (0,); + let _ = #[rustc_dummy] (0, 0); let _ = #[rustc_dummy] 0 + #[rustc_dummy] 0; let _ = #[rustc_dummy] !0; let _ = #[rustc_dummy] -0i32; @@ -171,11 +164,7 @@ fn _11() { #[rustc_dummy] loop { #![rustc_dummy] }; - let _ = - #[rustc_dummy] match false { - #![rustc_dummy] - _ => (), - }; + let _ = #[rustc_dummy] match false { _ => (), }; let _ = #[rustc_dummy] || #[rustc_dummy] (); let _ = #[rustc_dummy] move || #[rustc_dummy] (); let _ = @@ -237,10 +226,10 @@ fn _11() { let _ = #[rustc_dummy] expr_mac!(); let _ = #[rustc_dummy] expr_mac![]; let _ = #[rustc_dummy] expr_mac! { }; - let _ = #[rustc_dummy] Foo{#![rustc_dummy] data: (),}; - let _ = #[rustc_dummy] Foo{#![rustc_dummy] ..s}; - let _ = #[rustc_dummy] Foo{#![rustc_dummy] data: (), ..s}; - let _ = #[rustc_dummy] (#![rustc_dummy] 0); + let _ = #[rustc_dummy] Foo{data: (),}; + let _ = #[rustc_dummy] Foo{..s}; + let _ = #[rustc_dummy] Foo{data: (), ..s}; + let _ = #[rustc_dummy] (0); } fn _12() { diff --git a/src/test/ui/lint/expr_attr_paren_order.rs b/src/test/ui/lint/expr_attr_paren_order.rs index 65f2b67d22bf2..e1ec2e951cfec 100644 --- a/src/test/ui/lint/expr_attr_paren_order.rs +++ b/src/test/ui/lint/expr_attr_paren_order.rs @@ -5,16 +5,14 @@ fn main() { // Test that attributes on parens get concatenated // in the expected order in the hir folder. - #[deny(non_snake_case)] ( - #![allow(non_snake_case)] + #[deny(non_snake_case)] #[allow(non_snake_case)] ( { let X = 0; let _ = X; } ); - #[allow(non_snake_case)] ( - #![deny(non_snake_case)] + #[allow(non_snake_case)] #[deny(non_snake_case)] ( { let X = 0; //~ ERROR snake case name let _ = X; diff --git a/src/test/ui/lint/expr_attr_paren_order.stderr b/src/test/ui/lint/expr_attr_paren_order.stderr index c6b373e3f13c4..42beed10c19fd 100644 --- a/src/test/ui/lint/expr_attr_paren_order.stderr +++ b/src/test/ui/lint/expr_attr_paren_order.stderr @@ -1,14 +1,14 @@ error: variable `X` should have a snake case name - --> $DIR/expr_attr_paren_order.rs:19:17 + --> $DIR/expr_attr_paren_order.rs:17:17 | LL | let X = 0; | ^ help: convert the identifier to snake case (notice the capitalization): `x` | note: the lint level is defined here - --> $DIR/expr_attr_paren_order.rs:17:17 + --> $DIR/expr_attr_paren_order.rs:15:37 | -LL | #![deny(non_snake_case)] - | ^^^^^^^^^^^^^^ +LL | #[allow(non_snake_case)] #[deny(non_snake_case)] ( + | ^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/parser/stmt_expr_attrs_placement.rs b/src/test/ui/parser/stmt_expr_attrs_placement.rs index b8a794f4b92fa..d488cd0c2d3f8 100644 --- a/src/test/ui/parser/stmt_expr_attrs_placement.rs +++ b/src/test/ui/parser/stmt_expr_attrs_placement.rs @@ -8,15 +8,31 @@ fn main() { //~^ ERROR an inner attribute is not permitted in this context let b = (#![allow(warnings)] 1, 2); + //~^ ERROR an inner attribute is not permitted in this context let c = { #![allow(warnings)] (#![allow(warnings)] 1, 2) + //~^ ERROR an inner attribute is not permitted in this context }; let d = { #![allow(warnings)] let e = (#![allow(warnings)] 1, 2); + //~^ ERROR an inner attribute is not permitted in this context e }; + + let e = [#![allow(warnings)] 1, 2]; + //~^ ERROR an inner attribute is not permitted in this context + + let f = [#![allow(warnings)] 1; 0]; + //~^ ERROR an inner attribute is not permitted in this context + + let g = match true { #![allow(warnings)] _ => {} }; + //~^ ERROR an inner attribute is not permitted in this context + + struct MyStruct { field: u8 } + let h = MyStruct { #![allow(warnings)] field: 0 }; + //~^ ERROR an inner attribute is not permitted in this context } diff --git a/src/test/ui/parser/stmt_expr_attrs_placement.stderr b/src/test/ui/parser/stmt_expr_attrs_placement.stderr index 1886a0f9ba0ba..185cc0096407e 100644 --- a/src/test/ui/parser/stmt_expr_attrs_placement.stderr +++ b/src/test/ui/parser/stmt_expr_attrs_placement.stderr @@ -6,5 +6,61 @@ LL | let a = #![allow(warnings)] (1, 2); | = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. -error: aborting due to previous error +error: an inner attribute is not permitted in this context + --> $DIR/stmt_expr_attrs_placement.rs:10:14 + | +LL | let b = (#![allow(warnings)] 1, 2); + | ^^^^^^^^^^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. + +error: an inner attribute is not permitted in this context + --> $DIR/stmt_expr_attrs_placement.rs:15:10 + | +LL | (#![allow(warnings)] 1, 2) + | ^^^^^^^^^^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. + +error: an inner attribute is not permitted in this context + --> $DIR/stmt_expr_attrs_placement.rs:21:18 + | +LL | let e = (#![allow(warnings)] 1, 2); + | ^^^^^^^^^^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. + +error: an inner attribute is not permitted in this context + --> $DIR/stmt_expr_attrs_placement.rs:26:14 + | +LL | let e = [#![allow(warnings)] 1, 2]; + | ^^^^^^^^^^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. + +error: an inner attribute is not permitted in this context + --> $DIR/stmt_expr_attrs_placement.rs:29:14 + | +LL | let f = [#![allow(warnings)] 1; 0]; + | ^^^^^^^^^^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. + +error: an inner attribute is not permitted in this context + --> $DIR/stmt_expr_attrs_placement.rs:32:26 + | +LL | let g = match true { #![allow(warnings)] _ => {} }; + | ^^^^^^^^^^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. + +error: an inner attribute is not permitted in this context + --> $DIR/stmt_expr_attrs_placement.rs:36:24 + | +LL | let h = MyStruct { #![allow(warnings)] field: 0 }; + | ^^^^^^^^^^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. + +error: aborting due to 8 previous errors diff --git a/src/test/ui/proc-macro/inner-attrs.rs b/src/test/ui/proc-macro/inner-attrs.rs index 14ec57ad62606..2e3c704da4392 100644 --- a/src/test/ui/proc-macro/inner-attrs.rs +++ b/src/test/ui/proc-macro/inner-attrs.rs @@ -1,6 +1,7 @@ // compile-flags: -Z span-debug --error-format human // aux-build:test-macros.rs // edition:2018 + #![feature(custom_inner_attributes)] #![feature(proc_macro_hygiene)] #![feature(stmt_expr_attributes)] @@ -34,8 +35,6 @@ struct MyStruct { struct MyDerivePrint { field: [u8; { match true { - #![cfg_attr(not(FALSE), rustc_dummy(first))] - #![cfg_attr(not(FALSE), rustc_dummy(second))] _ => { #![cfg_attr(not(FALSE), rustc_dummy(third))] true @@ -46,49 +45,20 @@ struct MyDerivePrint { } fn bar() { - (#![print_target_and_args(fifth)] 1, 2); - //~^ ERROR expected non-macro inner attribute, found attribute macro - #[print_target_and_args(tuple_attrs)] ( - #![cfg_attr(FALSE, rustc_dummy)] 3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 } ); - #[print_target_and_args(array_attrs)] [ - #![rustc_dummy(inner)] - true; 0 - ]; - #[print_target_and_args(tuple_attrs)] ( - #![cfg_attr(FALSE, rustc_dummy)] 3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 } ); - #[print_target_and_args(array_attrs)] [ - #![rustc_dummy(inner)] - true; 0 - ]; - - [#![print_target_and_args(sixth)] 1 , 2]; - //~^ ERROR expected non-macro inner attribute, found attribute macro - [#![print_target_and_args(seventh)] true ; 5]; - //~^ ERROR expected non-macro inner attribute, found attribute macro - - match 0 { - #![print_target_and_args(eighth)] - //~^ ERROR expected non-macro inner attribute, found attribute macro - _ => {} - } - - MyStruct { #![print_target_and_args(ninth)] field: true }; - //~^ ERROR expected non-macro inner attribute, found attribute macro - for _ in &[true] { #![print_attr] //~ ERROR expected non-macro inner attribute } diff --git a/src/test/ui/proc-macro/inner-attrs.stderr b/src/test/ui/proc-macro/inner-attrs.stderr index 7f22c5f30d660..4da8751ef7fe9 100644 --- a/src/test/ui/proc-macro/inner-attrs.stderr +++ b/src/test/ui/proc-macro/inner-attrs.stderr @@ -1,56 +1,26 @@ -error: expected non-macro inner attribute, found attribute macro `print_target_and_args` - --> $DIR/inner-attrs.rs:49:9 - | -LL | (#![print_target_and_args(fifth)] 1, 2); - | ^^^^^^^^^^^^^^^^^^^^^ not a non-macro inner attribute - -error: expected non-macro inner attribute, found attribute macro `print_target_and_args` - --> $DIR/inner-attrs.rs:78:9 - | -LL | [#![print_target_and_args(sixth)] 1 , 2]; - | ^^^^^^^^^^^^^^^^^^^^^ not a non-macro inner attribute - -error: expected non-macro inner attribute, found attribute macro `print_target_and_args` - --> $DIR/inner-attrs.rs:80:9 - | -LL | [#![print_target_and_args(seventh)] true ; 5]; - | ^^^^^^^^^^^^^^^^^^^^^ not a non-macro inner attribute - -error: expected non-macro inner attribute, found attribute macro `print_target_and_args` - --> $DIR/inner-attrs.rs:84:12 - | -LL | #![print_target_and_args(eighth)] - | ^^^^^^^^^^^^^^^^^^^^^ not a non-macro inner attribute - -error: expected non-macro inner attribute, found attribute macro `print_target_and_args` - --> $DIR/inner-attrs.rs:89:19 - | -LL | MyStruct { #![print_target_and_args(ninth)] field: true }; - | ^^^^^^^^^^^^^^^^^^^^^ not a non-macro inner attribute - error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:93:12 + --> $DIR/inner-attrs.rs:63:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:97:12 + --> $DIR/inner-attrs.rs:67:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:101:12 + --> $DIR/inner-attrs.rs:71:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute error: expected non-macro inner attribute, found attribute macro `print_attr` - --> $DIR/inner-attrs.rs:105:12 + --> $DIR/inner-attrs.rs:75:12 | LL | #![print_attr] | ^^^^^^^^^^ not a non-macro inner attribute -error: aborting due to 9 previous errors +error: aborting due to 4 previous errors diff --git a/src/test/ui/proc-macro/inner-attrs.stdout b/src/test/ui/proc-macro/inner-attrs.stdout index 2f442e83002ea..77f423704933c 100644 --- a/src/test/ui/proc-macro/inner-attrs.stdout +++ b/src/test/ui/proc-macro/inner-attrs.stdout @@ -2,7 +2,7 @@ PRINT-ATTR_ARGS INPUT (DISPLAY): first PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "first", - span: $DIR/inner-attrs.rs:15:25: 15:30 (#0), + span: $DIR/inner-attrs.rs:16:25: 16:30 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(second)] fn foo() @@ -11,40 +11,40 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/inner-attrs.rs:16:1: 16:2 (#0), + span: $DIR/inner-attrs.rs:17:1: 17:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:16:3: 16:24 (#0), + span: $DIR/inner-attrs.rs:17:3: 17:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "second", - span: $DIR/inner-attrs.rs:16:25: 16:31 (#0), + span: $DIR/inner-attrs.rs:17:25: 17:31 (#0), }, ], - span: $DIR/inner-attrs.rs:16:24: 16:32 (#0), + span: $DIR/inner-attrs.rs:17:24: 17:32 (#0), }, ], - span: $DIR/inner-attrs.rs:16:2: 16:33 (#0), + span: $DIR/inner-attrs.rs:17:2: 17:33 (#0), }, Ident { ident: "fn", - span: $DIR/inner-attrs.rs:17:1: 17:3 (#0), + span: $DIR/inner-attrs.rs:18:1: 18:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:17:4: 17:7 (#0), + span: $DIR/inner-attrs.rs:18:4: 18:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:17:7: 17:9 (#0), + span: $DIR/inner-attrs.rs:18:7: 18:9 (#0), }, Group { delimiter: Brace, @@ -52,72 +52,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:18:5: 18:6 (#0), + span: $DIR/inner-attrs.rs:19:5: 19:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:18:6: 18:7 (#0), + span: $DIR/inner-attrs.rs:19:6: 19:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:18:8: 18:29 (#0), + span: $DIR/inner-attrs.rs:19:8: 19:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:18:30: 18:35 (#0), + span: $DIR/inner-attrs.rs:19:30: 19:35 (#0), }, ], - span: $DIR/inner-attrs.rs:18:29: 18:36 (#0), + span: $DIR/inner-attrs.rs:19:29: 19:36 (#0), }, ], - span: $DIR/inner-attrs.rs:18:7: 18:37 (#0), + span: $DIR/inner-attrs.rs:19:7: 19:37 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:19:5: 19:6 (#0), + span: $DIR/inner-attrs.rs:20:5: 20:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:19:6: 19:7 (#0), + span: $DIR/inner-attrs.rs:20:6: 20:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:19:8: 19:29 (#0), + span: $DIR/inner-attrs.rs:20:8: 20:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:19:30: 19:36 (#0), + span: $DIR/inner-attrs.rs:20:30: 20:36 (#0), }, ], - span: $DIR/inner-attrs.rs:19:29: 19:37 (#0), + span: $DIR/inner-attrs.rs:20:29: 20:37 (#0), }, ], - span: $DIR/inner-attrs.rs:19:7: 19:38 (#0), + span: $DIR/inner-attrs.rs:20:7: 20:38 (#0), }, ], - span: $DIR/inner-attrs.rs:17:10: 20:2 (#0), + span: $DIR/inner-attrs.rs:18:10: 21:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): second PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "second", - span: $DIR/inner-attrs.rs:16:25: 16:31 (#0), + span: $DIR/inner-attrs.rs:17:25: 17:31 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn foo() @@ -125,16 +125,16 @@ PRINT-ATTR INPUT (DISPLAY): fn foo() PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:17:1: 17:3 (#0), + span: $DIR/inner-attrs.rs:18:1: 18:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:17:4: 17:7 (#0), + span: $DIR/inner-attrs.rs:18:4: 18:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:17:7: 17:9 (#0), + span: $DIR/inner-attrs.rs:18:7: 18:9 (#0), }, Group { delimiter: Brace, @@ -142,88 +142,88 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:18:5: 18:6 (#0), + span: $DIR/inner-attrs.rs:19:5: 19:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:18:6: 18:7 (#0), + span: $DIR/inner-attrs.rs:19:6: 19:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:18:8: 18:29 (#0), + span: $DIR/inner-attrs.rs:19:8: 19:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:18:30: 18:35 (#0), + span: $DIR/inner-attrs.rs:19:30: 19:35 (#0), }, ], - span: $DIR/inner-attrs.rs:18:29: 18:36 (#0), + span: $DIR/inner-attrs.rs:19:29: 19:36 (#0), }, ], - span: $DIR/inner-attrs.rs:18:7: 18:37 (#0), + span: $DIR/inner-attrs.rs:19:7: 19:37 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:19:5: 19:6 (#0), + span: $DIR/inner-attrs.rs:20:5: 20:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:19:6: 19:7 (#0), + span: $DIR/inner-attrs.rs:20:6: 20:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:19:8: 19:29 (#0), + span: $DIR/inner-attrs.rs:20:8: 20:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:19:30: 19:36 (#0), + span: $DIR/inner-attrs.rs:20:30: 20:36 (#0), }, ], - span: $DIR/inner-attrs.rs:19:29: 19:37 (#0), + span: $DIR/inner-attrs.rs:20:29: 20:37 (#0), }, ], - span: $DIR/inner-attrs.rs:19:7: 19:38 (#0), + span: $DIR/inner-attrs.rs:20:7: 20:38 (#0), }, ], - span: $DIR/inner-attrs.rs:17:10: 20:2 (#0), + span: $DIR/inner-attrs.rs:18:10: 21:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): third PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:18:30: 18:35 (#0), + span: $DIR/inner-attrs.rs:19:30: 19:35 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn foo() { # ! [print_target_and_args(fourth)] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:17:1: 17:3 (#0), + span: $DIR/inner-attrs.rs:18:1: 18:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:17:4: 17:7 (#0), + span: $DIR/inner-attrs.rs:18:4: 18:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:17:7: 17:9 (#0), + span: $DIR/inner-attrs.rs:18:7: 18:9 (#0), }, Group { delimiter: Brace, @@ -231,70 +231,70 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:19:5: 19:6 (#0), + span: $DIR/inner-attrs.rs:20:5: 20:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:19:6: 19:7 (#0), + span: $DIR/inner-attrs.rs:20:6: 20:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:19:8: 19:29 (#0), + span: $DIR/inner-attrs.rs:20:8: 20:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:19:30: 19:36 (#0), + span: $DIR/inner-attrs.rs:20:30: 20:36 (#0), }, ], - span: $DIR/inner-attrs.rs:19:29: 19:37 (#0), + span: $DIR/inner-attrs.rs:20:29: 20:37 (#0), }, ], - span: $DIR/inner-attrs.rs:19:7: 19:38 (#0), + span: $DIR/inner-attrs.rs:20:7: 20:38 (#0), }, ], - span: $DIR/inner-attrs.rs:17:10: 20:2 (#0), + span: $DIR/inner-attrs.rs:18:10: 21:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): fourth PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "fourth", - span: $DIR/inner-attrs.rs:19:30: 19:36 (#0), + span: $DIR/inner-attrs.rs:20:30: 20:36 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn foo() { } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:17:1: 17:3 (#0), + span: $DIR/inner-attrs.rs:18:1: 18:3 (#0), }, Ident { ident: "foo", - span: $DIR/inner-attrs.rs:17:4: 17:7 (#0), + span: $DIR/inner-attrs.rs:18:4: 18:7 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:17:7: 17:9 (#0), + span: $DIR/inner-attrs.rs:18:7: 18:9 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/inner-attrs.rs:17:10: 20:2 (#0), + span: $DIR/inner-attrs.rs:18:10: 21:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_first PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_first", - span: $DIR/inner-attrs.rs:22:25: 22:34 (#0), + span: $DIR/inner-attrs.rs:23:25: 23:34 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(mod_second)] mod inline_mod @@ -306,35 +306,35 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/inner-attrs.rs:23:1: 23:2 (#0), + span: $DIR/inner-attrs.rs:24:1: 24:2 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:23:3: 23:24 (#0), + span: $DIR/inner-attrs.rs:24:3: 24:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_second", - span: $DIR/inner-attrs.rs:23:25: 23:35 (#0), + span: $DIR/inner-attrs.rs:24:25: 24:35 (#0), }, ], - span: $DIR/inner-attrs.rs:23:24: 23:36 (#0), + span: $DIR/inner-attrs.rs:24:24: 24:36 (#0), }, ], - span: $DIR/inner-attrs.rs:23:2: 23:37 (#0), + span: $DIR/inner-attrs.rs:24:2: 24:37 (#0), }, Ident { ident: "mod", - span: $DIR/inner-attrs.rs:24:1: 24:4 (#0), + span: $DIR/inner-attrs.rs:25:1: 25:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:24:5: 24:15 (#0), + span: $DIR/inner-attrs.rs:25:5: 25:15 (#0), }, Group { delimiter: Brace, @@ -342,72 +342,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:25:5: 25:6 (#0), + span: $DIR/inner-attrs.rs:26:5: 26:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:25:6: 25:7 (#0), + span: $DIR/inner-attrs.rs:26:6: 26:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:25:8: 25:29 (#0), + span: $DIR/inner-attrs.rs:26:8: 26:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_third", - span: $DIR/inner-attrs.rs:25:30: 25:39 (#0), + span: $DIR/inner-attrs.rs:26:30: 26:39 (#0), }, ], - span: $DIR/inner-attrs.rs:25:29: 25:40 (#0), + span: $DIR/inner-attrs.rs:26:29: 26:40 (#0), }, ], - span: $DIR/inner-attrs.rs:25:7: 25:41 (#0), + span: $DIR/inner-attrs.rs:26:7: 26:41 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:26:5: 26:6 (#0), + span: $DIR/inner-attrs.rs:27:5: 27:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:26:6: 26:7 (#0), + span: $DIR/inner-attrs.rs:27:6: 27:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:26:8: 26:29 (#0), + span: $DIR/inner-attrs.rs:27:8: 27:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:26:30: 26:40 (#0), + span: $DIR/inner-attrs.rs:27:30: 27:40 (#0), }, ], - span: $DIR/inner-attrs.rs:26:29: 26:41 (#0), + span: $DIR/inner-attrs.rs:27:29: 27:41 (#0), }, ], - span: $DIR/inner-attrs.rs:26:7: 26:42 (#0), + span: $DIR/inner-attrs.rs:27:7: 27:42 (#0), }, ], - span: $DIR/inner-attrs.rs:24:16: 27:2 (#0), + span: $DIR/inner-attrs.rs:25:16: 28:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_second PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_second", - span: $DIR/inner-attrs.rs:23:25: 23:35 (#0), + span: $DIR/inner-attrs.rs:24:25: 24:35 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): mod inline_mod @@ -418,11 +418,11 @@ PRINT-ATTR INPUT (DISPLAY): mod inline_mod PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "mod", - span: $DIR/inner-attrs.rs:24:1: 24:4 (#0), + span: $DIR/inner-attrs.rs:25:1: 25:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:24:5: 24:15 (#0), + span: $DIR/inner-attrs.rs:25:5: 25:15 (#0), }, Group { delimiter: Brace, @@ -430,83 +430,83 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:25:5: 25:6 (#0), + span: $DIR/inner-attrs.rs:26:5: 26:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:25:6: 25:7 (#0), + span: $DIR/inner-attrs.rs:26:6: 26:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:25:8: 25:29 (#0), + span: $DIR/inner-attrs.rs:26:8: 26:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_third", - span: $DIR/inner-attrs.rs:25:30: 25:39 (#0), + span: $DIR/inner-attrs.rs:26:30: 26:39 (#0), }, ], - span: $DIR/inner-attrs.rs:25:29: 25:40 (#0), + span: $DIR/inner-attrs.rs:26:29: 26:40 (#0), }, ], - span: $DIR/inner-attrs.rs:25:7: 25:41 (#0), + span: $DIR/inner-attrs.rs:26:7: 26:41 (#0), }, Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:26:5: 26:6 (#0), + span: $DIR/inner-attrs.rs:27:5: 27:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:26:6: 26:7 (#0), + span: $DIR/inner-attrs.rs:27:6: 27:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:26:8: 26:29 (#0), + span: $DIR/inner-attrs.rs:27:8: 27:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:26:30: 26:40 (#0), + span: $DIR/inner-attrs.rs:27:30: 27:40 (#0), }, ], - span: $DIR/inner-attrs.rs:26:29: 26:41 (#0), + span: $DIR/inner-attrs.rs:27:29: 27:41 (#0), }, ], - span: $DIR/inner-attrs.rs:26:7: 26:42 (#0), + span: $DIR/inner-attrs.rs:27:7: 27:42 (#0), }, ], - span: $DIR/inner-attrs.rs:24:16: 27:2 (#0), + span: $DIR/inner-attrs.rs:25:16: 28:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_third PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_third", - span: $DIR/inner-attrs.rs:25:30: 25:39 (#0), + span: $DIR/inner-attrs.rs:26:30: 26:39 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): mod inline_mod { # ! [print_target_and_args(mod_fourth)] } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "mod", - span: $DIR/inner-attrs.rs:24:1: 24:4 (#0), + span: $DIR/inner-attrs.rs:25:1: 25:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:24:5: 24:15 (#0), + span: $DIR/inner-attrs.rs:25:5: 25:15 (#0), }, Group { delimiter: Brace, @@ -514,192 +514,125 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:26:5: 26:6 (#0), + span: $DIR/inner-attrs.rs:27:5: 27:6 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:26:6: 26:7 (#0), + span: $DIR/inner-attrs.rs:27:6: 27:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "print_target_and_args", - span: $DIR/inner-attrs.rs:26:8: 26:29 (#0), + span: $DIR/inner-attrs.rs:27:8: 27:29 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:26:30: 26:40 (#0), + span: $DIR/inner-attrs.rs:27:30: 27:40 (#0), }, ], - span: $DIR/inner-attrs.rs:26:29: 26:41 (#0), + span: $DIR/inner-attrs.rs:27:29: 27:41 (#0), }, ], - span: $DIR/inner-attrs.rs:26:7: 26:42 (#0), + span: $DIR/inner-attrs.rs:27:7: 27:42 (#0), }, ], - span: $DIR/inner-attrs.rs:24:16: 27:2 (#0), + span: $DIR/inner-attrs.rs:25:16: 28:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): mod_fourth PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "mod_fourth", - span: $DIR/inner-attrs.rs:26:30: 26:40 (#0), + span: $DIR/inner-attrs.rs:27:30: 27:40 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): mod inline_mod { } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "mod", - span: $DIR/inner-attrs.rs:24:1: 24:4 (#0), + span: $DIR/inner-attrs.rs:25:1: 25:4 (#0), }, Ident { ident: "inline_mod", - span: $DIR/inner-attrs.rs:24:5: 24:15 (#0), + span: $DIR/inner-attrs.rs:25:5: 25:15 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/inner-attrs.rs:24:16: 27:2 (#0), + span: $DIR/inner-attrs.rs:25:16: 28:2 (#0), }, ] PRINT-DERIVE INPUT (DISPLAY): struct MyDerivePrint { field : - [u8 ; - { - match true - { - # ! [rustc_dummy(first)] # ! [rustc_dummy(second)] _ => - { # ! [rustc_dummy(third)] true } - } ; 0 - }] + [u8 ; { match true { _ => { # ! [rustc_dummy(third)] true } } ; 0 }] } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: $DIR/inner-attrs.rs:34:1: 34:7 (#0), + span: $DIR/inner-attrs.rs:35:1: 35:7 (#0), }, Ident { ident: "MyDerivePrint", - span: $DIR/inner-attrs.rs:34:8: 34:21 (#0), + span: $DIR/inner-attrs.rs:35:8: 35:21 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "field", - span: $DIR/inner-attrs.rs:35:5: 35:10 (#0), + span: $DIR/inner-attrs.rs:36:5: 36:10 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/inner-attrs.rs:35:10: 35:11 (#0), + span: $DIR/inner-attrs.rs:36:10: 36:11 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "u8", - span: $DIR/inner-attrs.rs:35:13: 35:15 (#0), + span: $DIR/inner-attrs.rs:36:13: 36:15 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:35:15: 35:16 (#0), + span: $DIR/inner-attrs.rs:36:15: 36:16 (#0), }, Group { delimiter: Brace, stream: TokenStream [ Ident { ident: "match", - span: $DIR/inner-attrs.rs:36:9: 36:14 (#0), + span: $DIR/inner-attrs.rs:37:9: 37:14 (#0), }, Ident { ident: "true", - span: $DIR/inner-attrs.rs:36:15: 36:19 (#0), + span: $DIR/inner-attrs.rs:37:15: 37:19 (#0), }, Group { delimiter: Brace, stream: TokenStream [ - Punct { - ch: '#', - spacing: Alone, - span: $DIR/inner-attrs.rs:37:13: 37:14 (#0), - }, - Punct { - ch: '!', - spacing: Alone, - span: $DIR/inner-attrs.rs:37:14: 37:15 (#0), - }, - Group { - delimiter: Bracket, - stream: TokenStream [ - Ident { - ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:37:37: 37:48 (#0), - }, - Group { - delimiter: Parenthesis, - stream: TokenStream [ - Ident { - ident: "first", - span: $DIR/inner-attrs.rs:37:49: 37:54 (#0), - }, - ], - span: $DIR/inner-attrs.rs:37:48: 37:55 (#0), - }, - ], - span: $DIR/inner-attrs.rs:37:13: 37:14 (#0), - }, - Punct { - ch: '#', - spacing: Alone, - span: $DIR/inner-attrs.rs:38:13: 38:14 (#0), - }, - Punct { - ch: '!', - spacing: Alone, - span: $DIR/inner-attrs.rs:38:14: 38:15 (#0), - }, - Group { - delimiter: Bracket, - stream: TokenStream [ - Ident { - ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:38:37: 38:48 (#0), - }, - Group { - delimiter: Parenthesis, - stream: TokenStream [ - Ident { - ident: "second", - span: $DIR/inner-attrs.rs:38:49: 38:55 (#0), - }, - ], - span: $DIR/inner-attrs.rs:38:48: 38:56 (#0), - }, - ], - span: $DIR/inner-attrs.rs:38:13: 38:14 (#0), - }, Ident { ident: "_", - span: $DIR/inner-attrs.rs:39:13: 39:14 (#0), + span: $DIR/inner-attrs.rs:38:13: 38:14 (#0), }, Punct { ch: '=', spacing: Joint, - span: $DIR/inner-attrs.rs:39:15: 39:17 (#0), + span: $DIR/inner-attrs.rs:38:15: 38:17 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/inner-attrs.rs:39:15: 39:17 (#0), + span: $DIR/inner-attrs.rs:38:15: 38:17 (#0), }, Group { delimiter: Brace, @@ -707,69 +640,69 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: $DIR/inner-attrs.rs:40:17: 40:18 (#0), + span: $DIR/inner-attrs.rs:39:17: 39:18 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:40:18: 40:19 (#0), + span: $DIR/inner-attrs.rs:39:18: 39:19 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:40:41: 40:52 (#0), + span: $DIR/inner-attrs.rs:39:41: 39:52 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "third", - span: $DIR/inner-attrs.rs:40:53: 40:58 (#0), + span: $DIR/inner-attrs.rs:39:53: 39:58 (#0), }, ], - span: $DIR/inner-attrs.rs:40:52: 40:59 (#0), + span: $DIR/inner-attrs.rs:39:52: 39:59 (#0), }, ], - span: $DIR/inner-attrs.rs:40:17: 40:18 (#0), + span: $DIR/inner-attrs.rs:39:17: 39:18 (#0), }, Ident { ident: "true", - span: $DIR/inner-attrs.rs:41:17: 41:21 (#0), + span: $DIR/inner-attrs.rs:40:17: 40:21 (#0), }, ], - span: $DIR/inner-attrs.rs:39:18: 42:14 (#0), + span: $DIR/inner-attrs.rs:38:18: 41:14 (#0), }, ], - span: $DIR/inner-attrs.rs:36:20: 43:10 (#0), + span: $DIR/inner-attrs.rs:37:20: 42:10 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:43:10: 43:11 (#0), + span: $DIR/inner-attrs.rs:42:10: 42:11 (#0), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: $DIR/inner-attrs.rs:44:9: 44:10 (#0), + span: $DIR/inner-attrs.rs:43:9: 43:10 (#0), }, ], - span: $DIR/inner-attrs.rs:35:17: 45:6 (#0), + span: $DIR/inner-attrs.rs:36:17: 44:6 (#0), }, ], - span: $DIR/inner-attrs.rs:35:12: 45:7 (#0), + span: $DIR/inner-attrs.rs:36:12: 44:7 (#0), }, ], - span: $DIR/inner-attrs.rs:34:22: 46:2 (#0), + span: $DIR/inner-attrs.rs:35:22: 45:2 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): tuple_attrs PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "tuple_attrs", - span: $DIR/inner-attrs.rs:52:29: 52:40 (#0), + span: $DIR/inner-attrs.rs:48:29: 48:40 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): (3, 4, { # ! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ; @@ -781,23 +714,23 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "3", suffix: None, - span: $DIR/inner-attrs.rs:54:9: 54:10 (#0), + span: $DIR/inner-attrs.rs:49:9: 49:10 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:54:10: 54:11 (#0), + span: $DIR/inner-attrs.rs:49:10: 49:11 (#0), }, Literal { kind: Integer, symbol: "4", suffix: None, - span: $DIR/inner-attrs.rs:54:12: 54:13 (#0), + span: $DIR/inner-attrs.rs:49:12: 49:13 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:54:13: 54:14 (#0), + span: $DIR/inner-attrs.rs:49:13: 49:14 (#0), }, Group { delimiter: Brace, @@ -805,151 +738,85 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:55:13: 55:14 (#0), + span: $DIR/inner-attrs.rs:50:13: 50:14 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:55:14: 55:15 (#0), + span: $DIR/inner-attrs.rs:50:14: 50:15 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg_attr", - span: $DIR/inner-attrs.rs:55:16: 55:24 (#0), + span: $DIR/inner-attrs.rs:50:16: 50:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/inner-attrs.rs:55:25: 55:28 (#0), + span: $DIR/inner-attrs.rs:50:25: 50:28 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/inner-attrs.rs:55:29: 55:34 (#0), + span: $DIR/inner-attrs.rs:50:29: 50:34 (#0), }, ], - span: $DIR/inner-attrs.rs:55:28: 55:35 (#0), + span: $DIR/inner-attrs.rs:50:28: 50:35 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:55:35: 55:36 (#0), + span: $DIR/inner-attrs.rs:50:35: 50:36 (#0), }, Ident { ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:55:37: 55:48 (#0), + span: $DIR/inner-attrs.rs:50:37: 50:48 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "innermost", - span: $DIR/inner-attrs.rs:55:49: 55:58 (#0), + span: $DIR/inner-attrs.rs:50:49: 50:58 (#0), }, ], - span: $DIR/inner-attrs.rs:55:48: 55:59 (#0), + span: $DIR/inner-attrs.rs:50:48: 50:59 (#0), }, ], - span: $DIR/inner-attrs.rs:55:24: 55:60 (#0), + span: $DIR/inner-attrs.rs:50:24: 50:60 (#0), }, ], - span: $DIR/inner-attrs.rs:55:15: 55:61 (#0), + span: $DIR/inner-attrs.rs:50:15: 50:61 (#0), }, Literal { kind: Integer, symbol: "5", suffix: None, - span: $DIR/inner-attrs.rs:56:13: 56:14 (#0), + span: $DIR/inner-attrs.rs:51:13: 51:14 (#0), }, ], - span: $DIR/inner-attrs.rs:54:15: 57:10 (#0), + span: $DIR/inner-attrs.rs:49:15: 52:10 (#0), }, ], - span: $DIR/inner-attrs.rs:52:43: 58:6 (#0), + span: $DIR/inner-attrs.rs:48:43: 53:6 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:58:6: 58:7 (#0), - }, -] -PRINT-ATTR_ARGS INPUT (DISPLAY): array_attrs -PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ - Ident { - ident: "array_attrs", - span: $DIR/inner-attrs.rs:60:29: 60:40 (#0), - }, -] -PRINT-ATTR INPUT (DISPLAY): [# ! [rustc_dummy(inner)] true ; 0] ; -PRINT-ATTR INPUT (DEBUG): TokenStream [ - Group { - delimiter: Bracket, - stream: TokenStream [ - Punct { - ch: '#', - spacing: Joint, - span: $DIR/inner-attrs.rs:61:9: 61:10 (#0), - }, - Punct { - ch: '!', - spacing: Alone, - span: $DIR/inner-attrs.rs:61:10: 61:11 (#0), - }, - Group { - delimiter: Bracket, - stream: TokenStream [ - Ident { - ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:61:12: 61:23 (#0), - }, - Group { - delimiter: Parenthesis, - stream: TokenStream [ - Ident { - ident: "inner", - span: $DIR/inner-attrs.rs:61:24: 61:29 (#0), - }, - ], - span: $DIR/inner-attrs.rs:61:23: 61:30 (#0), - }, - ], - span: $DIR/inner-attrs.rs:61:11: 61:31 (#0), - }, - Ident { - ident: "true", - span: $DIR/inner-attrs.rs:62:9: 62:13 (#0), - }, - Punct { - ch: ';', - spacing: Alone, - span: $DIR/inner-attrs.rs:62:13: 62:14 (#0), - }, - Literal { - kind: Integer, - symbol: "0", - suffix: None, - span: $DIR/inner-attrs.rs:62:15: 62:16 (#0), - }, - ], - span: $DIR/inner-attrs.rs:60:43: 63:6 (#0), - }, - Punct { - ch: ';', - spacing: Alone, - span: $DIR/inner-attrs.rs:63:6: 63:7 (#0), + span: $DIR/inner-attrs.rs:53:6: 53:7 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): tuple_attrs PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "tuple_attrs", - span: $DIR/inner-attrs.rs:65:29: 65:40 (#0), + span: $DIR/inner-attrs.rs:55:29: 55:40 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): (3, 4, { # ! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ; @@ -961,23 +828,23 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "3", suffix: None, - span: $DIR/inner-attrs.rs:67:9: 67:10 (#0), + span: $DIR/inner-attrs.rs:56:9: 56:10 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:67:10: 67:11 (#0), + span: $DIR/inner-attrs.rs:56:10: 56:11 (#0), }, Literal { kind: Integer, symbol: "4", suffix: None, - span: $DIR/inner-attrs.rs:67:12: 67:13 (#0), + span: $DIR/inner-attrs.rs:56:12: 56:13 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:67:13: 67:14 (#0), + span: $DIR/inner-attrs.rs:56:13: 56:14 (#0), }, Group { delimiter: Brace, @@ -985,171 +852,105 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Joint, - span: $DIR/inner-attrs.rs:68:13: 68:14 (#0), + span: $DIR/inner-attrs.rs:57:13: 57:14 (#0), }, Punct { ch: '!', spacing: Alone, - span: $DIR/inner-attrs.rs:68:14: 68:15 (#0), + span: $DIR/inner-attrs.rs:57:14: 57:15 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "cfg_attr", - span: $DIR/inner-attrs.rs:68:16: 68:24 (#0), + span: $DIR/inner-attrs.rs:57:16: 57:24 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "not", - span: $DIR/inner-attrs.rs:68:25: 68:28 (#0), + span: $DIR/inner-attrs.rs:57:25: 57:28 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "FALSE", - span: $DIR/inner-attrs.rs:68:29: 68:34 (#0), + span: $DIR/inner-attrs.rs:57:29: 57:34 (#0), }, ], - span: $DIR/inner-attrs.rs:68:28: 68:35 (#0), + span: $DIR/inner-attrs.rs:57:28: 57:35 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/inner-attrs.rs:68:35: 68:36 (#0), + span: $DIR/inner-attrs.rs:57:35: 57:36 (#0), }, Ident { ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:68:37: 68:48 (#0), + span: $DIR/inner-attrs.rs:57:37: 57:48 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "innermost", - span: $DIR/inner-attrs.rs:68:49: 68:58 (#0), + span: $DIR/inner-attrs.rs:57:49: 57:58 (#0), }, ], - span: $DIR/inner-attrs.rs:68:48: 68:59 (#0), + span: $DIR/inner-attrs.rs:57:48: 57:59 (#0), }, ], - span: $DIR/inner-attrs.rs:68:24: 68:60 (#0), + span: $DIR/inner-attrs.rs:57:24: 57:60 (#0), }, ], - span: $DIR/inner-attrs.rs:68:15: 68:61 (#0), + span: $DIR/inner-attrs.rs:57:15: 57:61 (#0), }, Literal { kind: Integer, symbol: "5", suffix: None, - span: $DIR/inner-attrs.rs:69:13: 69:14 (#0), - }, - ], - span: $DIR/inner-attrs.rs:67:15: 70:10 (#0), - }, - ], - span: $DIR/inner-attrs.rs:65:43: 71:6 (#0), - }, - Punct { - ch: ';', - spacing: Alone, - span: $DIR/inner-attrs.rs:71:6: 71:7 (#0), - }, -] -PRINT-ATTR_ARGS INPUT (DISPLAY): array_attrs -PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ - Ident { - ident: "array_attrs", - span: $DIR/inner-attrs.rs:73:29: 73:40 (#0), - }, -] -PRINT-ATTR INPUT (DISPLAY): [# ! [rustc_dummy(inner)] true ; 0] ; -PRINT-ATTR INPUT (DEBUG): TokenStream [ - Group { - delimiter: Bracket, - stream: TokenStream [ - Punct { - ch: '#', - spacing: Joint, - span: $DIR/inner-attrs.rs:74:9: 74:10 (#0), - }, - Punct { - ch: '!', - spacing: Alone, - span: $DIR/inner-attrs.rs:74:10: 74:11 (#0), - }, - Group { - delimiter: Bracket, - stream: TokenStream [ - Ident { - ident: "rustc_dummy", - span: $DIR/inner-attrs.rs:74:12: 74:23 (#0), - }, - Group { - delimiter: Parenthesis, - stream: TokenStream [ - Ident { - ident: "inner", - span: $DIR/inner-attrs.rs:74:24: 74:29 (#0), - }, - ], - span: $DIR/inner-attrs.rs:74:23: 74:30 (#0), + span: $DIR/inner-attrs.rs:58:13: 58:14 (#0), }, ], - span: $DIR/inner-attrs.rs:74:11: 74:31 (#0), - }, - Ident { - ident: "true", - span: $DIR/inner-attrs.rs:75:9: 75:13 (#0), - }, - Punct { - ch: ';', - spacing: Alone, - span: $DIR/inner-attrs.rs:75:13: 75:14 (#0), - }, - Literal { - kind: Integer, - symbol: "0", - suffix: None, - span: $DIR/inner-attrs.rs:75:15: 75:16 (#0), + span: $DIR/inner-attrs.rs:56:15: 59:10 (#0), }, ], - span: $DIR/inner-attrs.rs:73:43: 76:6 (#0), + span: $DIR/inner-attrs.rs:55:43: 60:6 (#0), }, Punct { ch: ';', spacing: Alone, - span: $DIR/inner-attrs.rs:76:6: 76:7 (#0), + span: $DIR/inner-attrs.rs:60:6: 60:7 (#0), }, ] PRINT-ATTR_ARGS INPUT (DISPLAY): tenth PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ Ident { ident: "tenth", - span: $DIR/inner-attrs.rs:112:42: 112:47 (#0), + span: $DIR/inner-attrs.rs:82:42: 82:47 (#0), }, ] PRINT-ATTR INPUT (DISPLAY): fn weird_extern() { } PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "fn", - span: $DIR/inner-attrs.rs:111:5: 111:7 (#0), + span: $DIR/inner-attrs.rs:81:5: 81:7 (#0), }, Ident { ident: "weird_extern", - span: $DIR/inner-attrs.rs:111:8: 111:20 (#0), + span: $DIR/inner-attrs.rs:81:8: 81:20 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/inner-attrs.rs:111:20: 111:22 (#0), + span: $DIR/inner-attrs.rs:81:20: 81:22 (#0), }, Group { delimiter: Brace, stream: TokenStream [], - span: $DIR/inner-attrs.rs:111:23: 113:6 (#0), + span: $DIR/inner-attrs.rs:81:23: 83:6 (#0), }, ] diff --git a/src/test/ui/proc-macro/simple-tuple.rs b/src/test/ui/proc-macro/simple-tuple.rs deleted file mode 100644 index c94c5877e2240..0000000000000 --- a/src/test/ui/proc-macro/simple-tuple.rs +++ /dev/null @@ -1,19 +0,0 @@ -// check-pass -// compile-flags: -Z span-debug --error-format human -// aux-build:test-macros.rs -// edition:2018 - -#![feature(proc_macro_hygiene)] - -#![no_std] // Don't load unnecessary hygiene information from std -extern crate std; - -#[macro_use] -extern crate test_macros; - -fn main() { - #[print_target_and_args(my_arg)] ( - #![cfg_attr(not(FALSE), allow(unused))] - 1, 2, 3 - ); -} diff --git a/src/test/ui/proc-macro/simple-tuple.stdout b/src/test/ui/proc-macro/simple-tuple.stdout deleted file mode 100644 index 1cc8579a4675a..0000000000000 --- a/src/test/ui/proc-macro/simple-tuple.stdout +++ /dev/null @@ -1,79 +0,0 @@ -PRINT-ATTR_ARGS INPUT (DISPLAY): my_arg -PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [ - Ident { - ident: "my_arg", - span: $DIR/simple-tuple.rs:15:29: 15:35 (#0), - }, -] -PRINT-ATTR INPUT (DISPLAY): (# ! [allow(unused)] 1, 2, 3) ; -PRINT-ATTR INPUT (DEBUG): TokenStream [ - Group { - delimiter: Parenthesis, - stream: TokenStream [ - Punct { - ch: '#', - spacing: Alone, - span: $DIR/simple-tuple.rs:16:9: 16:10 (#0), - }, - Punct { - ch: '!', - spacing: Alone, - span: $DIR/simple-tuple.rs:16:10: 16:11 (#0), - }, - Group { - delimiter: Bracket, - stream: TokenStream [ - Ident { - ident: "allow", - span: $DIR/simple-tuple.rs:16:33: 16:38 (#0), - }, - Group { - delimiter: Parenthesis, - stream: TokenStream [ - Ident { - ident: "unused", - span: $DIR/simple-tuple.rs:16:39: 16:45 (#0), - }, - ], - span: $DIR/simple-tuple.rs:16:38: 16:46 (#0), - }, - ], - span: $DIR/simple-tuple.rs:16:9: 16:10 (#0), - }, - Literal { - kind: Integer, - symbol: "1", - suffix: None, - span: $DIR/simple-tuple.rs:17:9: 17:10 (#0), - }, - Punct { - ch: ',', - spacing: Alone, - span: $DIR/simple-tuple.rs:17:10: 17:11 (#0), - }, - Literal { - kind: Integer, - symbol: "2", - suffix: None, - span: $DIR/simple-tuple.rs:17:12: 17:13 (#0), - }, - Punct { - ch: ',', - spacing: Alone, - span: $DIR/simple-tuple.rs:17:13: 17:14 (#0), - }, - Literal { - kind: Integer, - symbol: "3", - suffix: None, - span: $DIR/simple-tuple.rs:17:15: 17:16 (#0), - }, - ], - span: $DIR/simple-tuple.rs:15:38: 18:6 (#0), - }, - Punct { - ch: ';', - spacing: Alone, - span: $DIR/simple-tuple.rs:18:6: 18:7 (#0), - }, -]