Skip to content

Commit 7dbd972

Browse files
committed
use naked_asm! in feature-gate-naked_functions test
1 parent 863f235 commit 7dbd972

File tree

2 files changed

+45
-12
lines changed

2 files changed

+45
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
//@ needs-asm-support
22

3-
use std::arch::asm;
3+
use std::arch::naked_asm;
4+
//~^ ERROR use of unstable library feature 'naked_functions'
45

56
#[naked]
67
//~^ the `#[naked]` attribute is an experimental feature
78
extern "C" fn naked() {
89
naked_asm!("", options(noreturn))
9-
//~^ ERROR: requires unsafe
10+
//~^ ERROR use of unstable library feature 'naked_functions'
11+
//~| ERROR: requires unsafe
1012
}
1113

1214
#[naked]
1315
//~^ the `#[naked]` attribute is an experimental feature
1416
extern "C" fn naked_2() -> isize {
1517
naked_asm!("", options(noreturn))
16-
//~^ ERROR: requires unsafe
18+
//~^ ERROR use of unstable library feature 'naked_functions'
19+
//~| ERROR: requires unsafe
1720
}
1821

1922
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1+
error[E0658]: use of unstable library feature 'naked_functions'
2+
--> $DIR/feature-gate-naked_functions.rs:9:5
3+
|
4+
LL | naked_asm!("", options(noreturn))
5+
| ^^^^^^^^^
6+
|
7+
= note: see issue #90957 <https://github.com/rust-lang/rust/issues/90957> for more information
8+
= help: add `#![feature(naked_functions)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+
error[E0658]: use of unstable library feature 'naked_functions'
12+
--> $DIR/feature-gate-naked_functions.rs:17:5
13+
|
14+
LL | naked_asm!("", options(noreturn))
15+
| ^^^^^^^^^
16+
|
17+
= note: see issue #90957 <https://github.com/rust-lang/rust/issues/90957> for more information
18+
= help: add `#![feature(naked_functions)]` to the crate attributes to enable
19+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
20+
121
error[E0658]: the `#[naked]` attribute is an experimental feature
2-
--> $DIR/feature-gate-naked_functions.rs:5:1
22+
--> $DIR/feature-gate-naked_functions.rs:6:1
323
|
424
LL | #[naked]
525
| ^^^^^^^^
@@ -9,7 +29,7 @@ LL | #[naked]
929
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1030

1131
error[E0658]: the `#[naked]` attribute is an experimental feature
12-
--> $DIR/feature-gate-naked_functions.rs:12:1
32+
--> $DIR/feature-gate-naked_functions.rs:14:1
1333
|
1434
LL | #[naked]
1535
| ^^^^^^^^
@@ -18,23 +38,33 @@ LL | #[naked]
1838
= help: add `#![feature(naked_functions)]` to the crate attributes to enable
1939
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2040

41+
error[E0658]: use of unstable library feature 'naked_functions'
42+
--> $DIR/feature-gate-naked_functions.rs:3:5
43+
|
44+
LL | use std::arch::naked_asm;
45+
| ^^^^^^^^^^^^^^^^^^^^
46+
|
47+
= note: see issue #90957 <https://github.com/rust-lang/rust/issues/90957> for more information
48+
= help: add `#![feature(naked_functions)]` to the crate attributes to enable
49+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
50+
2151
error[E0133]: use of inline assembly is unsafe and requires unsafe function or block
22-
--> $DIR/feature-gate-naked_functions.rs:8:5
52+
--> $DIR/feature-gate-naked_functions.rs:9:5
2353
|
24-
LL | asm!("", options(noreturn))
25-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of inline assembly
54+
LL | naked_asm!("", options(noreturn))
55+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of inline assembly
2656
|
2757
= note: inline assembly is entirely unchecked and can cause undefined behavior
2858

2959
error[E0133]: use of inline assembly is unsafe and requires unsafe function or block
30-
--> $DIR/feature-gate-naked_functions.rs:15:5
60+
--> $DIR/feature-gate-naked_functions.rs:17:5
3161
|
32-
LL | asm!("", options(noreturn))
33-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of inline assembly
62+
LL | naked_asm!("", options(noreturn))
63+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of inline assembly
3464
|
3565
= note: inline assembly is entirely unchecked and can cause undefined behavior
3666

37-
error: aborting due to 4 previous errors
67+
error: aborting due to 7 previous errors
3868

3969
Some errors have detailed explanations: E0133, E0658.
4070
For more information about an error, try `rustc --explain E0133`.

0 commit comments

Comments
 (0)