Skip to content

Reported path for unresolved named imports is wrong #2123

@brson

Description

@brson
Contributor
// error-pattern:unresolved import: m::f
import x = m::f;

mod m {
}

fn main() {
}
../src/test/compile-fail/unresolved-named-import.rs:2:7: 2:16 error: unresolved import: m::x
../src/test/compile-fail/unresolved-named-import.rs:2 import x = m::f;

The error says we failed to resolve m::x but that is incorrect. We failed to resolve x, we failed to find m::f, and m::x doesn't identify a real thing.

Activity

ghost assigned on Apr 5, 2012
catamorphism

catamorphism commented on Jun 22, 2012

@catamorphism
Contributor

Test after #1935 is done.

bstrie

bstrie commented on Jul 16, 2012

@bstrie
Contributor

The example file no longer fails to compile, although shouldn't it? After all, there's still nothing named m::f for it to import.

catamorphism

catamorphism commented on Jul 16, 2012

@catamorphism
Contributor

Yes, it should fail to compile, so there's a different bug now.

added a commit that references this issue on Aug 15, 2012
catamorphism

catamorphism commented on Dec 7, 2012

@catamorphism
Contributor

This test passes now.

added a commit that references this issue on Dec 30, 2024
added a commit that references this issue on Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @marijnh@brson@pcwalton@catamorphism@bstrie

      Issue actions

        Reported path for unresolved named imports is wrong · Issue #2123 · rust-lang/rust