Closed
Description
Please consider the following code:
const CONSTANT: usize = 0;
mod ok {
use super::CONSTANT;
fn foobar() -> usize {
CONSTANT
}
}
mod error {
use super::*;
fn foobar() -> usize {
CONSTANT
}
}
The ok::foobar
compiles fine while error::foobar
generates the following error:
error[E0425]: unresolved name `CONSTANT`
--> test.rs:13:9
|
13 | CONSTANT
| ^^^^^^^^ unresolved name
This also affects static
.
Marking the constant pub
makes it compile as expected.
Meta
rustc 1.14.0-nightly (c59cb71d9 2016-10-26)
binary: rustc
commit-hash: c59cb71d976ceabf00c7da0224a795fab530601e
commit-date: 2016-10-26
host: x86_64-unknown-linux-gnu
release: 1.14.0-nightly
LLVM version: 3.9
1.12.1
is also affected.
Metadata
Metadata
Assignees
Labels
No labels