Skip to content

regression in namespace lookups #3897

Closed
@Blub

Description

@Blub

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);
//          ^~~~~~~~~~~~~
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions