Change:
<!-- [31mICE[0m: Rustc '' 'error: internal compiler error: broken MIR in DefId(0:20 ~ o[fbbd]::{impl}::eq) (Terminator { sourceinfo: SourceInfo { span: 7:10 (), scope: scope[3] }, kind: 21 = <! as PartialEq::eq(move 22, move 23) -[return: bb9, unwind: bb18] }): bad arg (&'?38 ! <- !): NoSolution', 'error: internal compiler error: broken MIR in DefId(0:20 ~ o[fbbd]::{impl}::eq) (Terminator { sourceinfo: SourceInfo { span: 7:10 (), scope: scope[3] }, kind: 21 = <! as PartialEq::eq(move 22, move 23) -[return: bb9, unwind: bb18] }): bad arg (&'?38 ! <- !): NoSolution' File: --snippet: Version information Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongProgram output</strong</summary<p</p</details<!-- query stack: error: internal compiler error: broken MIR in DefId(0:20 ~ mvce[954a]::{impl}::eq) (Terminator { sourceinfo: SourceInfo { span: 7:10 (), scope: scope[3] }, kind: 21 = <! as PartialEq::eq(move 22, move _23) -[return: bb9, unwind: bb18] }): bad arg (&'?38 ! <- !): NoSolution --
Regression in nightly-2023-05-23 commit[0] 2023-05-21: Auto merge of - MU001999:fix/issue-, r=cjgillot commit[1] 2023-05-21: Auto merge of - Zoxc:query-structs-trim, r=cjgillot commit[2] 2023-05-22: Auto merge of - lukas-code:strike, r=notriddle commit[3] 2023-05-22: Auto merge of - the8472:filter-map-chunk, r=thomcc commit[4] 2023-05-22: Auto merge of - matthiaskrgr:rollup-qd4b2vu, r=matthiaskrgr commit[5] 2023-05-22: Auto merge of - Jules-Bertholet:document-pin-layout, r=thomcc commit[6] 2023-05-22: Auto merge of - compiler-errors:triple-check, r=Nilstrieb commit[7] 2023-05-22: Auto merge of - marc0246:arc-new-uninit-bloat, r=thomcc commit[8] 2023-05-22: Auto merge of - lcnr:recursion-depth, r=matthewjasper commit[9] 2023-05-22: Auto merge of - Dylan-DPC:rollup-7jqydzg, r=Dylan-DPC ERROR: no CI builds available between and within last 167 days cc
Minimized:
Minimized even more: (I independently found the same bug while running crater with the fallback being )

Discussion:
} Entry::Occupied(mut entry) => { debug!(" - composing on top of {:?}", entry.get()); <del> match (&entry.get()[..], &adj[..]) { // Applying any adjustment on top of a NeverToAny // is a valid NeverToAny adjustment, because it can't // be reached. (&[Adjustment { kind: Adjust::NeverToAny, .. }], _) => return, </del> <ins> match (&mut entry.get_mut()[..], &adj[..]) { </ins> ( <del> &[ </del> <ins> [Adjustment { kind: Adjust::NeverToAny, target }], &[.., Adjustment { target: new_target, .. }], ) => { // NeverToAny coercion can target any type, so instead of adding a new // adjustment on top we can change the target. // // This is required for things like `a == a` (where `a: !`) to produce // valid MIR -- we need borrow adjustment from things like `==` to change // the type to `&!` (or `&()` depending on the fallback). This might be // relevant even in unreachable code. *target = new_target; } ( &mut [ </ins> Adjustment { kind: Adjust::Deref(_), .. }, Adjustment { kind: Adjust::Borrow(AutoBorrow::Ref(..)), .. }, ],

.., // Any following adjustments are allowed. ], ) => { <del> // A reborrow has no effect before a dereference. </del> <ins> // A reborrow has no effect before a dereference, so we can safely replace adjustments. *entry.get_mut() = adj; </ins> } <del> // FIXME: currently we never try to compose autoderefs // and ReifyFnPointer/UnsafeFnPointer, but we could. </del> _ => { <ins> // FIXME: currently we never try to compose autoderefs // and ReifyFnPointer/UnsafeFnPointer, but we could. </ins> self.dcx().span_delayed_bug( expr.span, format!(

adj ), ); <ins> *entry.get_mut() = adj; </ins> } } <del> *entry.get_mut() = adj; </del> } }

<del> //@ known-bug: #120600 #![feature(never_type, never_type_fallback)] enum E { Bar(!) } fn f(a: &E, b: &E) { match (a, b) { (E::Bar(a), E::Bar(b)) => { *a == *b; } _ => {} } } pub fn main() {} </del>

<del> //@ known-bug: #120600 #![feature(never_type)] #![feature(never_type_fallback)] #[derive(Ord, Eq, PartialOrd, PartialEq)] enum E { Foo, Bar(!, i32, i32), } fn main() {} </del>

<ins> // MIR for `_f` after built fn _f(_1: !, _2: !) -> () { debug a => _1; debug b => _2; let mut _0: (); let mut _3: !; let _4: bool; let mut _5: &(); let mut _6: !; let mut _7: &(); let _8: (); let mut _9: !; bb0: { StorageLive(_4); StorageLive(_5); StorageLive(_6); _6 = _1; unreachable; } bb1: { StorageDead(_6); StorageLive(_7); StorageLive(_8); StorageLive(_9); _9 = _2; unreachable; } bb2: { _7 = &_8; StorageDead(_9); _4 = <() as PartialEq>::eq(move _5, move _7) -> [return: bb3, unwind: bb5]; } bb3: { StorageDead(_7); StorageDead(_5); StorageDead(_8); StorageDead(_4); unreachable; } bb4: { return; } bb5 (cleanup): { resume; } } </ins>

<ins> // skip-filecheck #![feature(never_type)] #![allow(unreachable_code)] // EMIT_MIR eq_never_type._f.built.after.mir fn _f(a: !, b: !) { // Both arguments must be references (i.e. == should auto-borrow/coerce-to-ref both arguments) // (this previously was buggy due to `NeverToAny` coercion incorrectly throwing out other // coercions) a == b; } fn main() {} </ins>

<ins> //@ check-pass // // issue: rust-lang/rust#120600 #![allow(internal_features)] #![feature(never_type, rustc_attrs)] #![rustc_never_type_options(fallback = "never")] fn ice(a: !) { a == a; } fn main() {} </ins>