Open
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