Test showing it doesnt work
This commit is contained in:
parent
f00c139998
commit
4da6eb2ec6
@ -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
|
||||
}
|
15
tests/ui/resolve/suggest-import-without-clobbering-attrs.rs
Normal file
15
tests/ui/resolve/suggest-import-without-clobbering-attrs.rs
Normal 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
|
||||
}
|
@ -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`.
|
Loading…
x
Reference in New Issue
Block a user