Test not never

Currently fails to build:

    error[E0600]: cannot apply unary operator `!` to type `!`
       --> library/core/tests/ops.rs:239:8
        |
    239 |     if !return () {}
        |        ^^^^^^^^^^ cannot apply unary operator `!`
This commit is contained in:
David Tolnay 2021-11-21 19:09:14 -08:00
parent cebd2dda1d
commit a4bff741d0
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -232,3 +232,9 @@ fn deref<U: Copy, T: Deref<Target = U>>(t: T) -> U {
let y = deref(&mut x);
assert_eq!(y, 4);
}
#[test]
#[allow(unreachable_code)]
fn test_not_never() {
if !return () {}
}