Skip to content

no MIR available ICE instead of an ambiguity error #115380

Closed
@tmiasko

Description

@tmiasko

I tried this code:

a.rs:

pub use a::*;
mod a {
    pub use a::*;
    pub use b::*;
    mod a {
        pub fn f() {}
    }
    mod b {
        pub fn f() {}
    }
}

b.rs:

pub fn main() {
    a::f();
}
rustc a.rs --edition=2018 --crate-type=lib
rustc b.rs --edition=2018 --crate-type=lib -L. --extern a

I expected it to fail with an ambiguity error, instead it ICEs.

The code compiles successfully in 1.72.

Since #113099 it generates an ICE (it seems that now when an ambiguity is detected, the processing is not fully finalized and effective visibilities and reachability is incomplete).

Reporting primarily due to the fact that the future incompatibility for ambiguous glob imports is not enabled by default for dependencies #114095 (comment), which hides the root cause of the issue.

Error output

error: internal compiler error: compiler/rustc_monomorphize/src/collector.rs:963:9: no MIR available for DefId(20:8 ~ a[024e]::a::a::f)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions