Fix tests

This commit is contained in:
Yuki Okushi 2019-01-15 18:02:46 +09:00
parent b39e9e2d07
commit bd1551e46e
4 changed files with 13 additions and 34 deletions

View File

@ -2,7 +2,7 @@
#![feature(allow_internal_unsafe)]
#[allow_internal_unsafe]
//~^ ERROR: cannot use `allow_internal_unsafe` with `forbid(unsafe_code)`
//~^ ERROR: `allow_internal_unsafe` allows defining
macro_rules! evil {
($e:expr) => {
unsafe {

View File

@ -1,4 +1,4 @@
error: cannot use `allow_internal_unsafe` with `forbid(unsafe_code)`
error: `allow_internal_unsafe` allows defining macros using unsafe without triggering the `unsafe_code` lint at their call site
--> $DIR/lint-forbid-internal-unsafe.rs:4:1
|
LL | #[allow_internal_unsafe]

View File

@ -27,9 +27,7 @@ unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait
trait Baz {
unsafe fn baz(&self); //~ ERROR: declaration of an `unsafe` method
unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
//~^ ERROR: declaration of an `unsafe` method
unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
//~^ ERROR: declaration of an `unsafe` method
}
impl Baz for Bar {
@ -65,7 +63,6 @@ trait C {
#[allow(unsafe_code)]
unsafe fn baz(&self);
unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
//~^ ERROR: declaration of an `unsafe` method
}
impl C for Bar {

View File

@ -28,74 +28,56 @@ error: declaration of an `unsafe` method
LL | unsafe fn baz(&self); //~ ERROR: declaration of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^
error: declaration of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:29:5
|
LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:29:5
|
LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: declaration of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:31:5
error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:30:5
|
LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:31:5
|
LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:36:5
--> $DIR/lint-unsafe-code.rs:34:5
|
LL | unsafe fn baz(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:37:5
--> $DIR/lint-unsafe-code.rs:35:5
|
LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:56:5
--> $DIR/lint-unsafe-code.rs:54:5
|
LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: declaration of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:67:5
error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:65:5
|
LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:67:5
--> $DIR/lint-unsafe-code.rs:71:5
|
LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:74:5
|
LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:78:5
--> $DIR/lint-unsafe-code.rs:75:5
|
LL | unsafe fn baz(&self) {} //~ ERROR: implementation of an `unsafe` method
| ^^^^^^^^^^^^^^^^^^^^^^^
error: usage of an `unsafe` block
--> $DIR/lint-unsafe-code.rs:89:5
--> $DIR/lint-unsafe-code.rs:86:5
|
LL | unsafe {} //~ ERROR: usage of an `unsafe` block
| ^^^^^^^^^
@ -109,5 +91,5 @@ LL | unsafe {} //~ ERROR: usage of an `unsafe` block
LL | unsafe_in_macro!()
| ------------------ in this macro invocation
error: aborting due to 17 previous errors
error: aborting due to 14 previous errors