-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
regression: ICE -- bad ConstKind after monomorphizing #94502
Comments
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 |
Sounds 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 So you can probably confirm that nightly was broken between #93691 landing ( EDIT: heh, @lcnr already opened the fix/backport PR as I was writing this. |
[beta] backport fix for rust-lang#94502 this issue was fixed as part of rust-lang#93368, so i extracted the change from there closes rust-lang#94502
…askrgr Rollup of 4 pull requests Successful merges: - rust-lang#94553 (add tests for rust-lang#94502) - rust-lang#94614 (Remove ordering traits from `rustc_span::hygiene::LocalExpnId`) - rust-lang#94685 (interpret: move saturating_add/sub into (pub) helper method) - rust-lang#94688 (Erase regions when checking for missing Copy predicates) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Should be fixed by #94552. |
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):
The text was updated successfully, but these errors were encountered: