-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
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
meta not indicated as reserved crate name when shadowing module #73948
Comments
@rustbot claim |
Error: Parsing assign command in comment failed: ...'tbot claim' | error: expected end of command at >| ' ?'... Please let |
@rustbot claim |
It's not forbidden as a module name, this obviously works: mod meta {
pub struct Thing;
}
use crate::meta::Thing; I think the confusion arises from that fact that this works without mod foo {
pub struct Thing;
}
use foo::Thing; But those are uniform imports (or at least I think that's what they're called), and only resolve to the surrounding scope if unambiguous (which it is for I'm guessing the right fix here is to add more information to the error suggesting that if the intention wasn't to refer to a crate, (EDIT: I went to the internals thread to reply, and it's from March 2019 apparently, and also |
I believe the Also, now you know how deep my backlog of todo items is. |
Taken from this internals thread: https://internals.rust-lang.org/t/is-the-module-name-meta-forbidden/9587
A module named
meta
is shadowed leading to misleading error messages.meta
was reserved as a built-in crate name in 2018 edition, but the error message does not indicate this.I tried this code:
Above code compiled with
rustc --edition 2018 {file}
This is expected to indicated that
meta
is a reserved crate name.Instead, the following error is reported:
Meta
rustc --version --verbose
:This issue has been assigned to @Chocol4te via this comment.
The text was updated successfully, but these errors were encountered: