Skip to content

Commit

Permalink
Add regression test for issue 120600
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Apr 19, 2024
1 parent c4f112a commit 662d276
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/ui/never_type/eq-never-types.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//@ known-bug: #120600
//
// issue: rust-lang/rust#120600

//@ failure-status: 101
//@ normalize-stderr-test: "DefId\(.*?\]::" -> "DefId("
//@ normalize-stderr-test: "(?m)note: we would appreciate a bug report.*\n\n" -> ""
//@ normalize-stderr-test: "(?m)note: rustc.*running on.*\n\n" -> ""
//@ normalize-stderr-test: "(?m)note: compiler flags.*\n\n" -> ""
//@ normalize-stderr-test: "(?m)note: delayed at.*$" -> ""
//@ normalize-stderr-test: "(?m)^ *\d+: .*\n" -> ""
//@ normalize-stderr-test: "(?m)^ *at .*\n" -> ""

#![allow(internal_features)]
#![feature(never_type, rustc_attrs)]
#![rustc_never_type_options(fallback = "never")]

fn ice(a: !) {
a == a;
}

fn main() {}
20 changes: 20 additions & 0 deletions tests/ui/never_type/eq-never-types.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: broken MIR in DefId(ice) (Terminator { source_info: SourceInfo { span: $DIR/eq-never-types.rs:19:5: 19:11 (#0), scope: scope[0] }, kind: _3 = <! as PartialEq>::eq(move _4, move _5) -> [return: bb1, unwind: bb2] }): bad arg #0 (&'?4 ! <- !): NoSolution
--> $DIR/eq-never-types.rs:19:10
|
LL | a == a;
| ^
|

--> $DIR/eq-never-types.rs:19:10
|
LL | a == a;
| ^

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

query stack during panic:
end of query stack

0 comments on commit 662d276

Please sign in to comment.