about summary refs log tree commit diff
path: root/tests/ui/unreachable-code/unreachable-bool-read-7246.rs
blob: 8bbaa1025493f05a381c4a492b48abf5c3ad1377 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#![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() {}

// https://github.com/rust-lang/rust/issues/7246