Change:
UPDATE: MCVE can be found . Nightly compilation error due to rustc bug I tried this code: I expected to see this happen: explanation Successful compilation. Instead, this happened: tells to report a bug, see backtrace. : Reproduce with (1st update) <details<summaryBacktrace</summary<p</p</details
cc
Also occured with
I'm getting this when I try to repro: On a side note, are there any cargo feature flags I can pass to cut down on how much stuff is being compiled? Compiling 900 crates to get a repo is quite a lot
Also occured with just now.
mmh try with commit hash ? (for )
updated script:
Yeah, sorry for that. One of the difficulties of working with a big framework like Substrate. I'll see if I can narrow it down more.
That did it! Thank you
Some with the same issue (a different chain also using Substrate) found out that apparently works.
Seems is the cause, marking as .
Here's a smaller repro (at least in terms of how much code is built: 33 crates instead of a few hundred):
just confirmed that it does not occur with
I have a minimal repro:
Wild guess: erases the local before we are able to emit the diagnostic message.
I seem to be getting a similar error again on a more current nightly (). Should I open a new issue or do we just reopen this one?
This is still broken. I'm pretty confused because running the test you in on the shows that it ICEs. Is the test not actually working for some reason? Edit: Does that test need in order to actually check the body of those functions since they are uncalled from ?
Assigning as and removing I-prioritize.
Hi and have either of you had a chance to upgrade to a recently nightly? I just wanted to confirm this is fixed for you.
I've updated to rust version 1.47.0-nightly ( 2020-07-22), and tried compiling the crate which was triggering this ICE (). I no longer encounter an ICE, the crate compiles successfully.
I can confirm is not throwing ICE :+1:
Great, thank you!

Discussion:
lint: &'static lint::Lint, source_info: SourceInfo, message: &'static str, <del> panic: AssertKind<ConstInt>, </del> <ins> panic: AssertKind<impl std::fmt::Debug>, </ins> ) -> Option<()> { let lint_root = self.lint_root(source_info)?; self.tcx.struct_span_lint_hir(lint, lint_root, source_info.span, |lint| {

let expected = ScalarMaybeUninit::from(Scalar::from_bool(*expected)); let value_const = self.ecx.read_scalar(value).unwrap(); if expected != value_const { <ins> enum DbgVal<T> { Val(T), Underscore, } impl<T: std::fmt::Debug> std::fmt::Debug for DbgVal<T> { fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::Val(val) => val.fmt(fmt), Self::Underscore => fmt.write_str("_"), } } } </ins> let mut eval_to_int = |op| { <del> let op = self .eval_operand(op, source_info) .expect("if we got here, it must be const"); self.ecx.read_immediate(op).unwrap().to_const_int() </del> <ins> // This can be `None` if the lhs wasn't const propagated and we just // triggered the assert on the value of the rhs. match self.eval_operand(op, source_info) { Some(op) => { DbgVal::Val(self.ecx.read_immediate(op).unwrap().to_const_int()) } None => DbgVal::Underscore, } </ins> }; let msg = match msg { AssertKind::DivisionByZero(op) => {

// check-pass <ins> // compile-flags: --crate-type lib #![warn(unconditional_panic)] </ins> pub struct Fixed64(i64); <del> pub fn div(f: Fixed64) { f.0 / 0; </del> <ins> // HACK: this test passes only because this is a const fn that is written to metadata pub const fn div(f: Fixed64) { f.0 / 0; //~ WARN will panic at runtime </ins> } <del> fn main() {} </del>

<ins> warning: this operation will panic at runtime --> $DIR/ice-assert-fail-div-by-zero.rs:11:5 | LL |     f.0 / 0; |     ^^^^^^^ attempt to divide _ by zero | note: the lint level is defined here --> $DIR/ice-assert-fail-div-by-zero.rs:5:9 | LL | #![warn(unconditional_panic)] |         ^^^^^^^^^^^^^^^^^^^ warning: 1 warning emitted </ins>