Skip to content

regression in namespace lookups #3897

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

Closed
Blub opened this issue Nov 1, 2012 · 1 comment
Closed

regression in namespace lookups #3897

Blub opened this issue Nov 1, 2012 · 1 comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Milestone

Comments

@Blub
Copy link

Blub commented Nov 1, 2012

Current master errors when there's a type with the same name as a module. The following used to compile fine on previous versions (including 0.4 and a little later):

use  myfloat = core::f32;
type myfloat = f32;   // without this
fn foo() -> myfloat { // this errors with: found typename used as variable
//          ^~~~~~~
    3_f32;
}
// but when adding it I get:
// error: unresolved name
// error: use of undeclared module 'myfloat'
// error: unresolved name myfloat::sqrt
// at the y = line

fn main() {
    let x: f32 = 3_f32;
    let y = myfloat::sqrt(x);
//          ^~~~~~~~~~~~~
}
@catamorphism
Copy link
Contributor

This is the intended behavior. 91ae541 merged the type and module namespaces.

However, this should be documented. I'll open a separate bug.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Sep 22, 2024
Use `@only-target` in SSE and SSE2 tests too

It looks cleaner and makes it consistent with other X86 tests.

The huge diffs are mostly indentation changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Projects
None yet
Development

No branches or pull requests

2 participants