Skip to content

Commit

Permalink
make type-check-4 asm tests about non-const expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 30, 2024
1 parent 4428a05 commit ac2e318
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 96 deletions.
27 changes: 0 additions & 27 deletions tests/ui/asm/aarch64/type-check-4.rs

This file was deleted.

21 changes: 0 additions & 21 deletions tests/ui/asm/aarch64/type-check-4.stderr

This file was deleted.

11 changes: 11 additions & 0 deletions tests/ui/asm/non-const.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ needs-asm-support

use std::arch::global_asm;

fn main() {}

// Constants must be... constant
fn non_const_fn(x: i32) -> i32 { x }

global_asm!("/* {} */", const non_const_fn(0));
//~^ERROR: cannot call non-const fn
11 changes: 11 additions & 0 deletions tests/ui/asm/non-const.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0015]: cannot call non-const fn `non_const_fn` in constants
--> $DIR/non-const.rs:10:31
|
LL | global_asm!("/* {} */", const non_const_fn(0));
| ^^^^^^^^^^^^^^^
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0015`.
27 changes: 0 additions & 27 deletions tests/ui/asm/x86_64/type-check-4.rs

This file was deleted.

21 changes: 0 additions & 21 deletions tests/ui/asm/x86_64/type-check-4.stderr

This file was deleted.

0 comments on commit ac2e318

Please sign in to comment.