Skip to content

Commit 758ab4d

Browse files
committed
make type-check-4 asm tests about non-const expressions
1 parent 4428a05 commit 758ab4d

File tree

6 files changed

+20
-96
lines changed

6 files changed

+20
-96
lines changed

tests/ui/asm/aarch64/type-check-4.rs

-27
This file was deleted.

tests/ui/asm/aarch64/type-check-4.stderr

-21
This file was deleted.

tests/ui/asm/non-const.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use std::arch::global_asm;
2+
3+
fn main() {}
4+
5+
// Constants must be... constant
6+
fn non_const_fn(x: i32) -> i32 { x }
7+
8+
global_asm!("/* {} */", const non_const_fn(0));
9+
//~^ERROR: cannot call non-const fn

tests/ui/asm/non-const.stderr

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0015]: cannot call non-const fn `non_const_fn` in constants
2+
--> $DIR/non-const.rs:8:31
3+
|
4+
LL | global_asm!("/* {} */", const non_const_fn(0));
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0015`.

tests/ui/asm/x86_64/type-check-4.rs

-27
This file was deleted.

tests/ui/asm/x86_64/type-check-4.stderr

-21
This file was deleted.

0 commit comments

Comments
 (0)