Skip to content

Commit 948d10b

Browse files
committed
add one more test for type ascription of never
1 parent e5a7988 commit 948d10b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)