Skip to content

Commit 4da6eb2

Browse files
Test showing it doesnt work
1 parent f00c139 commit 4da6eb2

3 files changed

+45
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// run-rustfix
2+
// compile-flags: --cfg=whatever -Aunused
3+
4+
#[cfg(whatever)]
5+
use y::z;
6+
use y::Whatever;
7+
8+
mod y {
9+
pub(crate) fn z() {}
10+
pub(crate) struct Whatever;
11+
}
12+
13+
fn main() {
14+
z();
15+
//~^ ERROR cannot find function `z` in this scope
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// run-rustfix
2+
// compile-flags: --cfg=whatever -Aunused
3+
4+
#[cfg(whatever)]
5+
use y::Whatever;
6+
7+
mod y {
8+
pub(crate) fn z() {}
9+
pub(crate) struct Whatever;
10+
}
11+
12+
fn main() {
13+
z();
14+
//~^ ERROR cannot find function `z` in this scope
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0425]: cannot find function `z` in this scope
2+
--> $DIR/suggest-import-without-clobbering-attrs.rs:13:5
3+
|
4+
LL | z();
5+
| ^ not found in this scope
6+
|
7+
help: consider importing this function
8+
|
9+
LL + use y::z;
10+
|
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0425`.

0 commit comments

Comments
 (0)