-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code:
extern crate libc as usize;
extern crate libc as Option;
#[usize::inner] //~ ERROR could not find `inner` in `usize`
fn foo() {}
fn bar() -> usize { 0 } // OK
fn baz() -> Option<T> { 0 } //~ ERROR type arguments not allowed on crate
I expected to see this happen: usize
and Option
should both consistently resolve to the crate, or they should consistently resolve to the builtin type.
Instead, this happened: In return position, usize
resolves to the builtin type and Option
resolves to the crate.
In attribute position, usize
resolves to the crate (which seems reasonable, because associated macros aren't a thing.)
Meta
rustc --version --verbose
: 1.87.0-nightly (2025-03-28 920d95eaf23d7eb6b415)
@rustbot label A-resolve
esoterra
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.