diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-12-16 20:23:27 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-12-27 15:51:36 +0300 |
| commit | fff01ccfa805ccef67827bf1ea84e21d61d13e6f (patch) | |
| tree | 9ef9748b8f3257c362077a8b3a6c421ae851d020 /src/test | |
| parent | a5c52c72ae3c1d8b3896756541b115a1d5ea94b7 (diff) | |
| download | rust-fff01ccfa805ccef67827bf1ea84e21d61d13e6f.tar.gz rust-fff01ccfa805ccef67827bf1ea84e21d61d13e6f.zip | |
Do not abort compilation if expansion produces errors
Fix a number of uncovered deficiencies in diagnostics
Diffstat (limited to 'src/test')
71 files changed, 488 insertions, 87 deletions
diff --git a/src/test/ui/conditional-compilation/cfg-attr-invalid-predicate.rs b/src/test/ui/conditional-compilation/cfg-attr-invalid-predicate.rs index 9d8842eee81..496d196c94a 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-invalid-predicate.rs +++ b/src/test/ui/conditional-compilation/cfg-attr-invalid-predicate.rs @@ -1,2 +1,4 @@ #[cfg(foo(bar))] //~ ERROR invalid predicate `foo` +fn check() {} + fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs index 83e162e0871..c7e1b4435e4 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs +++ b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs @@ -33,3 +33,5 @@ macro_rules! generate_s10 { } generate_s10!(concat!("nonexistent")); + +fn main() {} diff --git a/src/test/ui/cross/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs b/src/test/ui/cross/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs index 7c9ecb5d621..fbda3dbe948 100644 --- a/src/test/ui/cross/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs +++ b/src/test/ui/cross/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs @@ -4,7 +4,7 @@ pub fn print(_args: std::fmt::Arguments) {} #[macro_export] macro_rules! myprint { - ($($arg:tt)*) => (print(format_args!($($arg)*))); + ($($arg:tt)*) => ($crate::print(format_args!($($arg)*))); } #[macro_export] diff --git a/src/test/ui/derives/derive-on-trait-item-or-impl-item.rs b/src/test/ui/derives/derive-on-trait-item-or-impl-item.rs index 2530e75111b..b847000a81d 100644 --- a/src/test/ui/derives/derive-on-trait-item-or-impl-item.rs +++ b/src/test/ui/derives/derive-on-trait-item-or-impl-item.rs @@ -4,6 +4,8 @@ trait Foo { type Bar; } +struct Bar; + impl Bar { #[derive(Clone)] //~^ ERROR `derive` may only be applied to structs, enums and unions 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 dd7af830414..0088add7e7f 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 @@ -11,4 +11,3 @@ LL | #[derive(Clone)] | ^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors - diff --git a/src/test/ui/did_you_mean/issue-40396.rs b/src/test/ui/did_you_mean/issue-40396.rs index 978b5d14483..63eec50c2d2 100644 --- a/src/test/ui/did_you_mean/issue-40396.rs +++ b/src/test/ui/did_you_mean/issue-40396.rs @@ -1,14 +1,27 @@ fn foo() { - println!("{:?}", (0..13).collect<Vec<i32>>()); //~ ERROR chained comparison + (0..13).collect<Vec<i32>>(); + //~^ ERROR chained comparison + //~| ERROR expected value, found struct `Vec` + //~| ERROR expected value, found builtin type `i32` + //~| ERROR attempted to take value of method `collect` } fn bar() { - println!("{:?}", Vec<i32>::new()); //~ ERROR chained comparison + Vec<i32>::new(); + //~^ ERROR chained comparison + //~| ERROR expected value, found struct `Vec` + //~| ERROR expected value, found builtin type `i32` + //~| ERROR cannot find function `new` in the crate root } fn qux() { - println!("{:?}", (0..13).collect<Vec<i32>()); //~ ERROR chained comparison + (0..13).collect<Vec<i32>(); //~^ ERROR chained comparison + //~| ERROR chained comparison + //~| ERROR expected value, found struct `Vec` + //~| ERROR expected value, found builtin type `i32` + //~| ERROR attempted to take value of method `collect` + //~| ERROR mismatched types } fn main() {} diff --git a/src/test/ui/did_you_mean/issue-40396.stderr b/src/test/ui/did_you_mean/issue-40396.stderr index 3b086d8d4d0..33884bbfecf 100644 --- a/src/test/ui/did_you_mean/issue-40396.stderr +++ b/src/test/ui/did_you_mean/issue-40396.stderr @@ -1,8 +1,8 @@ error: chained comparison operators require parentheses --> $DIR/issue-40396.rs:2:37 | -LL | println!("{:?}", (0..13).collect<Vec<i32>>()); //~ ERROR chained comparison - | ^^^^^^^^ +LL | (0..13).collect<Vec<i32>>(); + | ^^^^^^^^ | = help: use `::<...>` instead of `<...>` if you meant to specify type arguments = help: or use `(...)` if you meant to specify fn arguments @@ -10,8 +10,8 @@ LL | println!("{:?}", (0..13).collect<Vec<i32>>()); //~ ERROR chained compar error: chained comparison operators require parentheses --> $DIR/issue-40396.rs:6:25 | -LL | println!("{:?}", Vec<i32>::new()); //~ ERROR chained comparison - | ^^^^^^^ +LL | Vec<i32>::new(); + | ^^^^^^^ | = help: use `::<...>` instead of `<...>` if you meant to specify type arguments = help: or use `(...)` if you meant to specify fn arguments @@ -19,8 +19,8 @@ LL | println!("{:?}", Vec<i32>::new()); //~ ERROR chained comparison error: chained comparison operators require parentheses --> $DIR/issue-40396.rs:10:37 | -LL | println!("{:?}", (0..13).collect<Vec<i32>()); //~ ERROR chained comparison - | ^^^^^^^^ +LL | (0..13).collect<Vec<i32>(); + | ^^^^^^^^ | = help: use `::<...>` instead of `<...>` if you meant to specify type arguments = help: or use `(...)` if you meant to specify fn arguments @@ -28,11 +28,80 @@ LL | println!("{:?}", (0..13).collect<Vec<i32>()); //~ ERROR chained compari error: chained comparison operators require parentheses --> $DIR/issue-40396.rs:10:41 | -LL | println!("{:?}", (0..13).collect<Vec<i32>()); //~ ERROR chained comparison - | ^^^^^^ +LL | (0..13).collect<Vec<i32>(); + | ^^^^^^ | = help: use `::<...>` instead of `<...>` if you meant to specify type arguments = help: or use `(...)` if you meant to specify fn arguments -error: aborting due to 4 previous errors +error[E0423]: expected value, found struct `Vec` + --> $DIR/issue-40396.rs:12:21 + | +LL | (0..13).collect<Vec<i32>>(); + | ^^^ did you mean `Vec { /* fields */ }`? + +error[E0423]: expected value, found builtin type `i32` + --> $DIR/issue-40396.rs:12:25 + | +LL | (0..13).collect<Vec<i32>>(); + | ^^^ not a value + +error[E0423]: expected value, found struct `Vec` + --> $DIR/issue-40396.rs:20:5 + | +LL | Vec<i32>::new(); + | ^^^ did you mean `Vec { /* fields */ }`? + +error[E0423]: expected value, found builtin type `i32` + --> $DIR/issue-40396.rs:20:9 + | +LL | Vec<i32>::new(); + | ^^^ not a value + +error[E0425]: cannot find function `new` in the crate root + --> $DIR/issue-40396.rs:20:15 + | +LL | Vec<i32>::new(); + | ^^^ not found in the crate root + +error[E0423]: expected value, found struct `Vec` + --> $DIR/issue-40396.rs:28:21 + | +LL | (0..13).collect<Vec<i32>(); + | ^^^ did you mean `Vec { /* fields */ }`? + +error[E0423]: expected value, found builtin type `i32` + --> $DIR/issue-40396.rs:28:25 + | +LL | (0..13).collect<Vec<i32>(); + | ^^^ not a value + +error[E0615]: attempted to take value of method `collect` on type `std::ops::Range<{integer}>` + --> $DIR/issue-40396.rs:12:13 + | +LL | (0..13).collect<Vec<i32>>(); + | ^^^^^^^ + | + = 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 + | +LL | (0..13).collect<Vec<i32>(); + | ^^^^^^^ + | + = help: maybe a `()` to call it is missing? + +error[E0308]: mismatched types + --> $DIR/issue-40396.rs:28:29 + | +LL | (0..13).collect<Vec<i32>(); + | ^^ expected bool, found () + | + = note: expected type `bool` + found type `()` + +error: aborting due to 14 previous errors +Some errors occurred: E0308, E0423, E0425, E0615. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/editions/edition-keywords-2015-2015-parsing.rs b/src/test/ui/editions/edition-keywords-2015-2015-parsing.rs index e65eed0a0e6..d1752a7ec71 100644 --- a/src/test/ui/editions/edition-keywords-2015-2015-parsing.rs +++ b/src/test/ui/editions/edition-keywords-2015-2015-parsing.rs @@ -4,6 +4,10 @@ #[macro_use] extern crate edition_kw_macro_2015; +mod module { + pub fn async() {} +} + pub fn check_async() { let mut async = 1; // OK let mut r#async = 1; // OK @@ -18,3 +22,5 @@ pub fn check_async() { module::async(); // OK module::r#async(); // OK } + +fn main() {} 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 377e8ae0825..06901ad6ef0 100644 --- a/src/test/ui/editions/edition-keywords-2015-2015-parsing.stderr +++ b/src/test/ui/editions/edition-keywords-2015-2015-parsing.stderr @@ -11,4 +11,3 @@ LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the t | ^^^^^ 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-expansion.rs b/src/test/ui/editions/edition-keywords-2015-2018-expansion.rs index 8aafeefa56c..2684c8e00b2 100644 --- a/src/test/ui/editions/edition-keywords-2015-2018-expansion.rs +++ b/src/test/ui/editions/edition-keywords-2015-2018-expansion.rs @@ -10,3 +10,5 @@ mod one_async { mod two_async { produces_async_raw! {} // OK } + +fn main() {} diff --git a/src/test/ui/editions/edition-keywords-2015-2018-parsing.rs b/src/test/ui/editions/edition-keywords-2015-2018-parsing.rs index 76739603129..44455f43856 100644 --- a/src/test/ui/editions/edition-keywords-2015-2018-parsing.rs +++ b/src/test/ui/editions/edition-keywords-2015-2018-parsing.rs @@ -4,6 +4,10 @@ #[macro_use] extern crate edition_kw_macro_2018; +mod module { + pub fn async() {} +} + pub fn check_async() { let mut async = 1; // OK let mut r#async = 1; // OK @@ -18,3 +22,5 @@ pub fn check_async() { module::async(); // OK module::r#async(); // OK } + +fn main() {} 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 c6e4d01a649..98fa2493940 100644 --- a/src/test/ui/editions/edition-keywords-2015-2018-parsing.stderr +++ b/src/test/ui/editions/edition-keywords-2015-2018-parsing.stderr @@ -11,4 +11,3 @@ LL | r#async = consumes_async_raw!(async); //~ ERROR no rules expected the t | ^^^^^ no rules expected this token in macro call error: aborting due to 2 previous errors - diff --git a/src/test/ui/editions/edition-keywords-2018-2018-expansion.rs b/src/test/ui/editions/edition-keywords-2018-2018-expansion.rs index 2db0a2dde2e..6f766550d47 100644 --- a/src/test/ui/editions/edition-keywords-2018-2018-expansion.rs +++ b/src/test/ui/editions/edition-keywords-2018-2018-expansion.rs @@ -10,3 +10,5 @@ mod one_async { mod two_async { produces_async_raw! {} // OK } + +fn main() {} diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-derive-2.rs b/src/test/ui/feature-gate/issue-43106-gating-of-derive-2.rs index 352f56f7aca..5f276f6b65e 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-derive-2.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-derive-2.rs @@ -13,3 +13,5 @@ mod derive { //~^ ERROR cannot find derive macro `x3300` in this scope struct S; } + +fn main() {} diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-derive.rs b/src/test/ui/feature-gate/issue-43106-gating-of-derive.rs index 8bac49816ad..13974129884 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-derive.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-derive.rs @@ -31,3 +31,5 @@ mod derive { //~^ ERROR `derive` may only be applied to structs, enums and unions impl S { } } + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs index 1786ec246ab..db1a7dad06b 100644 --- a/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs +++ b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs @@ -1,3 +1,5 @@ +#![feature(intrinsics, lang_items, no_core)] + #![crate_type="rlib"] #![no_core] diff --git a/src/test/ui/feature-gates/feature-gate-macros_in_extern.rs b/src/test/ui/feature-gates/feature-gate-macros_in_extern.rs index 8f8147a7423..125af64fef0 100644 --- a/src/test/ui/feature-gates/feature-gate-macros_in_extern.rs +++ b/src/test/ui/feature-gates/feature-gate-macros_in_extern.rs @@ -23,3 +23,5 @@ extern { emits_nothing!(); //~^ ERROR macro invocations in `extern {}` blocks are experimental } + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-rustc-attrs.rs b/src/test/ui/feature-gates/feature-gate-rustc-attrs.rs index 993daca0756..5ec413cc71d 100644 --- a/src/test/ui/feature-gates/feature-gate-rustc-attrs.rs +++ b/src/test/ui/feature-gates/feature-gate-rustc-attrs.rs @@ -1,8 +1,6 @@ -// ignore-tidy-linelength - // Test that `#[rustc_*]` attributes are gated by `rustc_attrs` feature gate. #[rustc_foo] -//~^ ERROR unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics +//~^ ERROR unless otherwise specified, attributes with the prefix `rustc_` are reserved fn main() {} 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<T>( 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<K, V>(this: &mut HashMap<K, V>, other: HashMap<K, V>) -> 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<K, V>` 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<T> { 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<Item=<Self as Graph<'a>>::Node> + 'static)> found std::boxed::Box<dyn std::iter::Iterator<Item=<Self as Graph<'a>>::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); } diff --git a/src/test/ui/macro_backtrace/main.rs b/src/test/ui/macro_backtrace/main.rs index fd2f1b7a286..2c11ce56f8b 100644 --- a/src/test/ui/macro_backtrace/main.rs +++ b/src/test/ui/macro_backtrace/main.rs @@ -12,6 +12,8 @@ macro_rules! pong { //~| ERROR expected one of //~| ERROR expected one of +struct syntax; + fn main() { pong!(); ping!(); diff --git a/src/test/ui/macros/macro-comma-behavior.core.stderr b/src/test/ui/macros/macro-comma-behavior.core.stderr index b3988717b37..7a4b9278e0a 100644 --- a/src/test/ui/macros/macro-comma-behavior.core.stderr +++ b/src/test/ui/macros/macro-comma-behavior.core.stderr @@ -40,5 +40,11 @@ error: 1 positional argument in format string, but no arguments were given LL | write!(f, "{}",)?; | ^^ -error: aborting due to 7 previous errors +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 diff --git a/src/test/ui/malformed/malformed-derive-entry.rs b/src/test/ui/malformed/malformed-derive-entry.rs index 5978258b5d8..2c8ebc49772 100644 --- a/src/test/ui/malformed/malformed-derive-entry.rs +++ b/src/test/ui/malformed/malformed-derive-entry.rs @@ -13,3 +13,5 @@ struct Test3; #[derive] //~^ WARNING empty trait list struct Test4; + +fn main() {} 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 index 60f8684968f..866c5b2e34b 100644 --- a/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs +++ b/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs @@ -3,3 +3,5 @@ // 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 index 0e68c9b806d..27e27dda5ef 100644 --- a/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.stderr +++ b/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.stderr @@ -1,9 +1,4 @@ error: the crate `depends` cannot depend on a crate that needs a panic runtime, but it depends on `needs_panic_runtime` -error[E0601]: `main` function not found in crate `runtime_depend_on_needs_runtime` - | - = note: consider adding a `main` function to `$DIR/runtime-depend-on-needs-runtime.rs` +error: aborting due to previous error -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/parser/macro/pub-item-macro.rs b/src/test/ui/parser/macro/pub-item-macro.rs index 7bab8653982..bae90227c62 100644 --- a/src/test/ui/parser/macro/pub-item-macro.rs +++ b/src/test/ui/parser/macro/pub-item-macro.rs @@ -14,5 +14,5 @@ mod foo { } fn main() { - let y: u32 = foo::x; + let y: u32 = foo::x; //~ ERROR static `x` is private } diff --git a/src/test/ui/parser/macro/pub-item-macro.stderr b/src/test/ui/parser/macro/pub-item-macro.stderr index a801986ed4e..fb7a1fce549 100644 --- a/src/test/ui/parser/macro/pub-item-macro.stderr +++ b/src/test/ui/parser/macro/pub-item-macro.stderr @@ -9,5 +9,12 @@ LL | pub_x!(); | = help: try adjusting the macro to put `pub` inside the invocation -error: aborting due to previous error +error[E0603]: static `x` is private + --> $DIR/pub-item-macro.rs:27:23 + | +LL | let y: u32 = foo::x; //~ ERROR static `x` is private + | ^ + +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/ui/proc-macro/issue-41211.rs b/src/test/ui/proc-macro/issue-41211.rs index 50678818bf8..0b082f4818f 100644 --- a/src/test/ui/proc-macro/issue-41211.rs +++ b/src/test/ui/proc-macro/issue-41211.rs @@ -7,6 +7,7 @@ #![emit_unchanged] //~^ ERROR attribute `emit_unchanged` is currently unknown to the compiler +//~| ERROR inconsistent resolution for a macro: first custom attribute, then attribute macro extern crate issue_41211; use issue_41211::emit_unchanged; diff --git a/src/test/ui/proc-macro/issue-41211.stderr b/src/test/ui/proc-macro/issue-41211.stderr index 41f51aea6fc..2c702c7871d 100644 --- a/src/test/ui/proc-macro/issue-41211.stderr +++ b/src/test/ui/proc-macro/issue-41211.stderr @@ -6,6 +6,12 @@ LL | #![emit_unchanged] | = help: add #![feature(custom_attribute)] to the crate attributes to enable -error: aborting due to previous error +error: inconsistent resolution for a macro: first custom attribute, then attribute macro + --> $DIR/issue-41211.rs:18:4 + | +LL | #![emit_unchanged] + | ^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/proc-macro/lifetimes.rs b/src/test/ui/proc-macro/lifetimes.rs index 44700ca447d..d0dd1b4603b 100644 --- a/src/test/ui/proc-macro/lifetimes.rs +++ b/src/test/ui/proc-macro/lifetimes.rs @@ -7,3 +7,5 @@ extern crate lifetimes; use lifetimes::*; type A = single_quote_alone!(); //~ ERROR expected type, found `'` + +fn main() {} diff --git a/src/test/ui/proc-macro/more-gates.rs b/src/test/ui/proc-macro/more-gates.rs index e3fb96b90ed..b870b438a65 100644 --- a/src/test/ui/proc-macro/more-gates.rs +++ b/src/test/ui/proc-macro/more-gates.rs @@ -1,5 +1,7 @@ // aux-build:more-gates.rs +#![feature(decl_macro)] + extern crate more_gates as foo; use foo::*; diff --git a/src/test/ui/proc-macro/parent-source-spans.rs b/src/test/ui/proc-macro/parent-source-spans.rs index 2e12c34b99b..799f1de586e 100644 --- a/src/test/ui/proc-macro/parent-source-spans.rs +++ b/src/test/ui/proc-macro/parent-source-spans.rs @@ -28,6 +28,9 @@ macro three($($tokens:tt)*) { macro four($($tokens:tt)*) { parent_source_spans!($($tokens)*); + //~^ ERROR cannot find value `ok` in this scope + //~| ERROR cannot find value `ok` in this scope + //~| ERROR cannot find value `ok` in this scope } fn main() { diff --git a/src/test/ui/proc-macro/parent-source-spans.stderr b/src/test/ui/proc-macro/parent-source-spans.stderr index c39d4c19eb5..2d9ebff88cb 100644 --- a/src/test/ui/proc-macro/parent-source-spans.stderr +++ b/src/test/ui/proc-macro/parent-source-spans.stderr @@ -124,5 +124,33 @@ error: second source: "hop" LL | three!("hip", "hop"); | ^^^^^ -error: aborting due to 18 previous errors +error[E0425]: cannot find value `ok` in this scope + --> $DIR/parent-source-spans.rs:40:5 + | +LL | parent_source_spans!($($tokens)*); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Ok`? +... +LL | one!("hello", "world"); + | ----------------------- in this macro invocation + +error[E0425]: cannot find value `ok` in this scope + --> $DIR/parent-source-spans.rs:40:5 + | +LL | parent_source_spans!($($tokens)*); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Ok`? +... +LL | two!("yay", "rust"); + | -------------------- in this macro invocation + +error[E0425]: cannot find value `ok` in this scope + --> $DIR/parent-source-spans.rs:40:5 + | +LL | parent_source_spans!($($tokens)*); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `Ok`? +... +LL | three!("hip", "hop"); + | --------------------- in this macro invocation + +error: aborting due to 21 previous errors +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/proc-macro/proc-macro-attributes.rs b/src/test/ui/proc-macro/proc-macro-attributes.rs index e05828209ad..1cc824e943c 100644 --- a/src/test/ui/proc-macro/proc-macro-attributes.rs +++ b/src/test/ui/proc-macro/proc-macro-attributes.rs @@ -3,11 +3,12 @@ #[macro_use] extern crate derive_b; -#[B] +#[B] //~ ERROR `B` is ambiguous #[C] //~ ERROR attribute `C` is currently unknown to the compiler -#[B(D)] -#[B(E = "foo")] -#[B(arbitrary tokens)] +#[B(D)] //~ ERROR `B` is ambiguous +#[B(E = "foo")] //~ ERROR `B` is ambiguous +#[B(arbitrary tokens)] //~ ERROR `B` is ambiguous + //~^ ERROR expected one of `(`, `)`, `,`, `::`, or `=`, found `tokens` #[derive(B)] struct B; diff --git a/src/test/ui/proc-macro/proc-macro-attributes.stderr b/src/test/ui/proc-macro/proc-macro-attributes.stderr index ecdc5558851..8b87e482282 100644 --- a/src/test/ui/proc-macro/proc-macro-attributes.stderr +++ b/src/test/ui/proc-macro/proc-macro-attributes.stderr @@ -6,6 +6,81 @@ LL | #[C] //~ ERROR attribute `C` is currently unknown to the compiler | = help: add #![feature(custom_attribute)] to the crate attributes to enable -error: aborting due to previous error +error[E0659]: `B` is ambiguous (derive helper attribute vs any other name) + --> $DIR/proc-macro-attributes.rs:16: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 + | +LL | #[derive(B)] + | ^ +note: `B` could also refer to the derive macro imported here + --> $DIR/proc-macro-attributes.rs:13:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ + +error[E0659]: `B` is ambiguous (derive helper attribute vs any other name) + --> $DIR/proc-macro-attributes.rs:18: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 + | +LL | #[derive(B)] + | ^ +note: `B` could also refer to the derive macro imported here + --> $DIR/proc-macro-attributes.rs:13:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ + +error[E0659]: `B` is ambiguous (derive helper attribute vs any other name) + --> $DIR/proc-macro-attributes.rs:19: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 + | +LL | #[derive(B)] + | ^ +note: `B` could also refer to the derive macro imported here + --> $DIR/proc-macro-attributes.rs:13:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ + +error[E0659]: `B` is ambiguous (derive helper attribute vs any other name) + --> $DIR/proc-macro-attributes.rs:20: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 + | +LL | #[derive(B)] + | ^ +note: `B` could also refer to the derive macro imported here + --> $DIR/proc-macro-attributes.rs:13:1 + | +LL | #[macro_use] + | ^^^^^^^^^^^^ + +error: expected one of `(`, `)`, `,`, `::`, or `=`, found `tokens` + --> $DIR/proc-macro-attributes.rs:20:15 + | +LL | #[B(arbitrary tokens)] //~ ERROR `B` is ambiguous + | ^^^^^^ expected one of `(`, `)`, `,`, `::`, or `=` here + +error: aborting due to 6 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors occurred: E0658, E0659. +For more information about an error, try `rustc --explain E0658`. diff --git a/src/test/ui/quote-with-interpolated.rs b/src/test/ui/quote-with-interpolated.rs index dd79d2b3e4a..b948226652b 100644 --- a/src/test/ui/quote-with-interpolated.rs +++ b/src/test/ui/quote-with-interpolated.rs @@ -2,7 +2,12 @@ fn main() { macro_rules! foo { ($bar:expr) => { - quote_expr!(cx, $bar) //~ ERROR quote! with interpolated token + quote_expr!(cx, $bar) + //~^ ERROR quote! with interpolated token + //~| ERROR failed to resolve: maybe a missing `extern crate syntax;`? + //~| ERROR failed to resolve: maybe a missing `extern crate syntax;`? + //~| ERROR cannot find value `cx` in this scope + //~| ERROR cannot find function `new_parser_from_tts` in this scope } } foo!(bar); diff --git a/src/test/ui/quote-with-interpolated.stderr b/src/test/ui/quote-with-interpolated.stderr index 89f4db0ad3c..3c582286662 100644 --- a/src/test/ui/quote-with-interpolated.stderr +++ b/src/test/ui/quote-with-interpolated.stderr @@ -1,11 +1,40 @@ error: quote! with interpolated token --> $DIR/quote-with-interpolated.rs:5:29 | -LL | quote_expr!(cx, $bar) //~ ERROR quote! with interpolated token +LL | quote_expr!(cx, $bar) | ^^^^ ... LL | foo!(bar); | ---------- in this macro invocation -error: aborting due to previous error +error[E0433]: failed to resolve: maybe a missing `extern crate syntax;`? + --> $DIR/quote-with-interpolated.rs:15: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 + | +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 + | +LL | quote_expr!(cx, $bar) + | ^^ not found in this scope +... +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 + | +LL | quote_expr!(cx, $bar) + | ^^^^^^^^^^^^^^^^^^^^^ not found in this scope + +error: aborting due to 5 previous errors +Some errors occurred: E0425, E0433. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/ui/reserved/reserved-attr-on-macro.rs b/src/test/ui/reserved/reserved-attr-on-macro.rs index 0b00d711036..96c63ba4db8 100644 --- a/src/test/ui/reserved/reserved-attr-on-macro.rs +++ b/src/test/ui/reserved/reserved-attr-on-macro.rs @@ -1,8 +1,9 @@ -#[rustc_attribute_should_be_reserved] //~ ERROR attributes with the prefix `rustc_` are reserved +#[rustc_attribute_should_be_reserved] +//~^ ERROR unless otherwise specified, attributes with the prefix `rustc_` are reserved macro_rules! foo { () => (()); } fn main() { - foo!(); + foo!(); //~ ERROR cannot determine resolution for the macro `foo` } diff --git a/src/test/ui/reserved/reserved-attr-on-macro.stderr b/src/test/ui/reserved/reserved-attr-on-macro.stderr index 0d7fa707722..4f1c0e1aa70 100644 --- a/src/test/ui/reserved/reserved-attr-on-macro.stderr +++ b/src/test/ui/reserved/reserved-attr-on-macro.stderr @@ -1,11 +1,19 @@ error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics (see issue #29642) --> $DIR/reserved-attr-on-macro.rs:1:3 | -LL | #[rustc_attribute_should_be_reserved] //~ ERROR attributes with the prefix `rustc_` are reserved +LL | #[rustc_attribute_should_be_reserved] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(rustc_attrs)] to the crate attributes to enable -error: aborting due to previous error +error: cannot determine resolution for the macro `foo` + --> $DIR/reserved-attr-on-macro.rs:18:5 + | +LL | foo!(); //~ ERROR cannot determine resolution for the macro `foo` + | ^^^ + | + = note: import resolution is stuck, try simplifying macro imports + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/self/self_type_keyword.rs b/src/test/ui/self/self_type_keyword.rs index 742318d1e95..4a1681e4e2b 100644 --- a/src/test/ui/self/self_type_keyword.rs +++ b/src/test/ui/self/self_type_keyword.rs @@ -7,6 +7,7 @@ mod foo { struct Bar<'Self>; //~^ ERROR lifetimes cannot use keyword names +//~| ERROR parameter `'Self` is never used struct Foo; diff --git a/src/test/ui/self/self_type_keyword.stderr b/src/test/ui/self/self_type_keyword.stderr index 3b095b78418..1981e23c88a 100644 --- a/src/test/ui/self/self_type_keyword.stderr +++ b/src/test/ui/self/self_type_keyword.stderr @@ -58,5 +58,14 @@ error: cannot find macro `Self!` in this scope LL | Self!() => (), | ^^^^ -error: aborting due to 10 previous errors +error[E0392]: parameter `'Self` is never used + --> $DIR/self_type_keyword.rs:18:12 + | +LL | struct Bar<'Self>; + | ^^^^^ unused type parameter + | + = help: consider removing `'Self` or using a marker such as `std::marker::PhantomData` + +error: aborting due to 11 previous errors +For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/span/issue-36530.rs b/src/test/ui/span/issue-36530.rs index 663e5207519..e11be9e17f2 100644 --- a/src/test/ui/span/issue-36530.rs +++ b/src/test/ui/span/issue-36530.rs @@ -5,3 +5,5 @@ mod foo { #![foo] //~ ERROR is currently unknown to the compiler //~| ERROR non-builtin inner attributes are unstable } + +fn main() {} diff --git a/src/test/ui/span/macro-ty-params.rs b/src/test/ui/span/macro-ty-params.rs index f36574e2b3d..b077d590915 100644 --- a/src/test/ui/span/macro-ty-params.rs +++ b/src/test/ui/span/macro-ty-params.rs @@ -4,9 +4,11 @@ macro_rules! m { } } +macro_rules! foo { () => () } + fn main() { foo::<T>!(); //~ ERROR generic arguments in macro path foo::<>!(); //~ ERROR generic arguments in macro path - m!(MyTrait<>); //~ ERROR generic arguments in macro path + m!(Default<>); //~ ERROR generic arguments in macro path //~^ ERROR unexpected generic arguments in path } diff --git a/src/test/ui/span/macro-ty-params.stderr b/src/test/ui/span/macro-ty-params.stderr index 79ae4a7e784..c1dcc513f3a 100644 --- a/src/test/ui/span/macro-ty-params.stderr +++ b/src/test/ui/span/macro-ty-params.stderr @@ -1,26 +1,25 @@ error: unexpected generic arguments in path --> $DIR/macro-ty-params.rs:10:8 | -LL | m!(MyTrait<>); //~ ERROR generic arguments in macro path - | ^^^^^^^^^ +LL | foo::<T>!(); //~ ERROR generic arguments in macro path + | ^^^^^ error: generic arguments in macro path --> $DIR/macro-ty-params.rs:10:15 | -LL | m!(MyTrait<>); //~ ERROR generic arguments in macro path - | ^^ +LL | foo::<>!(); //~ ERROR generic arguments in macro path + | ^^^^ error: generic arguments in macro path --> $DIR/macro-ty-params.rs:8:8 | -LL | foo::<T>!(); //~ ERROR generic arguments in macro path - | ^^^^^ +LL | m!(Default<>); //~ ERROR generic arguments in macro path + | ^^^^^^^^^ error: generic arguments in macro path --> $DIR/macro-ty-params.rs:9:8 | -LL | foo::<>!(); //~ ERROR generic arguments in macro path - | ^^^^ +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.rs b/src/test/ui/span/visibility-ty-params.rs index a9aaabad95c..d77febe0aa2 100644 --- a/src/test/ui/span/visibility-ty-params.rs +++ b/src/test/ui/span/visibility-ty-params.rs @@ -4,6 +4,7 @@ macro_rules! m { struct S<T>(T); m!{ S<u8> } //~ ERROR unexpected generic arguments in path + //~| ERROR expected module, found struct `S` mod m { m!{ m<> } //~ ERROR unexpected generic arguments in path diff --git a/src/test/ui/span/visibility-ty-params.stderr b/src/test/ui/span/visibility-ty-params.stderr index 52b8042ba45..9a11eea6532 100644 --- a/src/test/ui/span/visibility-ty-params.stderr +++ b/src/test/ui/span/visibility-ty-params.stderr @@ -10,5 +10,14 @@ error: unexpected generic arguments in path LL | m!{ m<> } //~ ERROR unexpected generic arguments in path | ^^^ -error: aborting due to 2 previous errors +error[E0577]: expected module, found struct `S` + --> $DIR/visibility-ty-params.rs:16:5 + | +LL | m!{ S<u8> } //~ ERROR unexpected generic arguments in path + | -^^^^ + | | + | did you mean `m`? + +error: aborting due to 3 previous errors +For more information about this error, try `rustc --explain E0577`. diff --git a/src/test/ui/tuple/tuple-struct-fields/test2.rs b/src/test/ui/tuple/tuple-struct-fields/test2.rs index 7c8e9bbb23c..fc0f78b12c9 100644 --- a/src/test/ui/tuple/tuple-struct-fields/test2.rs +++ b/src/test/ui/tuple/tuple-struct-fields/test2.rs @@ -8,5 +8,7 @@ macro_rules! define_struct { } mod foo { - define_struct! { (foo) } + define_struct! { (foo) } //~ ERROR cannot find type `foo` in this scope } + +fn main() {} diff --git a/src/test/ui/tuple/tuple-struct-fields/test2.stderr b/src/test/ui/tuple/tuple-struct-fields/test2.stderr index 9aba84046a1..baca625b0bd 100644 --- a/src/test/ui/tuple/tuple-struct-fields/test2.stderr +++ b/src/test/ui/tuple/tuple-struct-fields/test2.stderr @@ -4,8 +4,15 @@ error: expected one of `)` or `,`, found `(` LL | struct S3(pub $t ()); | ^ expected one of `)` or `,` here ... -LL | define_struct! { (foo) } +LL | define_struct! { (foo) } //~ ERROR cannot find type `foo` in this scope | ------------------------ in this macro invocation -error: aborting due to previous error +error[E0412]: cannot find type `foo` in this scope + --> $DIR/test2.rs:21:23 + | +LL | define_struct! { (foo) } //~ ERROR cannot find type `foo` in this scope + | ^^^ 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/tuple/tuple-struct-fields/test3.rs b/src/test/ui/tuple/tuple-struct-fields/test3.rs index 8d7c7c35caf..6b8534b4524 100644 --- a/src/test/ui/tuple/tuple-struct-fields/test3.rs +++ b/src/test/ui/tuple/tuple-struct-fields/test3.rs @@ -8,5 +8,7 @@ macro_rules! define_struct { } mod foo { - define_struct! { foo } + define_struct! { foo } //~ ERROR cannot find type `foo` in this scope } + +fn main() {} diff --git a/src/test/ui/tuple/tuple-struct-fields/test3.stderr b/src/test/ui/tuple/tuple-struct-fields/test3.stderr index fc71354a9d6..2da34fff53d 100644 --- a/src/test/ui/tuple/tuple-struct-fields/test3.stderr +++ b/src/test/ui/tuple/tuple-struct-fields/test3.stderr @@ -4,8 +4,15 @@ error: expected one of `)` or `,`, found `(` LL | struct S3(pub($t) ()); | ^ expected one of `)` or `,` here ... -LL | define_struct! { foo } +LL | define_struct! { foo } //~ ERROR cannot find type `foo` in this scope | ---------------------- in this macro invocation -error: aborting due to previous error +error[E0412]: cannot find type `foo` in this scope + --> $DIR/test3.rs:21:22 + | +LL | define_struct! { foo } //~ ERROR cannot find type `foo` in this scope + | ^^^ not found in this scope + +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0412`. |
