Skip to content

Commit a4bff74

Browse files
committed
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 `!`
1 parent cebd2dd commit a4bff74

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/core/tests/ops.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,9 @@ fn deref_on_ref() {
232232
let y = deref(&mut x);
233233
assert_eq!(y, 4);
234234
}
235+
236+
#[test]
237+
#[allow(unreachable_code)]
238+
fn test_not_never() {
239+
if !return () {}
240+
}

0 commit comments

Comments
 (0)