mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +00:00
Fix tests
This commit is contained in:
parent
b39e9e2d07
commit
bd1551e46e
@ -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 {
|
||||
|
@ -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]
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user