Test showing it doesnt work

This commit is contained in:
Michael Goulet 2023-09-07 05:11:41 +00:00
parent f00c139998
commit 4da6eb2ec6
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,16 @@
// run-rustfix
// compile-flags: --cfg=whatever -Aunused
#[cfg(whatever)]
use y::z;
use y::Whatever;
mod y {
pub(crate) fn z() {}
pub(crate) struct Whatever;
}
fn main() {
z();
//~^ ERROR cannot find function `z` in this scope
}

View File

@ -0,0 +1,15 @@
// run-rustfix
// compile-flags: --cfg=whatever -Aunused
#[cfg(whatever)]
use y::Whatever;
mod y {
pub(crate) fn z() {}
pub(crate) struct Whatever;
}
fn main() {
z();
//~^ ERROR cannot find function `z` in this scope
}

View File

@ -0,0 +1,14 @@
error[E0425]: cannot find function `z` in this scope
--> $DIR/suggest-import-without-clobbering-attrs.rs:13:5
|
LL | z();
| ^ not found in this scope
|
help: consider importing this function
|
LL + use y::z;
|
error: aborting due to previous error
For more information about this error, try `rustc --explain E0425`.