add one more test for type ascription of never
This commit is contained in:
parent
ef271404d4
commit
bf0970f0fa
1 changed files with 17 additions and 0 deletions
17
tests/ui/reachable/type_ascribe_never_field.rs
Normal file
17
tests/ui/reachable/type_ascribe_never_field.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Regression test for <https://github.com/rust-lang/rust/issues/149431>
|
||||
//
|
||||
// Checks that type ascription of a field place with type never is correctly
|
||||
// checked for if it constitutes a read of type never. (it doesn't)
|
||||
//
|
||||
//@ check-pass
|
||||
|
||||
#![feature(never_type)]
|
||||
#![feature(type_ascription)]
|
||||
#![deny(unreachable_code)]
|
||||
|
||||
fn main() {
|
||||
let x: (!,);
|
||||
let _ = type_ascribe!(x.0, _);
|
||||
|
||||
(); // reachable
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue