From fff01ccfa805ccef67827bf1ea84e21d61d13e6f Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 16 Dec 2018 20:23:27 +0300 Subject: Do not abort compilation if expansion produces errors Fix a number of uncovered deficiencies in diagnostics --- src/test/ui/issues/issue-10536.rs | 7 ++++--- src/test/ui/issues/issue-10536.stderr | 25 ++++++++++++++++++++++++- src/test/ui/issues/issue-11692-1.rs | 1 + src/test/ui/issues/issue-11692-1.stderr | 8 +++++++- src/test/ui/issues/issue-11692-2.rs | 1 + src/test/ui/issues/issue-11692-2.stderr | 10 +++++++++- src/test/ui/issues/issue-32950.rs | 1 + src/test/ui/issues/issue-32950.stderr | 9 ++++++++- src/test/ui/issues/issue-33571.rs | 2 ++ src/test/ui/issues/issue-35677.rs | 2 ++ src/test/ui/issues/issue-35677.stderr | 9 ++------- src/test/ui/issues/issue-36617.rs | 2 ++ src/test/ui/issues/issue-43023.rs | 2 ++ src/test/ui/issues/issue-46438.rs | 2 +- src/test/ui/issues/issue-49074.rs | 2 +- src/test/ui/issues/issue-49074.stderr | 10 +++++++++- src/test/ui/issues/issue-51279.rs | 1 + src/test/ui/issues/issue-51279.stderr | 11 ++++++++++- src/test/ui/issues/issue-55796.rs | 2 ++ src/test/ui/issues/issue-55796.stderr | 9 ++------- src/test/ui/issues/issue-6596-1.rs | 1 + src/test/ui/issues/issue-6596-1.stderr | 12 +++++++++++- src/test/ui/issues/issue-6596-2.rs | 1 + 23 files changed, 104 insertions(+), 26 deletions(-) (limited to 'src/test/ui/issues') diff --git a/src/test/ui/issues/issue-10536.rs b/src/test/ui/issues/issue-10536.rs index f8695caca5b..a2df2913afb 100644 --- a/src/test/ui/issues/issue-10536.rs +++ b/src/test/ui/issues/issue-10536.rs @@ -1,8 +1,6 @@ // We only want to assert that this doesn't ICE, we don't particularly care // about whether it nor it fails to compile. -// error-pattern: - macro_rules! foo{ () => {{ macro_rules! bar{() => (())} @@ -15,9 +13,12 @@ pub fn main() { assert!({one! two()}); //~^ ERROR macros that expand to items must either be surrounded with braces or followed by a + //~| ERROR cannot find macro `one!` in this scope + //~| ERROR mismatched types // regardless of whether nested macro_rules works, the following should at // least throw a conventional error. assert!({one! two}); - //~^ ERROR expected + //~^ ERROR expected `(` or `{`, found `}` + //~| ERROR cannot apply unary operator `!` to type `!` } diff --git a/src/test/ui/issues/issue-10536.stderr b/src/test/ui/issues/issue-10536.stderr index bc542ce35c0..6b2424d3a45 100644 --- a/src/test/ui/issues/issue-10536.stderr +++ b/src/test/ui/issues/issue-10536.stderr @@ -10,5 +10,28 @@ error: expected `(` or `{`, found `}` LL | assert!({one! two}); | ^ expected `(` or `{` -error: aborting due to 2 previous errors +error: cannot find macro `one!` in this scope + --> $DIR/issue-10536.rs:24:14 + | +LL | assert!({one! two()}); + | ^^^ + +error[E0308]: mismatched types + --> $DIR/issue-10536.rs:24:13 + | +LL | assert!({one! two()}); + | ^^^^^^^^^^^^ expected bool, found () + | + = note: expected type `bool` + found type `()` + +error[E0600]: cannot apply unary operator `!` to type `!` + --> $DIR/issue-10536.rs:31:5 + | +LL | assert!({one! two}); + | ^^^^^^^^^^^^^^^^^^^^ cannot apply unary operator `!` + +error: aborting due to 5 previous errors +Some errors occurred: E0308, E0600. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/issues/issue-11692-1.rs b/src/test/ui/issues/issue-11692-1.rs index eae555ad83c..22777780402 100644 --- a/src/test/ui/issues/issue-11692-1.rs +++ b/src/test/ui/issues/issue-11692-1.rs @@ -1,4 +1,5 @@ fn main() { print!(testo!()); //~^ ERROR: format argument must be a string literal + //~| ERROR: cannot find macro `testo!` in this scope } diff --git a/src/test/ui/issues/issue-11692-1.stderr b/src/test/ui/issues/issue-11692-1.stderr index 1173e056321..e0c4642ea60 100644 --- a/src/test/ui/issues/issue-11692-1.stderr +++ b/src/test/ui/issues/issue-11692-1.stderr @@ -8,5 +8,11 @@ help: you might be missing a string literal to format with LL | print!("{}", testo!()); | ^^^^^ -error: aborting due to previous error +error: cannot find macro `testo!` in this scope + --> $DIR/issue-11692-1.rs:12:12 + | +LL | print!(testo!()); + | ^^^^^ + +error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-11692-2.rs b/src/test/ui/issues/issue-11692-2.rs index 61be284d732..61039316573 100644 --- a/src/test/ui/issues/issue-11692-2.rs +++ b/src/test/ui/issues/issue-11692-2.rs @@ -1,3 +1,4 @@ fn main() { concat!(test!()); //~ ERROR cannot find macro `test!` in this scope + //~| ERROR expected a literal } diff --git a/src/test/ui/issues/issue-11692-2.stderr b/src/test/ui/issues/issue-11692-2.stderr index 5d4467080f1..16cf7b0dca7 100644 --- a/src/test/ui/issues/issue-11692-2.stderr +++ b/src/test/ui/issues/issue-11692-2.stderr @@ -1,8 +1,16 @@ +error: expected a literal + --> $DIR/issue-11692-2.rs:12:13 + | +LL | concat!(test!()); //~ ERROR cannot find macro `test!` in this scope + | ^^^^^^^ + | + = note: only literals (like `"foo"`, `42` and `3.14`) can be passed to `concat!()` + error: cannot find macro `test!` in this scope --> $DIR/issue-11692-2.rs:2:13 | LL | concat!(test!()); //~ ERROR cannot find macro `test!` in this scope | ^^^^ -error: aborting due to previous error +error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-32950.rs b/src/test/ui/issues/issue-32950.rs index dc5b063ada4..27d68a11c1f 100644 --- a/src/test/ui/issues/issue-32950.rs +++ b/src/test/ui/issues/issue-32950.rs @@ -3,6 +3,7 @@ #[derive(Debug)] struct Baz( concat_idents!(Foo, Bar) //~ ERROR `derive` cannot be used on items with type macros + //~^ ERROR cannot find type `FooBar` in this scope ); fn main() {} diff --git a/src/test/ui/issues/issue-32950.stderr b/src/test/ui/issues/issue-32950.stderr index e8e3347af2e..af148cbb5c6 100644 --- a/src/test/ui/issues/issue-32950.stderr +++ b/src/test/ui/issues/issue-32950.stderr @@ -4,5 +4,12 @@ error: `derive` cannot be used on items with type macros LL | concat_idents!(Foo, Bar) //~ ERROR `derive` cannot be used on items with type macros | ^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error[E0412]: cannot find type `FooBar` in this scope + --> $DIR/issue-32950.rs:15:5 + | +LL | concat_idents!(Foo, Bar) //~ ERROR `derive` cannot be used on items with type macros + | ^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope + +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/issues/issue-33571.rs b/src/test/ui/issues/issue-33571.rs index 5f9c514addb..223bbc3ff5e 100644 --- a/src/test/ui/issues/issue-33571.rs +++ b/src/test/ui/issues/issue-33571.rs @@ -2,3 +2,5 @@ Sync, //~ ERROR this unsafe trait should be implemented explicitly Copy)] enum Foo {} + +fn main() {} diff --git a/src/test/ui/issues/issue-35677.rs b/src/test/ui/issues/issue-35677.rs index 46d3f7e4af0..71e2125ffd2 100644 --- a/src/test/ui/issues/issue-35677.rs +++ b/src/test/ui/issues/issue-35677.rs @@ -3,3 +3,5 @@ fn intersect_map(this: &mut HashMap, other: HashMap) -> bool { this.drain() //~^ ERROR no method named } + +fn main() {} diff --git a/src/test/ui/issues/issue-35677.stderr b/src/test/ui/issues/issue-35677.stderr index dca096b93f5..61ddb75b3b5 100644 --- a/src/test/ui/issues/issue-35677.stderr +++ b/src/test/ui/issues/issue-35677.stderr @@ -1,7 +1,3 @@ -error[E0601]: `main` function not found in crate `issue_35677` - | - = note: consider adding a `main` function to `$DIR/issue-35677.rs` - error[E0599]: no method named `drain` found for type `&mut std::collections::HashMap` in the current scope --> $DIR/issue-35677.rs:3:10 | @@ -12,7 +8,6 @@ LL | this.drain() `K : std::cmp::Eq` `K : std::hash::Hash` -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors occurred: E0599, E0601. -For more information about an error, try `rustc --explain E0599`. +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issues/issue-36617.rs b/src/test/ui/issues/issue-36617.rs index 846efac41c8..87092689a28 100644 --- a/src/test/ui/issues/issue-36617.rs +++ b/src/test/ui/issues/issue-36617.rs @@ -1 +1,3 @@ #![derive(Copy)] //~ ERROR `derive` may only be applied to structs, enums and unions + +fn main() {} diff --git a/src/test/ui/issues/issue-43023.rs b/src/test/ui/issues/issue-43023.rs index 32bd66f5a93..072243d881c 100644 --- a/src/test/ui/issues/issue-43023.rs +++ b/src/test/ui/issues/issue-43023.rs @@ -16,3 +16,5 @@ trait Tr2 { #[derive(Debug)] //~ ERROR `derive` may only be applied to structs, enums and unions type F; } + +fn main() {} diff --git a/src/test/ui/issues/issue-46438.rs b/src/test/ui/issues/issue-46438.rs index a16c4c31d81..d78b958463f 100644 --- a/src/test/ui/issues/issue-46438.rs +++ b/src/test/ui/issues/issue-46438.rs @@ -4,7 +4,7 @@ macro_rules! m { } } -trait Trait {} +trait Tr {} m!(Tr); diff --git a/src/test/ui/issues/issue-49074.rs b/src/test/ui/issues/issue-49074.rs index dbd96e96191..ad66e421c6b 100644 --- a/src/test/ui/issues/issue-49074.rs +++ b/src/test/ui/issues/issue-49074.rs @@ -9,5 +9,5 @@ mod foo { } fn main() { - bar!(); + bar!(); //~ ERROR cannot find macro `bar!` in this scope } diff --git a/src/test/ui/issues/issue-49074.stderr b/src/test/ui/issues/issue-49074.stderr index 8de4d081413..6b5e979082e 100644 --- a/src/test/ui/issues/issue-49074.stderr +++ b/src/test/ui/issues/issue-49074.stderr @@ -6,6 +6,14 @@ LL | #[marco_use] // typo | = help: add #![feature(custom_attribute)] to the crate attributes to enable -error: aborting due to previous error +error: cannot find macro `bar!` in this scope + --> $DIR/issue-49074.rs:22:4 + | +LL | bar!(); //~ ERROR cannot find macro `bar!` in this scope + | ^^^ + | + = help: have you added the `#[macro_use]` on the module/import? + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/issues/issue-51279.rs b/src/test/ui/issues/issue-51279.rs index caef23043cb..ad5438fbd46 100644 --- a/src/test/ui/issues/issue-51279.rs +++ b/src/test/ui/issues/issue-51279.rs @@ -22,3 +22,4 @@ unsafe impl<#[cfg_attr(none, may_dangle)] T> Drop for M { type Z<#[ignored] 'a, #[cfg(none)] T> = X<'a, T>; //~^ ERROR #[cfg] cannot be applied on a generic parameter +//~| ERROR attribute `ignored` is currently unknown to the compiler diff --git a/src/test/ui/issues/issue-51279.stderr b/src/test/ui/issues/issue-51279.stderr index 89786f72e18..33afac39865 100644 --- a/src/test/ui/issues/issue-51279.stderr +++ b/src/test/ui/issues/issue-51279.stderr @@ -46,5 +46,14 @@ error: #[cfg] cannot be applied on a generic parameter LL | type Z<#[ignored] 'a, #[cfg(none)] T> = X<'a, T>; | ^^^^^^^^^^^^ -error: aborting due to 8 previous errors +error[E0658]: The attribute `ignored` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/issue-51279.rs:33:8 + | +LL | type Z<#[ignored] 'a, #[cfg(none)] T> = X<'a, T>; + | ^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error: aborting due to 9 previous errors +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/issues/issue-55796.rs b/src/test/ui/issues/issue-55796.rs index a172f6a7bfa..efdea5c9b1e 100644 --- a/src/test/ui/issues/issue-55796.rs +++ b/src/test/ui/issues/issue-55796.rs @@ -22,3 +22,5 @@ pub trait Graph<'a> { //~^ ERROR cannot infer } } + +fn main() {} diff --git a/src/test/ui/issues/issue-55796.stderr b/src/test/ui/issues/issue-55796.stderr index f8ca0727efb..c05f8b85d0e 100644 --- a/src/test/ui/issues/issue-55796.stderr +++ b/src/test/ui/issues/issue-55796.stderr @@ -1,7 +1,3 @@ -error[E0601]: `main` function not found in crate `issue_55796` - | - = note: consider adding a `main` function to `$DIR/issue-55796.rs` - error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> $DIR/issue-55796.rs:16:9 | @@ -44,7 +40,6 @@ LL | Box::new(self.in_edges(u).map(|e| e.target())) expected std::boxed::Box<(dyn std::iter::Iterator>::Node> + 'static)> found std::boxed::Box>::Node>> -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors occurred: E0495, E0601. -For more information about an error, try `rustc --explain E0495`. +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/issues/issue-6596-1.rs b/src/test/ui/issues/issue-6596-1.rs index 5da54451346..6a5986c355e 100644 --- a/src/test/ui/issues/issue-6596-1.rs +++ b/src/test/ui/issues/issue-6596-1.rs @@ -2,6 +2,7 @@ macro_rules! e { ($inp:ident) => ( $nonexistent //~^ ERROR unknown macro variable `nonexistent` + //~| ERROR cannot find value `nonexistent` in this scope ); } diff --git a/src/test/ui/issues/issue-6596-1.stderr b/src/test/ui/issues/issue-6596-1.stderr index 2a4ece2f242..face8725914 100644 --- a/src/test/ui/issues/issue-6596-1.stderr +++ b/src/test/ui/issues/issue-6596-1.stderr @@ -7,5 +7,15 @@ LL | $nonexistent LL | e!(foo); | -------- in this macro invocation -error: aborting due to previous error +error[E0425]: cannot find value `nonexistent` in this scope + --> $DIR/issue-6596-1.rs:14:9 + | +LL | $nonexistent + | ^^^^^^^^^^^^ not found in this scope +... +LL | e!(foo); + | -------- in this macro invocation + +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/issues/issue-6596-2.rs b/src/test/ui/issues/issue-6596-2.rs index 056a720bc5c..4ff7cfe3865 100644 --- a/src/test/ui/issues/issue-6596-2.rs +++ b/src/test/ui/issues/issue-6596-2.rs @@ -9,5 +9,6 @@ macro_rules! g { } fn main() { + let foo = 0; g!(foo); } -- cgit 1.4.1-3-g733a5 From 4ac592516f0627778ac4aaee52acd7d7591e5cb3 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 20 Dec 2018 02:33:56 +0300 Subject: Get rid of `Block::recovered` --- src/librustc/hir/lowering.rs | 3 --- src/librustc/hir/mod.rs | 5 ----- src/librustc/ich/impls_hir.rs | 1 - src/librustc_driver/pretty.rs | 6 ++---- src/librustc_typeck/check/mod.rs | 7 +------ src/libsyntax/ast.rs | 1 - src/libsyntax/ext/build.rs | 1 - src/libsyntax/fold.rs | 3 +-- src/libsyntax/parse/parser.rs | 12 ++++++------ src/libsyntax_ext/deriving/mod.rs | 1 - src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs | 1 - src/test/ui/issues/issue-10536.rs | 1 - src/test/ui/issues/issue-10536.stderr | 11 ++--------- 13 files changed, 12 insertions(+), 41 deletions(-) (limited to 'src/test/ui/issues') diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 59b9f83c242..32514caff87 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -2709,7 +2709,6 @@ impl<'a> LoweringContext<'a> { rules: self.lower_block_check_mode(&b.rules), span: b.span, targeted_by_break, - recovered: b.recovered, }) } @@ -3781,7 +3780,6 @@ impl<'a> LoweringContext<'a> { rules: hir::DefaultBlock, span, targeted_by_break: false, - recovered: blk.recovered, }); P(self.expr_block(blk, ThinVec::new())) } @@ -4823,7 +4821,6 @@ impl<'a> LoweringContext<'a> { rules: hir::DefaultBlock, span, targeted_by_break: false, - recovered: false, } } diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 601d310fc3a..56144129ef4 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -807,11 +807,6 @@ pub struct Block { /// break out of this block early. /// Used by `'label: {}` blocks and by `catch` statements. pub targeted_by_break: bool, - /// If true, don't emit return value type errors as the parser had - /// to recover from a parse error so this block will not have an - /// appropriate type. A parse error will have been emitted so the - /// compilation will never succeed if this is true. - pub recovered: bool, } #[derive(Clone, RustcEncodable, RustcDecodable)] diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index 006f11d51e4..bf9efb54b60 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -410,7 +410,6 @@ impl_stable_hash_for!(struct hir::Block { rules, span, targeted_by_break, - recovered, }); impl_stable_hash_for!(struct hir::Pat { diff --git a/src/librustc_driver/pretty.rs b/src/librustc_driver/pretty.rs index 6a455be7268..a9ec99358c1 100644 --- a/src/librustc_driver/pretty.rs +++ b/src/librustc_driver/pretty.rs @@ -741,7 +741,6 @@ impl<'a> fold::Folder for ReplaceBodyWithLoop<'a> { fn fold_block(&mut self, b: P) -> P { fn stmt_to_block(rules: ast::BlockCheckMode, - recovered: bool, s: Option, sess: &Session) -> ast::Block { ast::Block { @@ -749,7 +748,6 @@ impl<'a> fold::Folder for ReplaceBodyWithLoop<'a> { rules, id: sess.next_node_id(), span: syntax_pos::DUMMY_SP, - recovered, } } @@ -768,7 +766,7 @@ impl<'a> fold::Folder for ReplaceBodyWithLoop<'a> { } } - let empty_block = stmt_to_block(BlockCheckMode::Default, false, None, self.sess); + let empty_block = stmt_to_block(BlockCheckMode::Default, None, self.sess); let loop_expr = P(ast::Expr { node: ast::ExprKind::Loop(P(empty_block), None), id: self.sess.next_node_id(), @@ -809,7 +807,7 @@ impl<'a> fold::Folder for ReplaceBodyWithLoop<'a> { old_blocks.push(new_block); } - stmt_to_block(b.rules, b.recovered, Some(loop_stmt), self.sess) + stmt_to_block(b.rules, Some(loop_stmt), self.sess) } else { //push `loop {}` onto the end of our fresh block and yield that new_block.stmts.push(loop_stmt); diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 0cfe06451a7..b3c24be108d 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -4772,12 +4772,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // // #41425 -- label the implicit `()` as being the // "found type" here, rather than the "expected type". - // - // #44579 -- if the block was recovered during parsing, - // the type would be nonsensical and it is not worth it - // to perform the type check, so we avoid generating the - // diagnostic output. - if !self.diverges.get().always() && !blk.recovered { + if !self.diverges.get().always() { coerce.coerce_forced_unit(self, &self.misc(blk.span), &mut |err| { if let Some(expected_ty) = expected.only_has_type(self) { self.consider_hint_about_removing_semicolon(blk, diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index f0e567f9cd6..e3a8980a975 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -444,7 +444,6 @@ pub struct Block { /// Distinguishes between `unsafe { ... }` and `{ ... }` pub rules: BlockCheckMode, pub span: Span, - pub recovered: bool, } #[derive(Clone, RustcEncodable, RustcDecodable)] diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 15faae53916..a8eec1a74dd 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -587,7 +587,6 @@ impl<'a> AstBuilder for ExtCtxt<'a> { id: ast::DUMMY_NODE_ID, rules: BlockCheckMode::Default, span, - recovered: false, }) } diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index b8990264c5d..8ac103856dc 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -892,12 +892,11 @@ fn noop_fold_bounds(bounds: GenericBounds, folder: &mut T) } pub fn noop_fold_block(b: P, folder: &mut T) -> P { - b.map(|Block {id, stmts, rules, span, recovered}| Block { + b.map(|Block {id, stmts, rules, span}| Block { id: folder.new_id(id), stmts: stmts.move_flat_map(|s| folder.fold_stmt(s).into_iter()), rules, span: folder.new_span(span), - recovered, }) } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index e6f0d871222..d68a6546f48 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -32,6 +32,7 @@ use ast::{UseTree, UseTreeKind}; use ast::{BinOpKind, UnOp}; use ast::{RangeEnd, RangeSyntax}; use {ast, attr}; +use ext::base::DummyResult; use source_map::{self, SourceMap, Spanned, respan}; use syntax_pos::{self, Span, MultiSpan, BytePos, FileName}; use errors::{self, Applicability, DiagnosticBuilder, DiagnosticId}; @@ -4966,16 +4967,16 @@ impl<'a> Parser<'a> { /// Precondition: already parsed the '{'. fn parse_block_tail(&mut self, lo: Span, s: BlockCheckMode) -> PResult<'a, P> { let mut stmts = vec![]; - let mut recovered = false; - while !self.eat(&token::CloseDelim(token::Brace)) { let stmt = match self.parse_full_stmt(false) { Err(mut err) => { err.emit(); self.recover_stmt_(SemiColonMode::Ignore, BlockMode::Ignore); - self.eat(&token::CloseDelim(token::Brace)); - recovered = true; - break; + Some(Stmt { + id: ast::DUMMY_NODE_ID, + node: StmtKind::Expr(DummyResult::raw_expr(self.span)), + span: self.span, + }) } Ok(stmt) => stmt, }; @@ -4993,7 +4994,6 @@ impl<'a> Parser<'a> { id: ast::DUMMY_NODE_ID, rules: s, span: lo.to(self.prev_span), - recovered, })) } diff --git a/src/libsyntax_ext/deriving/mod.rs b/src/libsyntax_ext/deriving/mod.rs index 85b864dee53..7548d43f184 100644 --- a/src/libsyntax_ext/deriving/mod.rs +++ b/src/libsyntax_ext/deriving/mod.rs @@ -153,6 +153,5 @@ fn call_intrinsic(cx: &ExtCtxt, id: ast::DUMMY_NODE_ID, rules: ast::BlockCheckMode::Unsafe(ast::CompilerGenerated), span, - recovered: false, })) } diff --git a/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs b/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs index f99b5e51963..ce3b03efd26 100644 --- a/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs +++ b/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs @@ -105,7 +105,6 @@ fn iter_exprs(depth: usize, f: &mut FnMut(P)) { id: DUMMY_NODE_ID, rules: BlockCheckMode::Default, span: DUMMY_SP, - recovered: false, }); iter_exprs(depth - 1, &mut |e| g(ExprKind::If(e, block.clone(), None))); }, diff --git a/src/test/ui/issues/issue-10536.rs b/src/test/ui/issues/issue-10536.rs index a2df2913afb..95c8c2b0585 100644 --- a/src/test/ui/issues/issue-10536.rs +++ b/src/test/ui/issues/issue-10536.rs @@ -20,5 +20,4 @@ pub fn main() { // least throw a conventional error. assert!({one! two}); //~^ ERROR expected `(` or `{`, found `}` - //~| ERROR cannot apply unary operator `!` to type `!` } diff --git a/src/test/ui/issues/issue-10536.stderr b/src/test/ui/issues/issue-10536.stderr index 6b2424d3a45..0b6c357b920 100644 --- a/src/test/ui/issues/issue-10536.stderr +++ b/src/test/ui/issues/issue-10536.stderr @@ -25,13 +25,6 @@ LL | assert!({one! two()}); = note: expected type `bool` found type `()` -error[E0600]: cannot apply unary operator `!` to type `!` - --> $DIR/issue-10536.rs:31:5 - | -LL | assert!({one! two}); - | ^^^^^^^^^^^^^^^^^^^^ cannot apply unary operator `!` - -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors -Some errors occurred: E0308, E0600. -For more information about an error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0308`. -- cgit 1.4.1-3-g733a5 From 37af04ff8d784969882296c0fb74aa3e68624873 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 21 Dec 2018 02:58:55 +0300 Subject: Address review comments and CI failures --- src/librustc_resolve/macros.rs | 2 +- src/libsyntax/parse/parser.rs | 1 + src/test/compile-fail/auxiliary/depends.rs | 8 ++++++++ src/test/compile-fail/auxiliary/needs-panic-runtime.rs | 6 ++++++ src/test/compile-fail/runtime-depend-on-needs-runtime.rs | 7 +++++++ src/test/compile-fail/runtime-depend-on-needs-runtime.stderr | 4 ++++ src/test/ui/issues/issue-6596-1.rs | 1 - src/test/ui/issues/issue-6596-1.stderr | 12 +----------- src/test/ui/issues/issue-6596-2.rs | 1 - src/test/ui/issues/issue-6596-2.stderr | 12 +----------- src/test/ui/macros/macro-comma-behavior.core.stderr | 5 +---- src/test/ui/macros/macro-comma-behavior.rs | 2 ++ src/test/ui/macros/macro-comma-behavior.std.stderr | 1 - src/test/ui/panic-runtime/auxiliary/depends.rs | 8 -------- src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs | 6 ------ src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs | 7 ------- .../ui/panic-runtime/runtime-depend-on-needs-runtime.stderr | 4 ---- 17 files changed, 32 insertions(+), 55 deletions(-) create mode 100644 src/test/compile-fail/auxiliary/depends.rs create mode 100644 src/test/compile-fail/auxiliary/needs-panic-runtime.rs create mode 100644 src/test/compile-fail/runtime-depend-on-needs-runtime.rs create mode 100644 src/test/compile-fail/runtime-depend-on-needs-runtime.stderr delete mode 100644 src/test/ui/panic-runtime/auxiliary/depends.rs delete mode 100644 src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs delete mode 100644 src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs delete mode 100644 src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.stderr (limited to 'src/test/ui/issues') diff --git a/src/librustc_resolve/macros.rs b/src/librustc_resolve/macros.rs index 9c0c8a6016f..182dcfe4098 100644 --- a/src/librustc_resolve/macros.rs +++ b/src/librustc_resolve/macros.rs @@ -186,7 +186,7 @@ impl<'a> base::Resolver for Resolver<'a> { Ok((def, ext)) => (def, ext), Err(Determinacy::Determined) if kind == MacroKind::Attr => { // Replace unresolved attributes with used inert attributes for better recovery. - return Ok(Some(self.get_macro(Def::NonMacroAttr(NonMacroAttrKind::Tool)))); + return Ok(Some(Lrc::new(SyntaxExtension::NonMacroAttr { mark_used: true }))); } Err(determinacy) => return Err(determinacy), }; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 11d570072cd..52da8a072c7 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2871,6 +2871,7 @@ impl<'a> Parser<'a> { let mut err = self.fatal(&format!("unknown macro variable `{}`", name)); err.span_label(self.span, "unknown macro variable"); err.emit(); + self.bump(); return } token::Interpolated(ref nt) => { diff --git a/src/test/compile-fail/auxiliary/depends.rs b/src/test/compile-fail/auxiliary/depends.rs new file mode 100644 index 00000000000..e9bc2f4893e --- /dev/null +++ b/src/test/compile-fail/auxiliary/depends.rs @@ -0,0 +1,8 @@ +// no-prefer-dynamic + +#![feature(panic_runtime)] +#![crate_type = "rlib"] +#![panic_runtime] +#![no_std] + +extern crate needs_panic_runtime; diff --git a/src/test/compile-fail/auxiliary/needs-panic-runtime.rs b/src/test/compile-fail/auxiliary/needs-panic-runtime.rs new file mode 100644 index 00000000000..3f030c169f6 --- /dev/null +++ b/src/test/compile-fail/auxiliary/needs-panic-runtime.rs @@ -0,0 +1,6 @@ +// no-prefer-dynamic + +#![feature(needs_panic_runtime)] +#![crate_type = "rlib"] +#![needs_panic_runtime] +#![no_std] diff --git a/src/test/compile-fail/runtime-depend-on-needs-runtime.rs b/src/test/compile-fail/runtime-depend-on-needs-runtime.rs new file mode 100644 index 00000000000..866c5b2e34b --- /dev/null +++ b/src/test/compile-fail/runtime-depend-on-needs-runtime.rs @@ -0,0 +1,7 @@ +// aux-build:needs-panic-runtime.rs +// aux-build:depends.rs +// error-pattern:cannot depend on a crate that needs a panic runtime + +extern crate depends; + +fn main() {} diff --git a/src/test/compile-fail/runtime-depend-on-needs-runtime.stderr b/src/test/compile-fail/runtime-depend-on-needs-runtime.stderr new file mode 100644 index 00000000000..27e27dda5ef --- /dev/null +++ b/src/test/compile-fail/runtime-depend-on-needs-runtime.stderr @@ -0,0 +1,4 @@ +error: the crate `depends` cannot depend on a crate that needs a panic runtime, but it depends on `needs_panic_runtime` + +error: aborting due to previous error + diff --git a/src/test/ui/issues/issue-6596-1.rs b/src/test/ui/issues/issue-6596-1.rs index 6a5986c355e..5da54451346 100644 --- a/src/test/ui/issues/issue-6596-1.rs +++ b/src/test/ui/issues/issue-6596-1.rs @@ -2,7 +2,6 @@ macro_rules! e { ($inp:ident) => ( $nonexistent //~^ ERROR unknown macro variable `nonexistent` - //~| ERROR cannot find value `nonexistent` in this scope ); } diff --git a/src/test/ui/issues/issue-6596-1.stderr b/src/test/ui/issues/issue-6596-1.stderr index face8725914..2a4ece2f242 100644 --- a/src/test/ui/issues/issue-6596-1.stderr +++ b/src/test/ui/issues/issue-6596-1.stderr @@ -7,15 +7,5 @@ LL | $nonexistent LL | e!(foo); | -------- in this macro invocation -error[E0425]: cannot find value `nonexistent` in this scope - --> $DIR/issue-6596-1.rs:14:9 - | -LL | $nonexistent - | ^^^^^^^^^^^^ not found in this scope -... -LL | e!(foo); - | -------- in this macro invocation - -error: aborting due to 2 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/issues/issue-6596-2.rs b/src/test/ui/issues/issue-6596-2.rs index 4ff7cfe3865..b19700efe5a 100644 --- a/src/test/ui/issues/issue-6596-2.rs +++ b/src/test/ui/issues/issue-6596-2.rs @@ -4,7 +4,6 @@ macro_rules! g { ($inp:ident) => ( { $inp $nonexistent } //~^ ERROR unknown macro variable `nonexistent` - //~| ERROR expected one of ); } diff --git a/src/test/ui/issues/issue-6596-2.stderr b/src/test/ui/issues/issue-6596-2.stderr index 99decd177ef..3e707ba6fff 100644 --- a/src/test/ui/issues/issue-6596-2.stderr +++ b/src/test/ui/issues/issue-6596-2.stderr @@ -7,14 +7,4 @@ LL | { $inp $nonexistent } LL | g!(foo); | -------- in this macro invocation -error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `nonexistent` - --> $DIR/issue-6596-2.rs:5:16 - | -LL | { $inp $nonexistent } - | ^^^^^^^^^^^^ expected one of 8 possible tokens here -... -LL | g!(foo); - | -------- in this macro invocation - -error: aborting due to 2 previous errors - +error: aborting due to previous error diff --git a/src/test/ui/macros/macro-comma-behavior.core.stderr b/src/test/ui/macros/macro-comma-behavior.core.stderr index 7a4b9278e0a..cd752352aef 100644 --- a/src/test/ui/macros/macro-comma-behavior.core.stderr +++ b/src/test/ui/macros/macro-comma-behavior.core.stderr @@ -44,7 +44,4 @@ error: `#[panic_handler]` function required, but not found error: language item required, but not found: `eh_personality` -error: language item required, but not found: `eh_unwind_resume` - -error: aborting due to 10 previous errors - +error: aborting due to 9 previous errors diff --git a/src/test/ui/macros/macro-comma-behavior.rs b/src/test/ui/macros/macro-comma-behavior.rs index 7bd4cb0d2e7..46b93edca3a 100644 --- a/src/test/ui/macros/macro-comma-behavior.rs +++ b/src/test/ui/macros/macro-comma-behavior.rs @@ -3,10 +3,12 @@ // compile-flags: -C debug_assertions=yes // revisions: std core +#![feature(lang_items)] #![cfg_attr(core, no_std)] #[cfg(std)] use std::fmt; #[cfg(core)] use core::fmt; +#[cfg(core)] #[lang = "eh_unwind_resume"] fn eh_unwind_resume() {} // (see documentation of the similarly-named test in run-pass) fn to_format_or_not_to_format() { diff --git a/src/test/ui/macros/macro-comma-behavior.std.stderr b/src/test/ui/macros/macro-comma-behavior.std.stderr index 8759d4efae6..e56ed40e024 100644 --- a/src/test/ui/macros/macro-comma-behavior.std.stderr +++ b/src/test/ui/macros/macro-comma-behavior.std.stderr @@ -59,4 +59,3 @@ LL | write!(f, "{}",)?; | ^^ error: aborting due to 10 previous errors - diff --git a/src/test/ui/panic-runtime/auxiliary/depends.rs b/src/test/ui/panic-runtime/auxiliary/depends.rs deleted file mode 100644 index e9bc2f4893e..00000000000 --- a/src/test/ui/panic-runtime/auxiliary/depends.rs +++ /dev/null @@ -1,8 +0,0 @@ -// no-prefer-dynamic - -#![feature(panic_runtime)] -#![crate_type = "rlib"] -#![panic_runtime] -#![no_std] - -extern crate needs_panic_runtime; diff --git a/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs b/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs deleted file mode 100644 index 3f030c169f6..00000000000 --- a/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs +++ /dev/null @@ -1,6 +0,0 @@ -// no-prefer-dynamic - -#![feature(needs_panic_runtime)] -#![crate_type = "rlib"] -#![needs_panic_runtime] -#![no_std] diff --git a/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs b/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs deleted file mode 100644 index 866c5b2e34b..00000000000 --- a/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs +++ /dev/null @@ -1,7 +0,0 @@ -// aux-build:needs-panic-runtime.rs -// aux-build:depends.rs -// error-pattern:cannot depend on a crate that needs a panic runtime - -extern crate depends; - -fn main() {} diff --git a/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.stderr b/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.stderr deleted file mode 100644 index 27e27dda5ef..00000000000 --- a/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.stderr +++ /dev/null @@ -1,4 +0,0 @@ -error: the crate `depends` cannot depend on a crate that needs a panic runtime, but it depends on `needs_panic_runtime` - -error: aborting due to previous error - -- cgit 1.4.1-3-g733a5 From bc16edeb28e38e5bbed8828fb6314b1cc5151235 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 27 Dec 2018 03:07:00 +0300 Subject: Fix rebase and more CI failures --- .../derive-on-trait-item-or-impl-item.stderr | 3 +- src/test/ui/did_you_mean/issue-40396.stderr | 28 ++++++++--------- .../edition-keywords-2015-2015-parsing.stderr | 5 +-- .../edition-keywords-2015-2018-parsing.stderr | 5 +-- src/test/ui/feature-gates/feature-gate-asm2.stderr | 2 +- .../feature-gate-cfg-target-has-atomic.stderr | 36 +++++++++++----------- .../feature-gate-concat_idents2.stderr | 2 +- .../feature-gates/feature-gate-log_syntax2.stderr | 2 +- .../feature-gates/feature-gate-rustc-attrs.stderr | 2 +- src/test/ui/issues/issue-10536.stderr | 6 ++-- src/test/ui/issues/issue-11692-1.stderr | 2 +- src/test/ui/issues/issue-11692-2.stderr | 2 +- src/test/ui/issues/issue-32950.stderr | 2 +- src/test/ui/issues/issue-49074.stderr | 2 +- src/test/ui/issues/issue-51279.stderr | 2 +- src/test/ui/issues/issue-6596-2.stderr | 1 + src/test/ui/macro_backtrace/main.rs | 1 + .../ui/macros/macro-comma-behavior.core.stderr | 19 +++++------- src/test/ui/macros/macro-comma-behavior.rs | 2 ++ src/test/ui/macros/macro-comma-behavior.std.stderr | 21 +++++++------ src/test/ui/parser/macro/pub-item-macro.stderr | 2 +- src/test/ui/proc-macro/issue-41211.stderr | 2 +- src/test/ui/proc-macro/more-gates.stderr | 10 +++--- src/test/ui/proc-macro/parent-source-spans.stderr | 30 +++++++++--------- .../ui/proc-macro/proc-macro-attributes.stderr | 26 ++++++++-------- src/test/ui/quote-with-interpolated.stderr | 8 ++--- src/test/ui/reserved/reserved-attr-on-macro.stderr | 2 +- src/test/ui/self/self_type_keyword.stderr | 18 +++++------ src/test/ui/span/macro-ty-params.stderr | 11 ++++--- src/test/ui/span/visibility-ty-params.stderr | 4 +-- src/test/ui/trace_macros-gate.stderr | 4 +-- src/test/ui/tuple/tuple-struct-fields/test2.stderr | 2 +- src/test/ui/tuple/tuple-struct-fields/test3.stderr | 2 +- 33 files changed, 136 insertions(+), 130 deletions(-) (limited to 'src/test/ui/issues') diff --git a/src/test/ui/derives/derive-on-trait-item-or-impl-item.stderr b/src/test/ui/derives/derive-on-trait-item-or-impl-item.stderr index 0088add7e7f..b3aa886cd49 100644 --- a/src/test/ui/derives/derive-on-trait-item-or-impl-item.stderr +++ b/src/test/ui/derives/derive-on-trait-item-or-impl-item.stderr @@ -5,9 +5,10 @@ LL | #[derive(Clone)] | ^^^^^^^^^^^^^^^^ error: `derive` may only be applied to structs, enums and unions - --> $DIR/derive-on-trait-item-or-impl-item.rs:8:5 + --> $DIR/derive-on-trait-item-or-impl-item.rs:10:5 | LL | #[derive(Clone)] | ^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors + diff --git a/src/test/ui/did_you_mean/issue-40396.stderr b/src/test/ui/did_you_mean/issue-40396.stderr index 33884bbfecf..3f6886bc3f6 100644 --- a/src/test/ui/did_you_mean/issue-40396.stderr +++ b/src/test/ui/did_you_mean/issue-40396.stderr @@ -1,5 +1,5 @@ error: chained comparison operators require parentheses - --> $DIR/issue-40396.rs:2:37 + --> $DIR/issue-40396.rs:2:20 | LL | (0..13).collect>(); | ^^^^^^^^ @@ -8,7 +8,7 @@ LL | (0..13).collect>(); = help: or use `(...)` if you meant to specify fn arguments error: chained comparison operators require parentheses - --> $DIR/issue-40396.rs:6:25 + --> $DIR/issue-40396.rs:10:8 | LL | Vec::new(); | ^^^^^^^ @@ -17,7 +17,7 @@ LL | Vec::new(); = help: or use `(...)` if you meant to specify fn arguments error: chained comparison operators require parentheses - --> $DIR/issue-40396.rs:10:37 + --> $DIR/issue-40396.rs:18:20 | LL | (0..13).collect(); | ^^^^^^^^ @@ -26,7 +26,7 @@ LL | (0..13).collect(); = help: or use `(...)` if you meant to specify fn arguments error: chained comparison operators require parentheses - --> $DIR/issue-40396.rs:10:41 + --> $DIR/issue-40396.rs:18:24 | LL | (0..13).collect(); | ^^^^^^ @@ -35,49 +35,49 @@ LL | (0..13).collect(); = help: or use `(...)` if you meant to specify fn arguments error[E0423]: expected value, found struct `Vec` - --> $DIR/issue-40396.rs:12:21 + --> $DIR/issue-40396.rs:2:21 | LL | (0..13).collect>(); | ^^^ did you mean `Vec { /* fields */ }`? error[E0423]: expected value, found builtin type `i32` - --> $DIR/issue-40396.rs:12:25 + --> $DIR/issue-40396.rs:2:25 | LL | (0..13).collect>(); | ^^^ not a value error[E0423]: expected value, found struct `Vec` - --> $DIR/issue-40396.rs:20:5 + --> $DIR/issue-40396.rs:10:5 | LL | Vec::new(); | ^^^ did you mean `Vec { /* fields */ }`? error[E0423]: expected value, found builtin type `i32` - --> $DIR/issue-40396.rs:20:9 + --> $DIR/issue-40396.rs:10:9 | LL | Vec::new(); | ^^^ not a value error[E0425]: cannot find function `new` in the crate root - --> $DIR/issue-40396.rs:20:15 + --> $DIR/issue-40396.rs:10:15 | LL | Vec::new(); | ^^^ not found in the crate root error[E0423]: expected value, found struct `Vec` - --> $DIR/issue-40396.rs:28:21 + --> $DIR/issue-40396.rs:18:21 | LL | (0..13).collect(); | ^^^ did you mean `Vec { /* fields */ }`? error[E0423]: expected value, found builtin type `i32` - --> $DIR/issue-40396.rs:28:25 + --> $DIR/issue-40396.rs:18:25 | LL | (0..13).collect(); | ^^^ not a value error[E0615]: attempted to take value of method `collect` on type `std::ops::Range<{integer}>` - --> $DIR/issue-40396.rs:12:13 + --> $DIR/issue-40396.rs:2:13 | LL | (0..13).collect>(); | ^^^^^^^ @@ -85,7 +85,7 @@ LL | (0..13).collect>(); = help: maybe a `()` to call it is missing? error[E0615]: attempted to take value of method `collect` on type `std::ops::Range<{integer}>` - --> $DIR/issue-40396.rs:28:13 + --> $DIR/issue-40396.rs:18:13 | LL | (0..13).collect(); | ^^^^^^^ @@ -93,7 +93,7 @@ LL | (0..13).collect(); = help: maybe a `()` to call it is missing? error[E0308]: mismatched types - --> $DIR/issue-40396.rs:28:29 + --> $DIR/issue-40396.rs:18:29 | LL | (0..13).collect(); | ^^ expected bool, found () diff --git a/src/test/ui/editions/edition-keywords-2015-2015-parsing.stderr b/src/test/ui/editions/edition-keywords-2015-2015-parsing.stderr index 06901ad6ef0..f2a9da71ca5 100644 --- a/src/test/ui/editions/edition-keywords-2015-2015-parsing.stderr +++ b/src/test/ui/editions/edition-keywords-2015-2015-parsing.stderr @@ -1,13 +1,14 @@ error: no rules expected the token `r#async` - --> $DIR/edition-keywords-2015-2015-parsing.rs:12:31 + --> $DIR/edition-keywords-2015-2015-parsing.rs:16:31 | LL | r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async` | ^^^^^^^ no rules expected this token in macro call error: no rules expected the token `async` - --> $DIR/edition-keywords-2015-2015-parsing.rs:13:35 + --> $DIR/edition-keywords-2015-2015-parsing.rs:17:35 | LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async` | ^^^^^ no rules expected this token in macro call error: aborting due to 2 previous errors + diff --git a/src/test/ui/editions/edition-keywords-2015-2018-parsing.stderr b/src/test/ui/editions/edition-keywords-2015-2018-parsing.stderr index 98fa2493940..fbb3b8bc756 100644 --- a/src/test/ui/editions/edition-keywords-2015-2018-parsing.stderr +++ b/src/test/ui/editions/edition-keywords-2015-2018-parsing.stderr @@ -1,13 +1,14 @@ error: no rules expected the token `r#async` - --> $DIR/edition-keywords-2015-2018-parsing.rs:12:31 + --> $DIR/edition-keywords-2015-2018-parsing.rs:16:31 | LL | r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async` | ^^^^^^^ no rules expected this token in macro call error: no rules expected the token `async` - --> $DIR/edition-keywords-2015-2018-parsing.rs:13:35 + --> $DIR/edition-keywords-2015-2018-parsing.rs:17:35 | LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async` | ^^^^^ no rules expected this token in macro call error: aborting due to 2 previous errors + diff --git a/src/test/ui/feature-gates/feature-gate-asm2.stderr b/src/test/ui/feature-gates/feature-gate-asm2.stderr index 65c267a7695..fc4aa57718c 100644 --- a/src/test/ui/feature-gates/feature-gate-asm2.stderr +++ b/src/test/ui/feature-gates/feature-gate-asm2.stderr @@ -1,5 +1,5 @@ error[E0658]: inline assembly is not stable enough for use and is subject to change (see issue #29722) - --> $DIR/feature-gate-asm2.rs:5:24 + --> $DIR/feature-gate-asm2.rs:5:26 | LL | println!("{:?}", asm!("")); //~ ERROR inline assembly is not stable | ^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr index e096f3a1def..a2d5669bcdc 100644 --- a/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr +++ b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr @@ -1,5 +1,5 @@ error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:13:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:15:7 | LL | #[cfg(target_has_atomic = "8")] | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | #[cfg(target_has_atomic = "8")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:19:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:21:7 | LL | #[cfg(target_has_atomic = "8")] | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -15,7 +15,7 @@ LL | #[cfg(target_has_atomic = "8")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:24:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:26:7 | LL | #[cfg(target_has_atomic = "16")] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | #[cfg(target_has_atomic = "16")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:29:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:31:7 | LL | #[cfg(target_has_atomic = "16")] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -31,7 +31,7 @@ LL | #[cfg(target_has_atomic = "16")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:34:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:36:7 | LL | #[cfg(target_has_atomic = "32")] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -39,7 +39,7 @@ LL | #[cfg(target_has_atomic = "32")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:39:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:41:7 | LL | #[cfg(target_has_atomic = "32")] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -47,7 +47,7 @@ LL | #[cfg(target_has_atomic = "32")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:44:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:46:7 | LL | #[cfg(target_has_atomic = "64")] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -55,7 +55,7 @@ LL | #[cfg(target_has_atomic = "64")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:49:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:51:7 | LL | #[cfg(target_has_atomic = "64")] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -63,7 +63,7 @@ LL | #[cfg(target_has_atomic = "64")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:54:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:56:7 | LL | #[cfg(target_has_atomic = "128")] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -71,7 +71,7 @@ LL | #[cfg(target_has_atomic = "128")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:59:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:61:7 | LL | #[cfg(target_has_atomic = "128")] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -79,7 +79,7 @@ LL | #[cfg(target_has_atomic = "128")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:64:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:66:7 | LL | #[cfg(target_has_atomic = "ptr")] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -87,7 +87,7 @@ LL | #[cfg(target_has_atomic = "ptr")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:69:7 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:71:7 | LL | #[cfg(target_has_atomic = "ptr")] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -95,7 +95,7 @@ LL | #[cfg(target_has_atomic = "ptr")] = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:76:10 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:78:10 | LL | cfg!(target_has_atomic = "8"); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -103,7 +103,7 @@ LL | cfg!(target_has_atomic = "8"); = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:78:10 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:80:10 | LL | cfg!(target_has_atomic = "16"); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -111,7 +111,7 @@ LL | cfg!(target_has_atomic = "16"); = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:80:10 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:82:10 | LL | cfg!(target_has_atomic = "32"); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -119,7 +119,7 @@ LL | cfg!(target_has_atomic = "32"); = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:82:10 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:84:10 | LL | cfg!(target_has_atomic = "64"); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -127,7 +127,7 @@ LL | cfg!(target_has_atomic = "64"); = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:84:10 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:86:10 | LL | cfg!(target_has_atomic = "128"); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -135,7 +135,7 @@ LL | cfg!(target_has_atomic = "128"); = help: add #![feature(cfg_target_has_atomic)] to the crate attributes to enable error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) - --> $DIR/feature-gate-cfg-target-has-atomic.rs:86:10 + --> $DIR/feature-gate-cfg-target-has-atomic.rs:88:10 | LL | cfg!(target_has_atomic = "ptr"); | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr b/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr index eb648cbd56f..cae409019f7 100644 --- a/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr +++ b/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr @@ -7,7 +7,7 @@ LL | concat_idents!(a, b); //~ ERROR `concat_idents` is not stable enough = help: add #![feature(concat_idents)] to the crate attributes to enable error[E0425]: cannot find value `ab` in this scope - --> $DIR/feature-gate-concat_idents2.rs:14:5 + --> $DIR/feature-gate-concat_idents2.rs:4:5 | LL | concat_idents!(a, b); //~ ERROR `concat_idents` is not stable enough | ^^^^^^^^^^^^^^^^^^^^^ not found in this scope diff --git a/src/test/ui/feature-gates/feature-gate-log_syntax2.stderr b/src/test/ui/feature-gates/feature-gate-log_syntax2.stderr index 9ed3bbf7b75..bdcd922c6e1 100644 --- a/src/test/ui/feature-gates/feature-gate-log_syntax2.stderr +++ b/src/test/ui/feature-gates/feature-gate-log_syntax2.stderr @@ -1,5 +1,5 @@ error[E0658]: `log_syntax!` is not stable enough for use and is subject to change (see issue #29598) - --> $DIR/feature-gate-log_syntax2.rs:4:20 + --> $DIR/feature-gate-log_syntax2.rs:4:22 | LL | println!("{:?}", log_syntax!()); //~ ERROR `log_syntax!` is not stable | ^^^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr b/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr index 1d742c2fa9e..40e6d6d9256 100644 --- a/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr +++ b/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr @@ -1,5 +1,5 @@ error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics (see issue #29642) - --> $DIR/feature-gate-rustc-attrs.rs:5:3 + --> $DIR/feature-gate-rustc-attrs.rs:3:3 | LL | #[rustc_foo] | ^^^^^^^^^ diff --git a/src/test/ui/issues/issue-10536.stderr b/src/test/ui/issues/issue-10536.stderr index 0b6c357b920..d5caf777cd4 100644 --- a/src/test/ui/issues/issue-10536.stderr +++ b/src/test/ui/issues/issue-10536.stderr @@ -1,5 +1,5 @@ error: macros that expand to items must either be surrounded with braces or followed by a semicolon - --> $DIR/issue-10536.rs:16:22 + --> $DIR/issue-10536.rs:14:22 | LL | assert!({one! two()}); | ^^ @@ -11,13 +11,13 @@ LL | assert!({one! two}); | ^ expected `(` or `{` error: cannot find macro `one!` in this scope - --> $DIR/issue-10536.rs:24:14 + --> $DIR/issue-10536.rs:14:14 | LL | assert!({one! two()}); | ^^^ error[E0308]: mismatched types - --> $DIR/issue-10536.rs:24:13 + --> $DIR/issue-10536.rs:14:13 | LL | assert!({one! two()}); | ^^^^^^^^^^^^ expected bool, found () diff --git a/src/test/ui/issues/issue-11692-1.stderr b/src/test/ui/issues/issue-11692-1.stderr index e0c4642ea60..f4cc825803a 100644 --- a/src/test/ui/issues/issue-11692-1.stderr +++ b/src/test/ui/issues/issue-11692-1.stderr @@ -9,7 +9,7 @@ LL | print!("{}", testo!()); | ^^^^^ error: cannot find macro `testo!` in this scope - --> $DIR/issue-11692-1.rs:12:12 + --> $DIR/issue-11692-1.rs:2:12 | LL | print!(testo!()); | ^^^^^ diff --git a/src/test/ui/issues/issue-11692-2.stderr b/src/test/ui/issues/issue-11692-2.stderr index 16cf7b0dca7..848415435a7 100644 --- a/src/test/ui/issues/issue-11692-2.stderr +++ b/src/test/ui/issues/issue-11692-2.stderr @@ -1,5 +1,5 @@ error: expected a literal - --> $DIR/issue-11692-2.rs:12:13 + --> $DIR/issue-11692-2.rs:2:13 | LL | concat!(test!()); //~ ERROR cannot find macro `test!` in this scope | ^^^^^^^ diff --git a/src/test/ui/issues/issue-32950.stderr b/src/test/ui/issues/issue-32950.stderr index af148cbb5c6..13aed4a1756 100644 --- a/src/test/ui/issues/issue-32950.stderr +++ b/src/test/ui/issues/issue-32950.stderr @@ -5,7 +5,7 @@ LL | concat_idents!(Foo, Bar) //~ ERROR `derive` cannot be used on items wit | ^^^^^^^^^^^^^^^^^^^^^^^^ error[E0412]: cannot find type `FooBar` in this scope - --> $DIR/issue-32950.rs:15:5 + --> $DIR/issue-32950.rs:5:5 | LL | concat_idents!(Foo, Bar) //~ ERROR `derive` cannot be used on items with type macros | ^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope diff --git a/src/test/ui/issues/issue-49074.stderr b/src/test/ui/issues/issue-49074.stderr index 6b5e979082e..d4648270f2d 100644 --- a/src/test/ui/issues/issue-49074.stderr +++ b/src/test/ui/issues/issue-49074.stderr @@ -7,7 +7,7 @@ LL | #[marco_use] // typo = help: add #![feature(custom_attribute)] to the crate attributes to enable error: cannot find macro `bar!` in this scope - --> $DIR/issue-49074.rs:22:4 + --> $DIR/issue-49074.rs:12:4 | LL | bar!(); //~ ERROR cannot find macro `bar!` in this scope | ^^^ diff --git a/src/test/ui/issues/issue-51279.stderr b/src/test/ui/issues/issue-51279.stderr index 33afac39865..1706e98e83b 100644 --- a/src/test/ui/issues/issue-51279.stderr +++ b/src/test/ui/issues/issue-51279.stderr @@ -47,7 +47,7 @@ LL | type Z<#[ignored] 'a, #[cfg(none)] T> = X<'a, T>; | ^^^^^^^^^^^^ error[E0658]: The attribute `ignored` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) - --> $DIR/issue-51279.rs:33:8 + --> $DIR/issue-51279.rs:23:8 | LL | type Z<#[ignored] 'a, #[cfg(none)] T> = X<'a, T>; | ^^^^^^^^^^ diff --git a/src/test/ui/issues/issue-6596-2.stderr b/src/test/ui/issues/issue-6596-2.stderr index 3e707ba6fff..20fbe0fab01 100644 --- a/src/test/ui/issues/issue-6596-2.stderr +++ b/src/test/ui/issues/issue-6596-2.stderr @@ -8,3 +8,4 @@ LL | g!(foo); | -------- in this macro invocation error: aborting due to previous error + diff --git a/src/test/ui/macro_backtrace/main.rs b/src/test/ui/macro_backtrace/main.rs index 2c11ce56f8b..8fcd497f87b 100644 --- a/src/test/ui/macro_backtrace/main.rs +++ b/src/test/ui/macro_backtrace/main.rs @@ -12,6 +12,7 @@ macro_rules! pong { //~| ERROR expected one of //~| ERROR expected one of +#[allow(non_camel_case_types)] struct syntax; fn main() { diff --git a/src/test/ui/macros/macro-comma-behavior.core.stderr b/src/test/ui/macros/macro-comma-behavior.core.stderr index cd752352aef..dd0cac659fd 100644 --- a/src/test/ui/macros/macro-comma-behavior.core.stderr +++ b/src/test/ui/macros/macro-comma-behavior.core.stderr @@ -1,47 +1,44 @@ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:17:23 + --> $DIR/macro-comma-behavior.rs:21:23 | LL | assert_eq!(1, 1, "{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:20:23 + --> $DIR/macro-comma-behavior.rs:24:23 | LL | assert_ne!(1, 2, "{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:26:29 + --> $DIR/macro-comma-behavior.rs:30:29 | LL | debug_assert_eq!(1, 1, "{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:29:29 + --> $DIR/macro-comma-behavior.rs:33:29 | LL | debug_assert_ne!(1, 2, "{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:50:19 + --> $DIR/macro-comma-behavior.rs:54:19 | LL | format_args!("{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:68:21 + --> $DIR/macro-comma-behavior.rs:72:21 | LL | unimplemented!("{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:77:24 + --> $DIR/macro-comma-behavior.rs:81:24 | LL | write!(f, "{}",)?; | ^^ -error: `#[panic_handler]` function required, but not found +error: aborting due to 7 previous errors -error: language item required, but not found: `eh_personality` - -error: aborting due to 9 previous errors diff --git a/src/test/ui/macros/macro-comma-behavior.rs b/src/test/ui/macros/macro-comma-behavior.rs index 46b93edca3a..006319aa9f5 100644 --- a/src/test/ui/macros/macro-comma-behavior.rs +++ b/src/test/ui/macros/macro-comma-behavior.rs @@ -8,7 +8,9 @@ #[cfg(std)] use std::fmt; #[cfg(core)] use core::fmt; +#[cfg(core)] #[lang = "eh_personality"] fn eh_personality() {} #[cfg(core)] #[lang = "eh_unwind_resume"] fn eh_unwind_resume() {} +#[cfg(core)] #[lang = "panic_impl"] fn panic_impl(panic: &core::panic::PanicInfo) -> ! { loop {} } // (see documentation of the similarly-named test in run-pass) fn to_format_or_not_to_format() { diff --git a/src/test/ui/macros/macro-comma-behavior.std.stderr b/src/test/ui/macros/macro-comma-behavior.std.stderr index e56ed40e024..4372d89fbf5 100644 --- a/src/test/ui/macros/macro-comma-behavior.std.stderr +++ b/src/test/ui/macros/macro-comma-behavior.std.stderr @@ -1,61 +1,62 @@ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:17:23 + --> $DIR/macro-comma-behavior.rs:21:23 | LL | assert_eq!(1, 1, "{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:20:23 + --> $DIR/macro-comma-behavior.rs:24:23 | LL | assert_ne!(1, 2, "{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:26:29 + --> $DIR/macro-comma-behavior.rs:30:29 | LL | debug_assert_eq!(1, 1, "{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:29:29 + --> $DIR/macro-comma-behavior.rs:33:29 | LL | debug_assert_ne!(1, 2, "{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:34:18 + --> $DIR/macro-comma-behavior.rs:38:18 | LL | eprint!("{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:46:18 + --> $DIR/macro-comma-behavior.rs:50:18 | LL | format!("{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:50:19 + --> $DIR/macro-comma-behavior.rs:54:19 | LL | format_args!("{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:57:17 + --> $DIR/macro-comma-behavior.rs:61:17 | LL | print!("{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:68:21 + --> $DIR/macro-comma-behavior.rs:72:21 | LL | unimplemented!("{}",); | ^^ error: 1 positional argument in format string, but no arguments were given - --> $DIR/macro-comma-behavior.rs:77:24 + --> $DIR/macro-comma-behavior.rs:81:24 | LL | write!(f, "{}",)?; | ^^ error: aborting due to 10 previous errors + diff --git a/src/test/ui/parser/macro/pub-item-macro.stderr b/src/test/ui/parser/macro/pub-item-macro.stderr index fb7a1fce549..a624d574c45 100644 --- a/src/test/ui/parser/macro/pub-item-macro.stderr +++ b/src/test/ui/parser/macro/pub-item-macro.stderr @@ -10,7 +10,7 @@ LL | pub_x!(); = help: try adjusting the macro to put `pub` inside the invocation error[E0603]: static `x` is private - --> $DIR/pub-item-macro.rs:27:23 + --> $DIR/pub-item-macro.rs:17:23 | LL | let y: u32 = foo::x; //~ ERROR static `x` is private | ^ diff --git a/src/test/ui/proc-macro/issue-41211.stderr b/src/test/ui/proc-macro/issue-41211.stderr index 2c702c7871d..f75481e4829 100644 --- a/src/test/ui/proc-macro/issue-41211.stderr +++ b/src/test/ui/proc-macro/issue-41211.stderr @@ -7,7 +7,7 @@ LL | #![emit_unchanged] = help: add #![feature(custom_attribute)] to the crate attributes to enable error: inconsistent resolution for a macro: first custom attribute, then attribute macro - --> $DIR/issue-41211.rs:18:4 + --> $DIR/issue-41211.rs:8:4 | LL | #![emit_unchanged] | ^^^^^^^^^^^^^^ diff --git a/src/test/ui/proc-macro/more-gates.stderr b/src/test/ui/proc-macro/more-gates.stderr index b17b0bcb110..21e75027e48 100644 --- a/src/test/ui/proc-macro/more-gates.stderr +++ b/src/test/ui/proc-macro/more-gates.stderr @@ -1,5 +1,5 @@ error[E0658]: procedural macros cannot expand to macro definitions (see issue #54727) - --> $DIR/more-gates.rs:7:1 + --> $DIR/more-gates.rs:9:1 | LL | #[attr2mac1] | ^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | #[attr2mac1] = help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable error[E0658]: procedural macros cannot expand to macro definitions (see issue #54727) - --> $DIR/more-gates.rs:10:1 + --> $DIR/more-gates.rs:12:1 | LL | #[attr2mac2] | ^^^^^^^^^^^^ @@ -15,7 +15,7 @@ LL | #[attr2mac2] = help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable error[E0658]: procedural macros cannot expand to macro definitions (see issue #54727) - --> $DIR/more-gates.rs:14:1 + --> $DIR/more-gates.rs:16:1 | LL | mac2mac1!(); //~ ERROR: cannot expand to macro definitions | ^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | mac2mac1!(); //~ ERROR: cannot expand to macro definitions = help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable error[E0658]: procedural macros cannot expand to macro definitions (see issue #54727) - --> $DIR/more-gates.rs:15:1 + --> $DIR/more-gates.rs:17:1 | LL | mac2mac2!(); //~ ERROR: cannot expand to macro definitions | ^^^^^^^^^^^^ @@ -31,7 +31,7 @@ LL | mac2mac2!(); //~ ERROR: cannot expand to macro definitions = help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable error[E0658]: procedural macros cannot expand to macro definitions (see issue #54727) - --> $DIR/more-gates.rs:17:1 + --> $DIR/more-gates.rs:19:1 | LL | tricky!(); | ^^^^^^^^^^ diff --git a/src/test/ui/proc-macro/parent-source-spans.stderr b/src/test/ui/proc-macro/parent-source-spans.stderr index 2d9ebff88cb..a8ee325b41d 100644 --- a/src/test/ui/proc-macro/parent-source-spans.stderr +++ b/src/test/ui/proc-macro/parent-source-spans.stderr @@ -35,25 +35,25 @@ LL | one!("hello", "world"); | ----------------------- in this macro invocation error: first grandparent: "hello" - --> $DIR/parent-source-spans.rs:34:5 + --> $DIR/parent-source-spans.rs:37:5 | LL | one!("hello", "world"); | ^^^^^^^^^^^^^^^^^^^^^^^ error: second grandparent: "world" - --> $DIR/parent-source-spans.rs:34:5 + --> $DIR/parent-source-spans.rs:37:5 | LL | one!("hello", "world"); | ^^^^^^^^^^^^^^^^^^^^^^^ error: first source: "hello" - --> $DIR/parent-source-spans.rs:34:5 + --> $DIR/parent-source-spans.rs:37:5 | LL | one!("hello", "world"); | ^^^^^^^^^^^^^^^^^^^^^^^ error: second source: "world" - --> $DIR/parent-source-spans.rs:34:5 + --> $DIR/parent-source-spans.rs:37:5 | LL | one!("hello", "world"); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -77,55 +77,55 @@ LL | two!("yay", "rust"); | -------------------- in this macro invocation error: first parent: "yay" - --> $DIR/parent-source-spans.rs:40:5 + --> $DIR/parent-source-spans.rs:43:5 | LL | two!("yay", "rust"); | ^^^^^^^^^^^^^^^^^^^^ error: second parent: "rust" - --> $DIR/parent-source-spans.rs:40:5 + --> $DIR/parent-source-spans.rs:43:5 | LL | two!("yay", "rust"); | ^^^^^^^^^^^^^^^^^^^^ error: first source: "yay" - --> $DIR/parent-source-spans.rs:40:5 + --> $DIR/parent-source-spans.rs:43:5 | LL | two!("yay", "rust"); | ^^^^^^^^^^^^^^^^^^^^ error: second source: "rust" - --> $DIR/parent-source-spans.rs:40:5 + --> $DIR/parent-source-spans.rs:43:5 | LL | two!("yay", "rust"); | ^^^^^^^^^^^^^^^^^^^^ error: first final: "hip" - --> $DIR/parent-source-spans.rs:46:12 + --> $DIR/parent-source-spans.rs:49:12 | LL | three!("hip", "hop"); | ^^^^^ error: second final: "hop" - --> $DIR/parent-source-spans.rs:46:19 + --> $DIR/parent-source-spans.rs:49:19 | LL | three!("hip", "hop"); | ^^^^^ error: first source: "hip" - --> $DIR/parent-source-spans.rs:46:12 + --> $DIR/parent-source-spans.rs:49:12 | LL | three!("hip", "hop"); | ^^^^^ error: second source: "hop" - --> $DIR/parent-source-spans.rs:46:19 + --> $DIR/parent-source-spans.rs:49:19 | LL | three!("hip", "hop"); | ^^^^^ error[E0425]: cannot find value `ok` in this scope - --> $DIR/parent-source-spans.rs:40:5 + --> $DIR/parent-source-spans.rs:30:5 | LL | parent_source_spans!($($tokens)*); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Ok`? @@ -134,7 +134,7 @@ LL | one!("hello", "world"); | ----------------------- in this macro invocation error[E0425]: cannot find value `ok` in this scope - --> $DIR/parent-source-spans.rs:40:5 + --> $DIR/parent-source-spans.rs:30:5 | LL | parent_source_spans!($($tokens)*); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Ok`? @@ -143,7 +143,7 @@ LL | two!("yay", "rust"); | -------------------- in this macro invocation error[E0425]: cannot find value `ok` in this scope - --> $DIR/parent-source-spans.rs:40:5 + --> $DIR/parent-source-spans.rs:30:5 | LL | parent_source_spans!($($tokens)*); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Ok`? diff --git a/src/test/ui/proc-macro/proc-macro-attributes.stderr b/src/test/ui/proc-macro/proc-macro-attributes.stderr index 8b87e482282..7ac44c9354d 100644 --- a/src/test/ui/proc-macro/proc-macro-attributes.stderr +++ b/src/test/ui/proc-macro/proc-macro-attributes.stderr @@ -7,75 +7,75 @@ LL | #[C] //~ ERROR attribute `C` is currently unknown to the compiler = help: add #![feature(custom_attribute)] to the crate attributes to enable error[E0659]: `B` is ambiguous (derive helper attribute vs any other name) - --> $DIR/proc-macro-attributes.rs:16:3 + --> $DIR/proc-macro-attributes.rs:6:3 | LL | #[B] //~ ERROR `B` is ambiguous | ^ ambiguous name | note: `B` could refer to the derive helper attribute defined here - --> $DIR/proc-macro-attributes.rs:22:10 + --> $DIR/proc-macro-attributes.rs:12:10 | LL | #[derive(B)] | ^ note: `B` could also refer to the derive macro imported here - --> $DIR/proc-macro-attributes.rs:13:1 + --> $DIR/proc-macro-attributes.rs:3:1 | LL | #[macro_use] | ^^^^^^^^^^^^ error[E0659]: `B` is ambiguous (derive helper attribute vs any other name) - --> $DIR/proc-macro-attributes.rs:18:3 + --> $DIR/proc-macro-attributes.rs:8:3 | LL | #[B(D)] //~ ERROR `B` is ambiguous | ^ ambiguous name | note: `B` could refer to the derive helper attribute defined here - --> $DIR/proc-macro-attributes.rs:22:10 + --> $DIR/proc-macro-attributes.rs:12:10 | LL | #[derive(B)] | ^ note: `B` could also refer to the derive macro imported here - --> $DIR/proc-macro-attributes.rs:13:1 + --> $DIR/proc-macro-attributes.rs:3:1 | LL | #[macro_use] | ^^^^^^^^^^^^ error[E0659]: `B` is ambiguous (derive helper attribute vs any other name) - --> $DIR/proc-macro-attributes.rs:19:3 + --> $DIR/proc-macro-attributes.rs:9:3 | LL | #[B(E = "foo")] //~ ERROR `B` is ambiguous | ^ ambiguous name | note: `B` could refer to the derive helper attribute defined here - --> $DIR/proc-macro-attributes.rs:22:10 + --> $DIR/proc-macro-attributes.rs:12:10 | LL | #[derive(B)] | ^ note: `B` could also refer to the derive macro imported here - --> $DIR/proc-macro-attributes.rs:13:1 + --> $DIR/proc-macro-attributes.rs:3:1 | LL | #[macro_use] | ^^^^^^^^^^^^ error[E0659]: `B` is ambiguous (derive helper attribute vs any other name) - --> $DIR/proc-macro-attributes.rs:20:3 + --> $DIR/proc-macro-attributes.rs:10:3 | LL | #[B(arbitrary tokens)] //~ ERROR `B` is ambiguous | ^ ambiguous name | note: `B` could refer to the derive helper attribute defined here - --> $DIR/proc-macro-attributes.rs:22:10 + --> $DIR/proc-macro-attributes.rs:12:10 | LL | #[derive(B)] | ^ note: `B` could also refer to the derive macro imported here - --> $DIR/proc-macro-attributes.rs:13:1 + --> $DIR/proc-macro-attributes.rs:3:1 | LL | #[macro_use] | ^^^^^^^^^^^^ error: expected one of `(`, `)`, `,`, `::`, or `=`, found `tokens` - --> $DIR/proc-macro-attributes.rs:20:15 + --> $DIR/proc-macro-attributes.rs:10:15 | LL | #[B(arbitrary tokens)] //~ ERROR `B` is ambiguous | ^^^^^^ expected one of `(`, `)`, `,`, `::`, or `=` here diff --git a/src/test/ui/quote-with-interpolated.stderr b/src/test/ui/quote-with-interpolated.stderr index 3c582286662..96feff949bf 100644 --- a/src/test/ui/quote-with-interpolated.stderr +++ b/src/test/ui/quote-with-interpolated.stderr @@ -8,19 +8,19 @@ LL | foo!(bar); | ---------- in this macro invocation error[E0433]: failed to resolve: maybe a missing `extern crate syntax;`? - --> $DIR/quote-with-interpolated.rs:15:13 + --> $DIR/quote-with-interpolated.rs:5:13 | LL | quote_expr!(cx, $bar) | ^^^^^^^^^^^^^^^^^^^^^ maybe a missing `extern crate syntax;`? error[E0433]: failed to resolve: maybe a missing `extern crate syntax;`? - --> $DIR/quote-with-interpolated.rs:15:29 + --> $DIR/quote-with-interpolated.rs:5:29 | LL | quote_expr!(cx, $bar) | ^^^^ maybe a missing `extern crate syntax;`? error[E0425]: cannot find value `cx` in this scope - --> $DIR/quote-with-interpolated.rs:15:25 + --> $DIR/quote-with-interpolated.rs:5:25 | LL | quote_expr!(cx, $bar) | ^^ not found in this scope @@ -29,7 +29,7 @@ LL | foo!(bar); | ---------- in this macro invocation error[E0425]: cannot find function `new_parser_from_tts` in this scope - --> $DIR/quote-with-interpolated.rs:15:13 + --> $DIR/quote-with-interpolated.rs:5:13 | LL | quote_expr!(cx, $bar) | ^^^^^^^^^^^^^^^^^^^^^ not found in this scope diff --git a/src/test/ui/reserved/reserved-attr-on-macro.stderr b/src/test/ui/reserved/reserved-attr-on-macro.stderr index 4f1c0e1aa70..46d3478b628 100644 --- a/src/test/ui/reserved/reserved-attr-on-macro.stderr +++ b/src/test/ui/reserved/reserved-attr-on-macro.stderr @@ -7,7 +7,7 @@ LL | #[rustc_attribute_should_be_reserved] = help: add #![feature(rustc_attrs)] to the crate attributes to enable error: cannot determine resolution for the macro `foo` - --> $DIR/reserved-attr-on-macro.rs:18:5 + --> $DIR/reserved-attr-on-macro.rs:8:5 | LL | foo!(); //~ ERROR cannot determine resolution for the macro `foo` | ^^^ diff --git a/src/test/ui/self/self_type_keyword.stderr b/src/test/ui/self/self_type_keyword.stderr index 1981e23c88a..f75377a220b 100644 --- a/src/test/ui/self/self_type_keyword.stderr +++ b/src/test/ui/self/self_type_keyword.stderr @@ -5,43 +5,43 @@ LL | struct Self; | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:15:13 + --> $DIR/self_type_keyword.rs:16:13 | LL | ref Self => (), | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:17:13 + --> $DIR/self_type_keyword.rs:18:13 | LL | mut Self => (), | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:19:17 + --> $DIR/self_type_keyword.rs:20:17 | LL | ref mut Self => (), | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:23:15 + --> $DIR/self_type_keyword.rs:24:15 | LL | Foo { Self } => (), | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:29:26 + --> $DIR/self_type_keyword.rs:30:26 | LL | extern crate core as Self; | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:34:32 + --> $DIR/self_type_keyword.rs:35:32 | LL | use std::option::Option as Self; | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `Self` - --> $DIR/self_type_keyword.rs:39:11 + --> $DIR/self_type_keyword.rs:40:11 | LL | trait Self {} | ^^^^ expected identifier, found keyword @@ -53,13 +53,13 @@ LL | struct Bar<'Self>; | ^^^^^ error: cannot find macro `Self!` in this scope - --> $DIR/self_type_keyword.rs:21:9 + --> $DIR/self_type_keyword.rs:22:9 | LL | Self!() => (), | ^^^^ error[E0392]: parameter `'Self` is never used - --> $DIR/self_type_keyword.rs:18:12 + --> $DIR/self_type_keyword.rs:8:12 | LL | struct Bar<'Self>; | ^^^^^ unused type parameter diff --git a/src/test/ui/span/macro-ty-params.stderr b/src/test/ui/span/macro-ty-params.stderr index c1dcc513f3a..23fdde06e8f 100644 --- a/src/test/ui/span/macro-ty-params.stderr +++ b/src/test/ui/span/macro-ty-params.stderr @@ -1,25 +1,26 @@ -error: unexpected generic arguments in path +error: generic arguments in macro path --> $DIR/macro-ty-params.rs:10:8 | LL | foo::!(); //~ ERROR generic arguments in macro path | ^^^^^ error: generic arguments in macro path - --> $DIR/macro-ty-params.rs:10:15 + --> $DIR/macro-ty-params.rs:11:8 | LL | foo::<>!(); //~ ERROR generic arguments in macro path | ^^^^ -error: generic arguments in macro path - --> $DIR/macro-ty-params.rs:8:8 +error: unexpected generic arguments in path + --> $DIR/macro-ty-params.rs:12:8 | LL | m!(Default<>); //~ ERROR generic arguments in macro path | ^^^^^^^^^ error: generic arguments in macro path - --> $DIR/macro-ty-params.rs:9:8 + --> $DIR/macro-ty-params.rs:12:15 | LL | m!(Default<>); //~ ERROR generic arguments in macro path | ^^ error: aborting due to 4 previous errors + diff --git a/src/test/ui/span/visibility-ty-params.stderr b/src/test/ui/span/visibility-ty-params.stderr index 9a11eea6532..1fb54df1570 100644 --- a/src/test/ui/span/visibility-ty-params.stderr +++ b/src/test/ui/span/visibility-ty-params.stderr @@ -5,13 +5,13 @@ LL | m!{ S } //~ ERROR unexpected generic arguments in path | ^^^^^ error: unexpected generic arguments in path - --> $DIR/visibility-ty-params.rs:9:9 + --> $DIR/visibility-ty-params.rs:10:9 | LL | m!{ m<> } //~ ERROR unexpected generic arguments in path | ^^^ error[E0577]: expected module, found struct `S` - --> $DIR/visibility-ty-params.rs:16:5 + --> $DIR/visibility-ty-params.rs:6:5 | LL | m!{ S } //~ ERROR unexpected generic arguments in path | -^^^^ diff --git a/src/test/ui/trace_macros-gate.stderr b/src/test/ui/trace_macros-gate.stderr index a411fae8bcb..4831aa158db 100644 --- a/src/test/ui/trace_macros-gate.stderr +++ b/src/test/ui/trace_macros-gate.stderr @@ -7,7 +7,7 @@ LL | trace_macros!(); //~ ERROR `trace_macros` is not stable = help: add #![feature(trace_macros)] to the crate attributes to enable error: trace_macros! accepts only `true` or `false` - --> $DIR/trace_macros-gate.rs:14:5 + --> $DIR/trace_macros-gate.rs:4:5 | LL | trace_macros!(); //~ ERROR `trace_macros` is not stable | ^^^^^^^^^^^^^^^^ @@ -29,7 +29,7 @@ LL | trace_macros!(false); //~ ERROR `trace_macros` is not stable = help: add #![feature(trace_macros)] to the crate attributes to enable error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598) - --> $DIR/trace_macros-gate.rs:20:26 + --> $DIR/trace_macros-gate.rs:10:26 | LL | ($x: ident) => { trace_macros!($x) } //~ ERROR `trace_macros` is not stable | ^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/tuple/tuple-struct-fields/test2.stderr b/src/test/ui/tuple/tuple-struct-fields/test2.stderr index baca625b0bd..80f0ddc0e4f 100644 --- a/src/test/ui/tuple/tuple-struct-fields/test2.stderr +++ b/src/test/ui/tuple/tuple-struct-fields/test2.stderr @@ -8,7 +8,7 @@ LL | define_struct! { (foo) } //~ ERROR cannot find type `foo` in this scope | ------------------------ in this macro invocation error[E0412]: cannot find type `foo` in this scope - --> $DIR/test2.rs:21:23 + --> $DIR/test2.rs:11:23 | LL | define_struct! { (foo) } //~ ERROR cannot find type `foo` in this scope | ^^^ not found in this scope diff --git a/src/test/ui/tuple/tuple-struct-fields/test3.stderr b/src/test/ui/tuple/tuple-struct-fields/test3.stderr index 2da34fff53d..fbc01744fe4 100644 --- a/src/test/ui/tuple/tuple-struct-fields/test3.stderr +++ b/src/test/ui/tuple/tuple-struct-fields/test3.stderr @@ -8,7 +8,7 @@ LL | define_struct! { foo } //~ ERROR cannot find type `foo` in this scope | ---------------------- in this macro invocation error[E0412]: cannot find type `foo` in this scope - --> $DIR/test3.rs:21:22 + --> $DIR/test3.rs:11:22 | LL | define_struct! { foo } //~ ERROR cannot find type `foo` in this scope | ^^^ not found in this scope -- cgit 1.4.1-3-g733a5