Remove unadorned

This commit is contained in:
Michael Goulet 2024-10-11 11:24:14 -04:00
parent ce697f919d
commit c085071631
12 changed files with 26 additions and 26 deletions

View File

@ -70,8 +70,8 @@ ast_passes_extern_fn_qualifiers = functions in `extern` blocks cannot have quali
.label = in this `extern` block
.suggestion = remove this qualifier
ast_passes_extern_invalid_safety = items in unadorned `extern` blocks cannot have safety qualifiers
.suggestion = add unsafe to this `extern` block
ast_passes_extern_invalid_safety = items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
.suggestion = add `unsafe` to this `extern` block
ast_passes_extern_item_ascii = items in `extern` blocks cannot use non-ascii identifiers
.label = in this `extern` block

View File

@ -2,7 +2,7 @@ extern "C" {
//@ is "$.index[*][?(@.name=='f1')].inner.function.header.is_unsafe" true
pub fn f1();
// items in unadorned `extern` blocks cannot have safety qualifiers
// items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
}
unsafe extern "C" {

View File

@ -42,7 +42,7 @@ fn main() {
extern "C" {
async fn fe1(); //~ ERROR functions in `extern` blocks cannot have qualifiers
unsafe fn fe2(); //~ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
unsafe fn fe2(); //~ ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
const fn fe3(); //~ ERROR functions in `extern` blocks cannot have qualifiers
extern "C" fn fe4(); //~ ERROR functions in `extern` blocks cannot have qualifiers
const async unsafe extern "C" fn fe5();
@ -50,6 +50,6 @@ fn main() {
//~| ERROR functions in `extern` blocks
//~| ERROR functions in `extern` blocks
//~| ERROR functions cannot be both `const` and `async`
//~| ERROR items in unadorned `extern` blocks cannot have safety qualifiers
//~| ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
}
}

View File

@ -78,13 +78,13 @@ LL | extern "C" {
LL | async fn fe1();
| ^^^^^ help: remove this qualifier
error: items in unadorned `extern` blocks cannot have safety qualifiers
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
--> $DIR/fn-header-semantic-fail.rs:45:9
|
LL | unsafe fn fe2();
| ^^^^^^^^^^^^^^^^
|
help: add unsafe to this `extern` block
help: add `unsafe` to this `extern` block
|
LL | unsafe extern "C" {
| ++++++
@ -134,13 +134,13 @@ LL | extern "C" {
LL | const async unsafe extern "C" fn fe5();
| ^^^^^^^^^^ help: remove this qualifier
error: items in unadorned `extern` blocks cannot have safety qualifiers
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
--> $DIR/fn-header-semantic-fail.rs:48:9
|
LL | const async unsafe extern "C" fn fe5();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: add unsafe to this `extern` block
help: add `unsafe` to this `extern` block
|
LL | unsafe extern "C" {
| ++++++

View File

@ -3,7 +3,7 @@ extern "C" {
//~^ ERROR functions in `extern` blocks cannot have qualifiers
const unsafe fn bar();
//~^ ERROR functions in `extern` blocks cannot have qualifiers
//~| ERROR items in unadorned `extern` blocks cannot have safety qualifiers
//~| ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
}
fn main() {}

View File

@ -15,13 +15,13 @@ LL | extern "C" {
LL | const unsafe fn bar();
| ^^^^^ help: remove this qualifier
error: items in unadorned `extern` blocks cannot have safety qualifiers
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
--> $DIR/no-const-fn-in-extern-block.rs:4:5
|
LL | const unsafe fn bar();
| ^^^^^^^^^^^^^^^^^^^^^^
|
help: add unsafe to this `extern` block
help: add `unsafe` to this `extern` block
|
LL | unsafe extern "C" {
| ++++++

View File

@ -1,21 +1,21 @@
error: items in unadorned `extern` blocks cannot have safety qualifiers
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:5
|
LL | safe static TEST1: i32;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: add unsafe to this `extern` block
help: add `unsafe` to this `extern` block
|
LL | unsafe extern "C" {
| ++++++
error: items in unadorned `extern` blocks cannot have safety qualifiers
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
|
LL | safe fn test1(i: i32);
| ^^^^^^^^^^^^^^^^^^^^^^
|
help: add unsafe to this `extern` block
help: add `unsafe` to this `extern` block
|
LL | unsafe extern "C" {
| ++++++

View File

@ -10,24 +10,24 @@ LL | |
LL | | }
| |_^
error: items in unadorned `extern` blocks cannot have safety qualifiers
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:5
|
LL | safe static TEST1: i32;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: add unsafe to this `extern` block
help: add `unsafe` to this `extern` block
|
LL | unsafe extern "C" {
| ++++++
error: items in unadorned `extern` blocks cannot have safety qualifiers
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
--> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
|
LL | safe fn test1(i: i32);
| ^^^^^^^^^^^^^^^^^^^^^^
|
help: add unsafe to this `extern` block
help: add `unsafe` to this `extern` block
|
LL | unsafe extern "C" {
| ++++++

View File

@ -6,9 +6,9 @@
extern "C" {
//[edition2024]~^ ERROR extern blocks must be unsafe
safe static TEST1: i32;
//~^ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
//~^ ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
safe fn test1(i: i32);
//~^ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
//~^ ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
}
fn test2() {

View File

@ -3,7 +3,7 @@
#![allow(dead_code)]
unsafe extern "C" {
unsafe fn foo(); //~ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
unsafe fn foo(); //~ ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
}
fn main() {}

View File

@ -3,7 +3,7 @@
#![allow(dead_code)]
extern "C" {
unsafe fn foo(); //~ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
unsafe fn foo(); //~ ERROR items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
}
fn main() {}

View File

@ -1,10 +1,10 @@
error: items in unadorned `extern` blocks cannot have safety qualifiers
error: items in `extern` blocks without an `unsafe` qualifier cannot have safety qualifiers
--> $DIR/unsafe-on-extern-block-issue-126756.rs:6:5
|
LL | unsafe fn foo();
| ^^^^^^^^^^^^^^^^
|
help: add unsafe to this `extern` block
help: add `unsafe` to this `extern` block
|
LL | unsafe extern "C" {
| ++++++