Skip to content

Commit 1da9364

Browse files
committed
Add regression test for issue 120600
1 parent 5958f5e commit 1da9364

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

tests/ui/never_type/eq-never-types.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ known-bug: #120600
2+
//
3+
// Regression test for <https://github.com/rust-lang/rust/issues/120600>.
4+
5+
//@ failure-status: 101
6+
//@ normalize-stderr-test: "DefId\(.*?\]::" -> "DefId("
7+
//@ normalize-stderr-test: "(?m)note: we would appreciate a bug report.*\n\n" -> ""
8+
//@ normalize-stderr-test: "(?m)note: rustc.*running on.*\n\n" -> ""
9+
//@ normalize-stderr-test: "(?m)note: compiler flags.*\n\n" -> ""
10+
//@ normalize-stderr-test: "(?m)note: delayed at.*$" -> ""
11+
//@ normalize-stderr-test: "(?m)^ *\d+: .*\n" -> ""
12+
//@ normalize-stderr-test: "(?m)^ *at .*\n" -> ""
13+
14+
#![allow(internal_features)]
15+
#![feature(never_type, rustc_attrs)]
16+
#![rustc_never_type_options(fallback = "never")]
17+
18+
fn ice(a: !) {
19+
a == a;
20+
}
21+
22+
fn main() {}
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
note: no errors encountered even though delayed bugs were created
2+
3+
note: those delayed bugs will now be shown as internal compiler errors
4+
5+
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
6+
--> $DIR/eq-never-types.rs:19:10
7+
|
8+
LL | a == a;
9+
| ^
10+
|
11+
12+
--> $DIR/eq-never-types.rs:19:10
13+
|
14+
LL | a == a;
15+
| ^
16+
17+
note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly
18+
19+
query stack during panic:
20+
end of query stack

0 commit comments

Comments
 (0)