Add test for macro-not-found-but-name-imported-here note.

This commit is contained in:
Mara Bos 2021-08-22 13:37:27 +02:00
parent fed6131c41
commit 9051c056ed
2 changed files with 44 additions and 0 deletions

View 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() {}

View 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