Skip to content

Commit bd1551e

Browse files
committed
Fix tests
1 parent b39e9e2 commit bd1551e

File tree

4 files changed

+11
-32
lines changed

4 files changed

+11
-32
lines changed

src/test/ui/lint/lint-forbid-internal-unsafe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![feature(allow_internal_unsafe)]
33

44
#[allow_internal_unsafe]
5-
//~^ ERROR: cannot use `allow_internal_unsafe` with `forbid(unsafe_code)`
5+
//~^ ERROR: `allow_internal_unsafe` allows defining
66
macro_rules! evil {
77
($e:expr) => {
88
unsafe {

src/test/ui/lint/lint-forbid-internal-unsafe.stderr

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

src/test/ui/lint/lint-unsafe-code.rs

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait
2727
trait Baz {
2828
unsafe fn baz(&self); //~ ERROR: declaration of an `unsafe` method
2929
unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
30-
//~^ ERROR: declaration of an `unsafe` method
3130
unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
32-
//~^ ERROR: declaration of an `unsafe` method
3331
}
3432

3533
impl Baz for Bar {
@@ -65,7 +63,6 @@ trait C {
6563
#[allow(unsafe_code)]
6664
unsafe fn baz(&self);
6765
unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
68-
//~^ ERROR: declaration of an `unsafe` method
6966
}
7067

7168
impl C for Bar {

src/test/ui/lint/lint-unsafe-code.stderr

+9-27
Original file line numberDiff line numberDiff line change
@@ -28,74 +28,56 @@ error: declaration of an `unsafe` method
2828
LL | unsafe fn baz(&self); //~ ERROR: declaration of an `unsafe` method
2929
| ^^^^^^^^^^^^^^^^^^^^^
3030

31-
error: declaration of an `unsafe` method
32-
--> $DIR/lint-unsafe-code.rs:29:5
33-
|
34-
LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
35-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36-
3731
error: implementation of an `unsafe` method
3832
--> $DIR/lint-unsafe-code.rs:29:5
3933
|
4034
LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
4135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4236

43-
error: declaration of an `unsafe` method
44-
--> $DIR/lint-unsafe-code.rs:31:5
45-
|
46-
LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
47-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48-
4937
error: implementation of an `unsafe` method
50-
--> $DIR/lint-unsafe-code.rs:31:5
38+
--> $DIR/lint-unsafe-code.rs:30:5
5139
|
5240
LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
5341
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5442

5543
error: implementation of an `unsafe` method
56-
--> $DIR/lint-unsafe-code.rs:36:5
44+
--> $DIR/lint-unsafe-code.rs:34:5
5745
|
5846
LL | unsafe fn baz(&self) {} //~ ERROR: implementation of an `unsafe` method
5947
| ^^^^^^^^^^^^^^^^^^^^^^^
6048

6149
error: implementation of an `unsafe` method
62-
--> $DIR/lint-unsafe-code.rs:37:5
50+
--> $DIR/lint-unsafe-code.rs:35:5
6351
|
6452
LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
6553
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6654

6755
error: implementation of an `unsafe` method
68-
--> $DIR/lint-unsafe-code.rs:56:5
56+
--> $DIR/lint-unsafe-code.rs:54:5
6957
|
7058
LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
7159
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7260

73-
error: declaration of an `unsafe` method
74-
--> $DIR/lint-unsafe-code.rs:67:5
75-
|
76-
LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
77-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78-
7961
error: implementation of an `unsafe` method
80-
--> $DIR/lint-unsafe-code.rs:67:5
62+
--> $DIR/lint-unsafe-code.rs:65:5
8163
|
8264
LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
8365
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8466

8567
error: implementation of an `unsafe` method
86-
--> $DIR/lint-unsafe-code.rs:74:5
68+
--> $DIR/lint-unsafe-code.rs:71:5
8769
|
8870
LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
8971
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9072

9173
error: implementation of an `unsafe` method
92-
--> $DIR/lint-unsafe-code.rs:78:5
74+
--> $DIR/lint-unsafe-code.rs:75:5
9375
|
9476
LL | unsafe fn baz(&self) {} //~ ERROR: implementation of an `unsafe` method
9577
| ^^^^^^^^^^^^^^^^^^^^^^^
9678

9779
error: usage of an `unsafe` block
98-
--> $DIR/lint-unsafe-code.rs:89:5
80+
--> $DIR/lint-unsafe-code.rs:86:5
9981
|
10082
LL | unsafe {} //~ ERROR: usage of an `unsafe` block
10183
| ^^^^^^^^^
@@ -109,5 +91,5 @@ LL | unsafe {} //~ ERROR: usage of an `unsafe` block
10991
LL | unsafe_in_macro!()
11092
| ------------------ in this macro invocation
11193

112-
error: aborting due to 17 previous errors
94+
error: aborting due to 14 previous errors
11395

0 commit comments

Comments
 (0)