We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
super
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:
ok::foobar
error::foobar
error[E0425]: unresolved name `CONSTANT` --> test.rs:13:9 | 13 | CONSTANT | ^^^^^^^^ unresolved name
This also affects static.
static
Marking the constant pub makes it compile as expected.
pub
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.
1.12.1
The text was updated successfully, but these errors were encountered:
Actually, sorry, it seems that this isn't specific to constants; a wildcard doesn't import anything non-public.
Is this intended? I'd expect a * to expand to everything that is importable from a given scope, not only what is public.
*
Sorry, something went wrong.
The code will compile if you add #![feature(item_like_imports)] to the crate root.
#![feature(item_like_imports)]
After #37127 lands, item_like_imports will become a default and the code will work without any features.
item_like_imports
feature
@petrochenkov I see; thanks!
Sorry for the duplicate bug! I did try to search for duplicates, but it seems that my search-fu wasn't strong enough.
@koute: you can still close it. 🙂
No branches or pull requests
Please consider the following code:
The
ok::foobar
compiles fine whileerror::foobar
generates the following error:This also affects
static
.Marking the constant
pub
makes it compile as expected.Meta
1.12.1
is also affected.The text was updated successfully, but these errors were encountered: