summary refs log tree commit diff
path: root/src/test/ui/derived-errors
diff options
context:
space:
mode:
authorLzu Tao <taolzu@gmail.com>2019-06-17 10:52:37 +0000
committerLzu Tao <taolzu@gmail.com>2019-06-17 10:52:46 +0000
commit7d69d4ced23c446d6af341e3f9dc031a302150fc (patch)
tree1d59692c2766091896112e5c4dac1b4f5c8fb02f /src/test/ui/derived-errors
parent70456a6cbd67c0547d22997007afaaed0819767e (diff)
downloadrust-7d69d4ced23c446d6af341e3f9dc031a302150fc.tar.gz
rust-7d69d4ced23c446d6af341e3f9dc031a302150fc.zip
Make use of `ptr::null(_mut)` instead of casting zero
Diffstat (limited to 'src/test/ui/derived-errors')
-rw-r--r--src/test/ui/derived-errors/issue-31997.rs2
-rw-r--r--src/test/ui/derived-errors/issue-31997.stderr2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ui/derived-errors/issue-31997.rs b/src/test/ui/derived-errors/issue-31997.rs
index 025e9100e23..cfdee26c559 100644
--- a/src/test/ui/derived-errors/issue-31997.rs
+++ b/src/test/ui/derived-errors/issue-31997.rs
@@ -10,7 +10,7 @@ fn closure<F, T>(x: F) -> Result<T, ()>
 }
 
 fn foo() -> Result<(), ()> {
-    try!(closure(|| bar(0 as *mut _))); //~ ERROR cannot find function `bar` in this scope
+    try!(closure(|| bar(core::ptr::null_mut()))); //~ ERROR cannot find function `bar` in this scope
     Ok(())
 }
 
diff --git a/src/test/ui/derived-errors/issue-31997.stderr b/src/test/ui/derived-errors/issue-31997.stderr
index dbceba046e2..e9fe0d3971e 100644
--- a/src/test/ui/derived-errors/issue-31997.stderr
+++ b/src/test/ui/derived-errors/issue-31997.stderr
@@ -1,7 +1,7 @@
 error[E0425]: cannot find function `bar` in this scope
   --> $DIR/issue-31997.rs:13:21
    |
-LL |     try!(closure(|| bar(0 as *mut _)));
+LL |     try!(closure(|| bar(core::ptr::null_mut())));
    |                     ^^^ not found in this scope
 
 error: aborting due to previous error