diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-7246.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-7246.rs b/src/test/ui/issues/issue-7246.rs new file mode 100644 index 000000000..7b16fa024 --- /dev/null +++ b/src/test/ui/issues/issue-7246.rs @@ -0,0 +1,11 @@ +#![deny(unreachable_code)] +#![allow(dead_code)] + +use std::ptr; +pub unsafe fn g() { + return; + if *ptr::null() {}; //~ ERROR unreachable + //~| WARNING dereferencing a null pointer +} + +pub fn main() {} |