]> git.lizzy.rs Git - rust.git/blob - tests/ui/cmp_null.rs
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / cmp_null.rs
1 #![feature(tool_lints)]
2
3 #![warn(clippy::cmp_null)]
4 #![allow(unused_mut)]
5
6 use std::ptr;
7
8 fn main() {
9     let x = 0;
10     let p : *const usize = &x;
11     if p == ptr::null() {
12         println!("This is surprising!");
13     }
14     let mut y = 0;
15     let mut m : *mut usize = &mut y;
16     if m == ptr::null_mut() {
17         println!("This is surprising, too!");
18     }
19 }