Add tests for issues 152004, 151124 and 152347

This commit is contained in:
Vadim Petrochenkov 2026-02-11 22:21:22 +03:00
parent 7dc2e92b83
commit 0cd0840243
4 changed files with 58 additions and 0 deletions

View 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
}

View 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`.

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

View 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