File tree Expand file tree Collapse file tree 4 files changed +40
-7
lines changed
src/test/ui/feature-gates Expand file tree Collapse file tree 4 files changed +40
-7
lines changed Original file line number Diff line number Diff line change 22
33use std:: arch:: asm;
44
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+
510fn main ( ) {
611 unsafe {
12+ foo :: < 0 > ( ) ;
713 asm ! ( "mov eax, {}" , const 123 ) ;
814 //~^ ERROR const operands for inline assembly are unstable
915 }
Original file line number Diff line number Diff line change 11error[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
312 |
413LL | asm!("mov eax, {}", const 123);
514 | ^^^^^^^^^
615 |
716 = note: see issue #93332 <https://github.com/rust-lang/rust/issues/93332> for more information
817 = help: add `#![feature(asm_const)]` to the crate attributes to enable
918
10- error: aborting due to previous error
19+ error: aborting due to 2 previous errors
1120
1221For more information about this error, try `rustc --explain E0658`.
Original file line number Diff line number Diff line change 22
33use std:: arch:: asm;
44
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+
514fn main ( ) {
615 unsafe {
7- asm ! ( "mov eax, {}" , sym main ) ;
16+ asm ! ( "mov eax, {}" , sym foo :: < 0 > ) ;
817 //~^ ERROR sym operands for inline assembly are unstable
918 }
1019}
Original file line number Diff line number Diff line change 11error[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
33 |
4- LL | asm!("mov eax, {}", sym main );
5- | ^^^^^^^^
4+ LL | asm!("mov eax, {}", sym bar::<N> );
5+ | ^^^^^^^^^^^^
66 |
77 = note: see issue #93333 <https://github.com/rust-lang/rust/issues/93333> for more information
88 = help: add `#![feature(asm_sym)]` to the crate attributes to enable
99
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
1120
1221For more information about this error, try `rustc --explain E0658`.
You can’t perform that action at this time.
0 commit comments