-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
internal compiler error: compiler/rustc_monomorphize/src/collector.rs:1038:9: no MIR available for DefId #115052
Comments
Hoisting the inline structure initialisation into Diff
|
Also reproduces in |
$ cat a.rs
pub static G: &fn() = &F;
pub(crate) static F: fn() = f;
fn f() {}
$ cat b.rs
pub static H: fn() = *a::G;
$ rustc --edition=2021 --crate-type=lib a.rs
$ rustc --edition=2021 --crate-type=lib b.rs -L. --extern a The implementation here should probably also recurse into rust/compiler/rustc_passes/src/reachable.rs Lines 101 to 106 in b131feb
|
@tmiasko I can confirm that the ICE goes away with the suggested patch. |
Possibly related -- while this made the ICE go away, the code when compiled in mysterious link error
Naively -- with no understanding of rustc internals -- it feels like a reachability pass that doesn't find these values won't emit them into the library? Slapping some extra |
Code
Sorry, haven't tried to minimise this yet. The repro steps are here:
Meta
rustc --version --verbose
:Also reproduces in
rustc 1.74.0-nightly (5c6a7e71c 2023-08-20)
Error output
Backtrace
The text was updated successfully, but these errors were encountered: