Skip to content

ICE src/librustc/hir/def.rs:139: attempted .def_id() on invalid def: Err #38556

Closed
@SimonSapin

Description

@SimonSapin

Test case:

fn main() {}

pub mod a {
    pub struct FontFamily;

    impl FontFamily {
        pub fn to_css(&self) -> ::std::fmt::Result {
            Ok(())
        }
    }
}

macro_rules! reexport {
    () => {
        mod b {
            pub use a;
        }
    }
}

reexport!();

pub mod c {
    use b::a::FontFamily;

    pub fn d(_x: &FontFamily) {}
}

Compiles successfully on 58d58c2, causes an ICE on 551cb06. Diff 58d58c2...551cb06 contains only #38171, CC @jseyfried, @nrc.

Found while trying to minimize #38535, but filed separately since the error message is different and this one has a small test case.

Metadata

Metadata

Assignees

Labels

I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-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