File tree 4 files changed +40
-7
lines changed
src/test/ui/feature-gates
4 files changed +40
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use std:: arch:: asm;
4
4
5
+ unsafe fn foo < const N : usize > ( ) {
6
+ asm ! ( "mov eax, {}" , const N + 1 ) ;
7
+ //~^ ERROR const operands for inline assembly are unstable
8
+ }
9
+
5
10
fn main ( ) {
6
11
unsafe {
12
+ foo :: < 0 > ( ) ;
7
13
asm ! ( "mov eax, {}" , const 123 ) ;
8
14
//~^ ERROR const operands for inline assembly are unstable
9
15
}
Original file line number Diff line number Diff line change 1
1
error[E0658]: const operands for inline assembly are unstable
2
- --> $DIR/feature-gate-asm_const.rs:7:29
2
+ --> $DIR/feature-gate-asm_const.rs:6:25
3
+ |
4
+ LL | asm!("mov eax, {}", const N + 1);
5
+ | ^^^^^^^^^^^
6
+ |
7
+ = note: see issue #93332 <https://github.com/rust-lang/rust/issues/93332> for more information
8
+ = help: add `#![feature(asm_const)]` to the crate attributes to enable
9
+
10
+ error[E0658]: const operands for inline assembly are unstable
11
+ --> $DIR/feature-gate-asm_const.rs:13:29
3
12
|
4
13
LL | asm!("mov eax, {}", const 123);
5
14
| ^^^^^^^^^
6
15
|
7
16
= note: see issue #93332 <https://github.com/rust-lang/rust/issues/93332> for more information
8
17
= help: add `#![feature(asm_const)]` to the crate attributes to enable
9
18
10
- error: aborting due to previous error
19
+ error: aborting due to 2 previous errors
11
20
12
21
For more information about this error, try `rustc --explain E0658`.
Original file line number Diff line number Diff line change 2
2
3
3
use std:: arch:: asm;
4
4
5
+ fn bar < const N : usize > ( ) { }
6
+
7
+ fn foo < const N : usize > ( ) {
8
+ unsafe {
9
+ asm ! ( "mov eax, {}" , sym bar:: <N >) ;
10
+ //~^ ERROR sym operands for inline assembly are unstable
11
+ }
12
+ }
13
+
5
14
fn main ( ) {
6
15
unsafe {
7
- asm ! ( "mov eax, {}" , sym main ) ;
16
+ asm ! ( "mov eax, {}" , sym foo :: < 0 > ) ;
8
17
//~^ ERROR sym operands for inline assembly are unstable
9
18
}
10
19
}
Original file line number Diff line number Diff line change 1
1
error[E0658]: sym operands for inline assembly are unstable
2
- --> $DIR/feature-gate-asm_sym.rs:7 :29
2
+ --> $DIR/feature-gate-asm_sym.rs:9 :29
3
3
|
4
- LL | asm!("mov eax, {}", sym main );
5
- | ^^^^^^^^
4
+ LL | asm!("mov eax, {}", sym bar::<N> );
5
+ | ^^^^^^^^^^^^
6
6
|
7
7
= note: see issue #93333 <https://github.com/rust-lang/rust/issues/93333> for more information
8
8
= help: add `#![feature(asm_sym)]` to the crate attributes to enable
9
9
10
- error: aborting due to previous error
10
+ error[E0658]: sym operands for inline assembly are unstable
11
+ --> $DIR/feature-gate-asm_sym.rs:16:29
12
+ |
13
+ LL | asm!("mov eax, {}", sym foo::<0>);
14
+ | ^^^^^^^^^^^^
15
+ |
16
+ = note: see issue #93333 <https://github.com/rust-lang/rust/issues/93333> for more information
17
+ = help: add `#![feature(asm_sym)]` to the crate attributes to enable
18
+
19
+ error: aborting due to 2 previous errors
11
20
12
21
For more information about this error, try `rustc --explain E0658`.
You can’t perform that action at this time.
0 commit comments