Bless tests
This commit is contained in:
parent
f482460f92
commit
395b0fb4d9
6 changed files with 29 additions and 18 deletions
10
tests/ui/asm/const-resolve-error.rs
Normal file
10
tests/ui/asm/const-resolve-error.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
//@ edition:2021
|
||||
//@ needs-asm-support
|
||||
|
||||
use std::arch::asm;
|
||||
|
||||
async unsafe fn foo<'a>() {
|
||||
asm!("/* {0} */", const N); //~ ERROR E0425
|
||||
}
|
||||
|
||||
fn main() {}
|
14
tests/ui/asm/const-resolve-error.stderr
Normal file
14
tests/ui/asm/const-resolve-error.stderr
Normal file
|
@ -0,0 +1,14 @@
|
|||
error[E0425]: cannot find value `N` in this scope
|
||||
--> $DIR/const-resolve-error.rs:7:29
|
||||
|
|
||||
LL | asm!("/* {0} */", const N);
|
||||
| ^ not found in this scope
|
||||
|
|
||||
help: you might be missing a const parameter
|
||||
|
|
||||
LL | async unsafe fn foo<'a, const N: /* Type */>() {
|
||||
| +++++++++++++++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0425`.
|
|
@ -5,6 +5,6 @@ use std::arch::global_asm;
|
|||
|
||||
fn main() {}
|
||||
|
||||
global_asm!("/* {} */", const 1 << 500); //~ ERROR evaluation of constant value failed [E0080]
|
||||
global_asm!("/* {} */", const 1 << 500); //~ ERROR E0080
|
||||
|
||||
global_asm!("/* {} */", const 1 / 0); //~ ERROR evaluation of constant value failed [E0080]
|
||||
global_asm!("/* {} */", const 1 / 0); //~ ERROR E0080
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
error[E0080]: evaluation of constant value failed
|
||||
error[E0080]: evaluation of `{global_asm#0}::{constant#0}` failed
|
||||
--> $DIR/fail-const-eval-issue-121099.rs:8:31
|
||||
|
|
||||
LL | global_asm!("/* {} */", const 1 << 500);
|
||||
| ^^^^^^^^ attempt to shift left by `500_i32`, which would overflow
|
||||
|
||||
error[E0080]: evaluation of constant value failed
|
||||
error[E0080]: evaluation of `{global_asm#1}::{constant#0}` failed
|
||||
--> $DIR/fail-const-eval-issue-121099.rs:10:31
|
||||
|
|
||||
LL | global_asm!("/* {} */", const 1 / 0);
|
||||
|
|
|
@ -80,7 +80,7 @@ error: invalid type for `const` operand
|
|||
LL | asm!("{}", const &0);
|
||||
| ^^^^^^--
|
||||
| |
|
||||
| is a `&i32`
|
||||
| is a `&{integer}`
|
||||
|
|
||||
= help: `const` operands must be of an integer type
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue