mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-24 04:46:58 +00:00
Add test for macro-not-found-but-name-imported-here note.
This commit is contained in:
parent
fed6131c41
commit
9051c056ed
src/test/ui/derives
18
src/test/ui/derives/issue-88206.rs
Normal file
18
src/test/ui/derives/issue-88206.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// compile-flags: -Z deduplicate-diagnostics=yes
|
||||
|
||||
#![warn(unused_imports)]
|
||||
//~^ NOTE lint level
|
||||
|
||||
mod hey {
|
||||
pub trait Serialize {}
|
||||
}
|
||||
|
||||
use hey::Serialize;
|
||||
//~^ WARNING unused import
|
||||
//~| NOTE `Serialize` is imported here
|
||||
|
||||
#[derive(Serialize)]
|
||||
//~^ ERROR cannot find derive macro `Serialize`
|
||||
struct A;
|
||||
|
||||
fn main() {}
|
26
src/test/ui/derives/issue-88206.stderr
Normal file
26
src/test/ui/derives/issue-88206.stderr
Normal file
@ -0,0 +1,26 @@
|
||||
error: cannot find derive macro `Serialize` in this scope
|
||||
--> $DIR/issue-88206.rs:14:10
|
||||
|
|
||||
LL | #[derive(Serialize)]
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
note: `Serialize` is imported here, but it is not a derive macro
|
||||
--> $DIR/issue-88206.rs:10:5
|
||||
|
|
||||
LL | use hey::Serialize;
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
warning: unused import: `hey::Serialize`
|
||||
--> $DIR/issue-88206.rs:10:5
|
||||
|
|
||||
LL | use hey::Serialize;
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/issue-88206.rs:3:9
|
||||
|
|
||||
LL | #![warn(unused_imports)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
Loading…
Reference in New Issue
Block a user