diff options
| author | AliƩnore Bouttefeux <alienore.bouttefeux@gmail.com> | 2021-04-10 16:17:09 +0200 |
|---|---|---|
| committer | AliƩnore Bouttefeux <alienore.bouttefeux@gmail.com> | 2021-04-10 16:17:09 +0200 |
| commit | 7f0f83a26fdec4caa2a8512f9fc611d504b7aad2 (patch) | |
| tree | a3a4dc79647de1992624856a0cf17f24f4b63296 | |
| parent | c288414757975874005f45b4bcb5c5d50cbe227a (diff) | |
| download | rust-7f0f83a26fdec4caa2a8512f9fc611d504b7aad2.tar.gz rust-7f0f83a26fdec4caa2a8512f9fc611d504b7aad2.zip | |
remove redundant test
| -rw-r--r-- | src/test/ui/lint/lint-deref-nullptr.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/lint/lint-deref-nullptr.stderr | 26 |
2 files changed, 12 insertions, 20 deletions
diff --git a/src/test/ui/lint/lint-deref-nullptr.rs b/src/test/ui/lint/lint-deref-nullptr.rs index 1dc54a5622b..d052dbd9b64 100644 --- a/src/test/ui/lint/lint-deref-nullptr.rs +++ b/src/test/ui/lint/lint-deref-nullptr.rs @@ -24,14 +24,12 @@ fn f() { //~^ ERROR dereferencing a null pointer let ub = &*ptr::null::<i32>(); //~^ ERROR dereferencing a null pointer + let ub = &*ptr::null_mut::<i32>(); + //~^ ERROR dereferencing a null pointer ptr::addr_of!(*ptr::null::<i32>()); //~^ ERROR dereferencing a null pointer ptr::addr_of_mut!(*ptr::null_mut::<i32>()); //~^ ERROR dereferencing a null pointer - let ub = *ptr::null::<i32>(); - //~^ ERROR dereferencing a null pointer - let ub = *ptr::null_mut::<i32>(); - //~^ ERROR dereferencing a null pointer let offset = ptr::addr_of!((*ptr::null::<Struct>()).field); //~^ ERROR dereferencing a null pointer } diff --git a/src/test/ui/lint/lint-deref-nullptr.stderr b/src/test/ui/lint/lint-deref-nullptr.stderr index 40fdfad2368..c6f432e4e42 100644 --- a/src/test/ui/lint/lint-deref-nullptr.stderr +++ b/src/test/ui/lint/lint-deref-nullptr.stderr @@ -41,34 +41,28 @@ LL | let ub = &*ptr::null::<i32>(); | ^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed error: dereferencing a null pointer - --> $DIR/lint-deref-nullptr.rs:27:23 + --> $DIR/lint-deref-nullptr.rs:27:19 + | +LL | let ub = &*ptr::null_mut::<i32>(); + | ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed + +error: dereferencing a null pointer + --> $DIR/lint-deref-nullptr.rs:29:23 | LL | ptr::addr_of!(*ptr::null::<i32>()); | ^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed error: dereferencing a null pointer - --> $DIR/lint-deref-nullptr.rs:29:27 + --> $DIR/lint-deref-nullptr.rs:31:27 | LL | ptr::addr_of_mut!(*ptr::null_mut::<i32>()); | ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed error: dereferencing a null pointer - --> $DIR/lint-deref-nullptr.rs:31:18 - | -LL | let ub = *ptr::null::<i32>(); - | ^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed - -error: dereferencing a null pointer - --> $DIR/lint-deref-nullptr.rs:33:18 - | -LL | let ub = *ptr::null_mut::<i32>(); - | ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed - -error: dereferencing a null pointer - --> $DIR/lint-deref-nullptr.rs:35:36 + --> $DIR/lint-deref-nullptr.rs:33:36 | LL | let offset = ptr::addr_of!((*ptr::null::<Struct>()).field); | ^^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed -error: aborting due to 11 previous errors +error: aborting due to 10 previous errors |
