Closed
Description
This code compiles on nightly, but is rejected by stable and beta compilers.
On nightly items defined in a block are visible from all modules defined in this block.
Such "pervasive" visibility is quite unusual and I suspect it was introduced unintentionally.
fn f() {
struct S;
fn g() {
let s = S; // <- beta/stable/nightly - ok
}
mod m {
fn h() {
let s = S; // <- beta/stable - error: unresolved name `S` [E0425], nightly - ok
}
mod n {
fn k() {
let s = S; // <- beta/stable - error: unresolved name `S` [E0425], nightly - ok
}
}
}
}
fn main() {
}
cc @jseyfried
Metadata
Metadata
Assignees
Labels
No labels