Skip to content

Commit c085071

Browse files
Remove unadorned
1 parent ce697f9 commit c085071

12 files changed

+26
-26
lines changed

Diff for: compiler/rustc_ast_passes/messages.ftl

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ ast_passes_extern_fn_qualifiers = functions in `extern` blocks cannot have quali
7070
.label = in this `extern` block
7171
.suggestion = remove this qualifier
7272
73-
ast_passes_extern_invalid_safety = items in unadorned `extern` blocks cannot have safety qualifiers
74-
.suggestion = add unsafe to this `extern` block
73+
ast_passes_extern_invalid_safety = items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
74+
.suggestion = add `unsafe` to this `extern` block
7575
7676
ast_passes_extern_item_ascii = items in `extern` blocks cannot use non-ascii identifiers
7777
.label = in this `extern` block

Diff for: tests/rustdoc-json/fns/extern_safe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extern "C" {
22
//@ is "$.index[*][?(@.name=='f1')].inner.function.header.is_unsafe" true
33
pub fn f1();
44

5-
// items in unadorned `extern` blocks cannot have safety qualifiers
5+
// items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
66
}
77

88
unsafe extern "C" {

Diff for: tests/ui/parser/fn-header-semantic-fail.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ fn main() {
4242

4343
extern "C" {
4444
async fn fe1(); //~ ERROR functions in `extern` blocks cannot have qualifiers
45-
unsafe fn fe2(); //~ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
45+
unsafe fn fe2(); //~ ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
4646
const fn fe3(); //~ ERROR functions in `extern` blocks cannot have qualifiers
4747
extern "C" fn fe4(); //~ ERROR functions in `extern` blocks cannot have qualifiers
4848
const async unsafe extern "C" fn fe5();
4949
//~^ ERROR functions in `extern` blocks
5050
//~| ERROR functions in `extern` blocks
5151
//~| ERROR functions in `extern` blocks
5252
//~| ERROR functions cannot be both `const` and `async`
53-
//~| ERROR items in unadorned `extern` blocks cannot have safety qualifiers
53+
//~| ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
5454
}
5555
}

Diff for: tests/ui/parser/fn-header-semantic-fail.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ LL | extern "C" {
7878
LL | async fn fe1();
7979
| ^^^^^ help: remove this qualifier
8080

81-
error: items in unadorned `extern` blocks cannot have safety qualifiers
81+
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
8282
--> $DIR/fn-header-semantic-fail.rs:45:9
8383
|
8484
LL | unsafe fn fe2();
8585
| ^^^^^^^^^^^^^^^^
8686
|
87-
help: add unsafe to this `extern` block
87+
help: add `unsafe` to this `extern` block
8888
|
8989
LL | unsafe extern "C" {
9090
| ++++++
@@ -134,13 +134,13 @@ LL | extern "C" {
134134
LL | const async unsafe extern "C" fn fe5();
135135
| ^^^^^^^^^^ help: remove this qualifier
136136

137-
error: items in unadorned `extern` blocks cannot have safety qualifiers
137+
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
138138
--> $DIR/fn-header-semantic-fail.rs:48:9
139139
|
140140
LL | const async unsafe extern "C" fn fe5();
141141
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142142
|
143-
help: add unsafe to this `extern` block
143+
help: add `unsafe` to this `extern` block
144144
|
145145
LL | unsafe extern "C" {
146146
| ++++++

Diff for: tests/ui/parser/no-const-fn-in-extern-block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extern "C" {
33
//~^ ERROR functions in `extern` blocks cannot have qualifiers
44
const unsafe fn bar();
55
//~^ ERROR functions in `extern` blocks cannot have qualifiers
6-
//~| ERROR items in unadorned `extern` blocks cannot have safety qualifiers
6+
//~| ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
77
}
88

99
fn main() {}

Diff for: tests/ui/parser/no-const-fn-in-extern-block.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ LL | extern "C" {
1515
LL | const unsafe fn bar();
1616
| ^^^^^ help: remove this qualifier
1717

18-
error: items in unadorned `extern` blocks cannot have safety qualifiers
18+
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
1919
--> $DIR/no-const-fn-in-extern-block.rs:4:5
2020
|
2121
LL | const unsafe fn bar();
2222
| ^^^^^^^^^^^^^^^^^^^^^^
2323
|
24-
help: add unsafe to this `extern` block
24+
help: add `unsafe` to this `extern` block
2525
|
2626
LL | unsafe extern "C" {
2727
| ++++++

Diff for: tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2021.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
error: items in unadorned `extern` blocks cannot have safety qualifiers
1+
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
22
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:5
33
|
44
LL | safe static TEST1: i32;
55
| ^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
help: add unsafe to this `extern` block
7+
help: add `unsafe` to this `extern` block
88
|
99
LL | unsafe extern "C" {
1010
| ++++++
1111

12-
error: items in unadorned `extern` blocks cannot have safety qualifiers
12+
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
1313
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
1414
|
1515
LL | safe fn test1(i: i32);
1616
| ^^^^^^^^^^^^^^^^^^^^^^
1717
|
18-
help: add unsafe to this `extern` block
18+
help: add `unsafe` to this `extern` block
1919
|
2020
LL | unsafe extern "C" {
2121
| ++++++

Diff for: tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ LL | |
1010
LL | | }
1111
| |_^
1212

13-
error: items in unadorned `extern` blocks cannot have safety qualifiers
13+
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
1414
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:5
1515
|
1616
LL | safe static TEST1: i32;
1717
| ^^^^^^^^^^^^^^^^^^^^^^^
1818
|
19-
help: add unsafe to this `extern` block
19+
help: add `unsafe` to this `extern` block
2020
|
2121
LL | unsafe extern "C" {
2222
| ++++++
2323

24-
error: items in unadorned `extern` blocks cannot have safety qualifiers
24+
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
2525
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
2626
|
2727
LL | safe fn test1(i: i32);
2828
| ^^^^^^^^^^^^^^^^^^^^^^
2929
|
30-
help: add unsafe to this `extern` block
30+
help: add `unsafe` to this `extern` block
3131
|
3232
LL | unsafe extern "C" {
3333
| ++++++

Diff for: tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
extern "C" {
77
//[edition2024]~^ ERROR extern blocks must be unsafe
88
safe static TEST1: i32;
9-
//~^ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
9+
//~^ ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
1010
safe fn test1(i: i32);
11-
//~^ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
11+
//~^ ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
1212
}
1313

1414
fn test2() {

Diff for: tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![allow(dead_code)]
44

55
unsafe extern "C" {
6-
unsafe fn foo(); //~ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
6+
unsafe fn foo(); //~ ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
77
}
88

99
fn main() {}

Diff for: tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![allow(dead_code)]
44

55
extern "C" {
6-
unsafe fn foo(); //~ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
6+
unsafe fn foo(); //~ ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
77
}
88

99
fn main() {}

Diff for: tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: items in unadorned `extern` blocks cannot have safety qualifiers
1+
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
22
--> $DIR/unsafe-on-extern-block-issue-126756.rs:6:5
33
|
44
LL | unsafe fn foo();
55
| ^^^^^^^^^^^^^^^^
66
|
7-
help: add unsafe to this `extern` block
7+
help: add `unsafe` to this `extern` block
88
|
99
LL | unsafe extern "C" {
1010
| ++++++

0 commit comments

Comments
 (0)