Add tests for issues 152004, 151124 and 152347
(cherry picked from commit 0cd0840243)
This commit is contained in:
parent
1087b41a83
commit
bcfdf1bf97
4 changed files with 58 additions and 0 deletions
17
tests/ui/imports/overwrite-different-vis-2.rs
Normal file
17
tests/ui/imports/overwrite-different-vis-2.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Regression test for issue #152347.
|
||||
|
||||
//@ edition: 2018..
|
||||
|
||||
use outer::*; // must be before `mod outer`
|
||||
mod outer {
|
||||
mod inner {
|
||||
pub fn f() {}
|
||||
}
|
||||
|
||||
use inner::*;
|
||||
pub use inner::*;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
f(); //~ ERROR cannot find function `f` in this scope
|
||||
}
|
||||
14
tests/ui/imports/overwrite-different-vis-2.stderr
Normal file
14
tests/ui/imports/overwrite-different-vis-2.stderr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
error[E0425]: cannot find function `f` in this scope
|
||||
--> $DIR/overwrite-different-vis-2.rs:16:5
|
||||
|
|
||||
LL | f();
|
||||
| ^ not found in this scope
|
||||
|
|
||||
help: consider importing this function through its public re-export
|
||||
|
|
||||
LL + use crate::outer::f;
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0425`.
|
||||
12
tests/ui/imports/overwrite-vis-unused.rs
Normal file
12
tests/ui/imports/overwrite-vis-unused.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Regression test for issues #152004 and #151124.
|
||||
|
||||
#![deny(unused)]
|
||||
|
||||
mod m {
|
||||
pub struct S {}
|
||||
}
|
||||
|
||||
use m::*;
|
||||
pub use m::*; //~ ERROR unused import: `m::*`
|
||||
|
||||
fn main() {}
|
||||
15
tests/ui/imports/overwrite-vis-unused.stderr
Normal file
15
tests/ui/imports/overwrite-vis-unused.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: unused import: `m::*`
|
||||
--> $DIR/overwrite-vis-unused.rs:10:9
|
||||
|
|
||||
LL | pub use m::*;
|
||||
| ^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/overwrite-vis-unused.rs:3:9
|
||||
|
|
||||
LL | #![deny(unused)]
|
||||
| ^^^^^^
|
||||
= note: `#[deny(unused_imports)]` implied by `#[deny(unused)]`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue