Repository navigation
regression: ICE -- bad ConstKind after monomorphizing #94502
Copy link
Copy link
Closed
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Milestone
Description
Activity
- addedI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
on Mar 1, 2022 - addedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Mar 1, 2022 Reduced a bit from https://github.com/deaz/adventofcode-2018:
use std::collections::HashMap; pub fn f(input: &str) { input .lines() .map(|s| -> (u32) { (1) }) .fold(HashMap::new(), |mut map, (x)| { let prev = map.get(&(0, x)).unwrap_or(&0); map.insert((0, x), prev + 1); map }); } pub fn main() { let _ = f(""); }
This crashes on beta but not on stable or nightly.
minimalized
struct Repro; impl Repro { fn get(&self) -> &i32 { &3 } fn insert(&mut self, _: i32) {} } fn main() { let x = &0; let mut conflict = Repro; let prev = conflict.get(); conflict.insert(*prev + *x); }
the issue is that
body.tainted_by_errorsis also set when only emitting a lintSounds like this comment might be relevant: #93368 (comment) - i.e. that PR ended up doing a drive-by fix because conflating errors and warnings became a type mismatch at the
DiagnosticBuilderlevel.So you can probably confirm that nightly was broken between #93691 landing (
nightly-2022-02-13?) and #93368 landing (nightly-2022-02-26?), and I guess beta branched between the two?EDIT: heh, @lcnr already opened the fix/backport PR as I was writing this.
- added a commit that references this issue
on Mar 7, 2022 Should be fixed by #94552.
- removedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Apr 6, 2022
Metadata
Metadata
Assignees
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Crater picked up this issue in a number of crates:
May be a duplicate of #93002, but filing this as a dedicated bug with a rough list of affected crates in Crater.
ty::ConstKind::Error constructed but no error reported (we should check, may be a distinct bug; maybe #94506):