We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62f7cf4 commit 784b283Copy full SHA for 784b283
tests/crashes/nested_type_ascription.rs
@@ -0,0 +1,20 @@
1
+// Regression test for <https://github.com/rust-lang/rust/issues/149542>.
2
+//
3
+// This checks that a nested type ascription doesn't cause a crash when the
4
+// compiler checks if it constitutes a read of the never type.
5
6
+//@ known-bug: #149542
7
+
8
+#![feature(never_type)]
9
+#![feature(type_ascription)]
10
+#![deny(unreachable_code)]
11
12
+fn main() {
13
+ unsafe {
14
+ let _ = type_ascribe!(type_ascribe!(*std::ptr::null(), !), _);
15
16
+ // this is *not* unreachable, because previous line does not actually read the never type
17
+ ();
18
+ }
19
+}
20
0 commit comments