Skip to content
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

const-eval ICE: allocation missing in dead_alloc_map #55287

Closed
pnkfelix opened this issue Oct 23, 2018 · 5 comments · Fixed by #55262
Closed

const-eval ICE: allocation missing in dead_alloc_map #55287

pnkfelix opened this issue Oct 23, 2018 · 5 comments · Fixed by #55262
Labels
A-const-eval Area: Constant evaluation (MIR interpretation) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pnkfelix
Copy link
Member

Spawned off of @oli-obk 's example on #55223:

play

#![feature(const_let)]

union Foo<'a> {
    y: &'a (),
    long_live_the_unit: &'static (),
}

const FOO: &() = {
    let y = ();
    unsafe { Foo { y: &y }.long_live_the_unit }
};

fn main() {
}
@pnkfelix pnkfelix changed the title const-eval allocation missing in dead_alloc_map const-eval ICE: allocation missing in dead_alloc_map Oct 23, 2018
@pnkfelix pnkfelix added A-const-eval Area: Constant evaluation (MIR interpretation) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Oct 23, 2018
@pnkfelix
Copy link
Member Author

@oli-obk to be clear: we don't need to use feature(const_let) to reproduce the problem, right? I.e. hypothetically examples exist that don't use that feature?

In particular I know this problem is in some way related to #55288, which is definitely a true regression of stable code.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 25, 2018

Right, this here is not really a regression. It is just an ICE that should be an error and it is fixed by #55262

We can probably do this without const_let, but I couldn't come up with an example.

@oli-obk oli-obk removed the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Oct 25, 2018
@kornelski
Copy link
Contributor

A user is reporting the same ICE in simplewiki crate

@sighol
Copy link

sighol commented Oct 26, 2018

I have tried to reduce the problem. This repository is smaller, but still fails on nightly-2018-10-25: rustc-panic-dead_alloc_map. The same crate builds on stable.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 26, 2018

I think you are encountering #55288 which has a fix in #55385 (making everything work again)

This issue is different, even though the symptom is the same right now. When this issue is fixed (via #55262), the ICE will become a hard error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: Constant evaluation (MIR interpretation) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants