diff options
| author | bors <bors@rust-lang.org> | 2021-07-19 18:44:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-19 18:44:27 +0000 |
| commit | d5af63480fb08b5276a608a8cd4865fa92d4b2bc (patch) | |
| tree | 4dafbbc941ca3ed032a8bdb4c90c36aeab752152 /src/test/ui/proc-macro | |
| parent | fad295b299d9e93950c27acd6a12026d100185fe (diff) | |
| parent | ba052bd8de1459acb6809215b0bedf4ea476ef9a (diff) | |
| download | rust-d5af63480fb08b5276a608a8cd4865fa92d4b2bc.tar.gz rust-d5af63480fb08b5276a608a8cd4865fa92d4b2bc.zip | |
Auto merge of #87225 - estebank:cleanup, r=oli-obk
Various diagnostics clean ups/tweaks * Always point at macros, including derive macros * Point at non-local items that introduce a trait requirement * On private associated item, point at definition
Diffstat (limited to 'src/test/ui/proc-macro')
5 files changed, 12 insertions, 8 deletions
diff --git a/src/test/ui/proc-macro/attributes-on-modules-fail.rs b/src/test/ui/proc-macro/attributes-on-modules-fail.rs index c506e903e7f..6c30e8f4f95 100644 --- a/src/test/ui/proc-macro/attributes-on-modules-fail.rs +++ b/src/test/ui/proc-macro/attributes-on-modules-fail.rs @@ -13,7 +13,7 @@ mod m { struct Y; type A = X; //~ ERROR cannot find type `X` in this scope -#[derive(Copy)] //~ ERROR `derive` may only be applied to structs, enums and unions +#[derive(Copy)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s mod n {} #[empty_attr] diff --git a/src/test/ui/proc-macro/attributes-on-modules-fail.stderr b/src/test/ui/proc-macro/attributes-on-modules-fail.stderr index 7141a1b50b5..bb6cbb6984d 100644 --- a/src/test/ui/proc-macro/attributes-on-modules-fail.stderr +++ b/src/test/ui/proc-macro/attributes-on-modules-fail.stderr @@ -1,8 +1,10 @@ -error[E0774]: `derive` may only be applied to structs, enums and unions +error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s --> $DIR/attributes-on-modules-fail.rs:16:1 | LL | #[derive(Copy)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ not applicable here +LL | mod n {} + | -------- not a `struct`, `enum` or `union` error[E0658]: non-inline modules in proc macro input are unstable --> $DIR/attributes-on-modules-fail.rs:20:1 diff --git a/src/test/ui/proc-macro/macros-in-extern-derive.rs b/src/test/ui/proc-macro/macros-in-extern-derive.rs index e52bf435a12..c8b26b00597 100644 --- a/src/test/ui/proc-macro/macros-in-extern-derive.rs +++ b/src/test/ui/proc-macro/macros-in-extern-derive.rs @@ -1,5 +1,5 @@ extern "C" { - #[derive(Copy)] //~ ERROR `derive` may only be applied to structs, enums and unions + #[derive(Copy)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s fn f(); } diff --git a/src/test/ui/proc-macro/macros-in-extern-derive.stderr b/src/test/ui/proc-macro/macros-in-extern-derive.stderr index 6b737449209..efd9ff22506 100644 --- a/src/test/ui/proc-macro/macros-in-extern-derive.stderr +++ b/src/test/ui/proc-macro/macros-in-extern-derive.stderr @@ -1,8 +1,10 @@ -error[E0774]: `derive` may only be applied to structs, enums and unions +error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s --> $DIR/macros-in-extern-derive.rs:2:5 | LL | #[derive(Copy)] - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ not applicable here +LL | fn f(); + | ------- not a `struct`, `enum` or `union` error: aborting due to previous error diff --git a/src/test/ui/proc-macro/span-from-proc-macro.stderr b/src/test/ui/proc-macro/span-from-proc-macro.stderr index 9152ee60a7e..c3904d62c8d 100644 --- a/src/test/ui/proc-macro/span-from-proc-macro.stderr +++ b/src/test/ui/proc-macro/span-from-proc-macro.stderr @@ -10,7 +10,7 @@ LL | field: MissingType ::: $DIR/span-from-proc-macro.rs:8:1 | LL | #[error_from_attribute] - | ----------------------- in this macro invocation + | ----------------------- in this procedural macro expansion error[E0412]: cannot find type `OtherMissingType` in this scope --> $DIR/auxiliary/span-from-proc-macro.rs:46:21 @@ -24,7 +24,7 @@ LL | Variant(OtherMissingType) ::: $DIR/span-from-proc-macro.rs:11:10 | LL | #[derive(ErrorFromDerive)] - | --------------- in this macro invocation + | --------------- in this derive macro expansion error[E0425]: cannot find value `my_ident` in this scope --> $DIR/auxiliary/span-from-proc-macro.rs:29:9 |
