rust/tests/ui/imports/issue-4366-2.rs
Lukas Wirth 23d5231607 Use non-2015 edition paths in tests that do not test for their resolution
This allows for testing these tests on editions other than 2015
2025-06-03 10:13:33 +02:00

27 lines
431 B
Rust

// ensures that 'use foo:*' doesn't import non-public item
use m1::*;
mod foo {
pub fn foo() {}
}
mod a {
pub mod b {
use crate::foo::foo;
type Bar = isize;
}
pub mod sub {
use crate::a::b::*;
fn sub() -> Bar { 1 }
//~^ ERROR cannot find type `Bar` in this scope
}
}
mod m1 {
fn foo() {}
}
fn main() {
foo(); //~ ERROR expected function, found module `foo`
}