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 e5a7988 commit 948d10bCopy full SHA for 948d10b
tests/ui/unreachable-code/type_ascribe_never_field.rs
@@ -0,0 +1,17 @@
1
+// Regression test for <https://github.com/rust-lang/rust/issues/149431>
2
+//
3
+// Checks that type ascription of a field place with type never is correctly
4
+// checked for if it constitutes a read of type never. (it doesn't)
5
6
+//@ check-pass
7
+
8
+#![feature(never_type)]
9
+#![feature(type_ascription)]
10
+#![deny(unreachable_code)]
11
12
+fn main() {
13
+ let x: (!,);
14
+ let _ = type_ascribe!(x.0, _);
15
16
+ (); // reachable
17
+}
0 commit comments