mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
87 lines
2.6 KiB
Plaintext
87 lines
2.6 KiB
Plaintext
error[E0435]: attempt to use a non-constant value in a constant
|
|
--> $DIR/invalid-const-operand.rs:40:26
|
|
|
|
|
LL | asm!("{}", const x);
|
|
| ^ non-constant value
|
|
|
|
|
help: consider using `const` instead of `let`
|
|
|
|
|
LL | const x: /* Type */ = 0;
|
|
| ~~~~~ ++++++++++++
|
|
|
|
error[E0435]: attempt to use a non-constant value in a constant
|
|
--> $DIR/invalid-const-operand.rs:43:36
|
|
|
|
|
LL | asm!("{}", const const_foo(x));
|
|
| ^ non-constant value
|
|
|
|
|
help: consider using `const` instead of `let`
|
|
|
|
|
LL | const x: /* Type */ = 0;
|
|
| ~~~~~ ++++++++++++
|
|
|
|
error[E0435]: attempt to use a non-constant value in a constant
|
|
--> $DIR/invalid-const-operand.rs:46:36
|
|
|
|
|
LL | asm!("{}", const const_bar(x));
|
|
| ^ non-constant value
|
|
|
|
|
help: consider using `const` instead of `let`
|
|
|
|
|
LL | const x: /* Type */ = 0;
|
|
| ~~~~~ ++++++++++++
|
|
|
|
error: invalid type for `const` operand
|
|
--> $DIR/invalid-const-operand.rs:12:19
|
|
|
|
|
LL | global_asm!("{}", const 0f32);
|
|
| ^^^^^^----
|
|
| |
|
|
| is an `f32`
|
|
|
|
|
= help: `const` operands must be of an integer type
|
|
|
|
error: invalid type for `const` operand
|
|
--> $DIR/invalid-const-operand.rs:14:19
|
|
|
|
|
LL | global_asm!("{}", const 0 as *mut u8);
|
|
| ^^^^^^------------
|
|
| |
|
|
| is a `*mut u8`
|
|
|
|
|
= help: `const` operands must be of an integer type
|
|
|
|
error: invalid type for `const` operand
|
|
--> $DIR/invalid-const-operand.rs:24:20
|
|
|
|
|
LL | asm!("{}", const 0f32);
|
|
| ^^^^^^----
|
|
| |
|
|
| is an `f32`
|
|
|
|
|
= help: `const` operands must be of an integer type
|
|
|
|
error: invalid type for `const` operand
|
|
--> $DIR/invalid-const-operand.rs:26:20
|
|
|
|
|
LL | asm!("{}", const 0 as *mut u8);
|
|
| ^^^^^^------------
|
|
| |
|
|
| is a `*mut u8`
|
|
|
|
|
= help: `const` operands must be of an integer type
|
|
|
|
error: invalid type for `const` operand
|
|
--> $DIR/invalid-const-operand.rs:28:20
|
|
|
|
|
LL | asm!("{}", const &0);
|
|
| ^^^^^^--
|
|
| |
|
|
| is a `&i32`
|
|
|
|
|
= help: `const` operands must be of an integer type
|
|
|
|
error: aborting due to 8 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0435`.
|