mirror of https://github.com/rust-lang/rust
145 lines
4.8 KiB
Plaintext
145 lines
4.8 KiB
Plaintext
error[E0435]: attempt to use a non-constant value in a constant
|
|
--> $DIR/type-check-1.rs:41:26
|
|
|
|
|
LL | let x = 0;
|
|
| ----- help: consider using `const` instead of `let`: `const x`
|
|
...
|
|
LL | asm!("{}", const x);
|
|
| ^ non-constant value
|
|
|
|
error[E0435]: attempt to use a non-constant value in a constant
|
|
--> $DIR/type-check-1.rs:44:36
|
|
|
|
|
LL | let x = 0;
|
|
| ----- help: consider using `const` instead of `let`: `const x`
|
|
...
|
|
LL | asm!("{}", const const_foo(x));
|
|
| ^ non-constant value
|
|
|
|
error[E0435]: attempt to use a non-constant value in a constant
|
|
--> $DIR/type-check-1.rs:47:36
|
|
|
|
|
LL | let x = 0;
|
|
| ----- help: consider using `const` instead of `let`: `const x`
|
|
...
|
|
LL | asm!("{}", const const_bar(x));
|
|
| ^ non-constant value
|
|
|
|
error: invalid `sym` operand
|
|
--> $DIR/type-check-1.rs:49:24
|
|
|
|
|
LL | asm!("{}", sym x);
|
|
| ^ is a local variable
|
|
|
|
|
= help: `sym` operands must refer to either a function or a static
|
|
|
|
error: invalid asm output
|
|
--> $DIR/type-check-1.rs:14:29
|
|
|
|
|
LL | asm!("{}", out(reg) 1 + 2);
|
|
| ^^^^^ cannot assign to this expression
|
|
|
|
error: invalid asm output
|
|
--> $DIR/type-check-1.rs:16:31
|
|
|
|
|
LL | asm!("{}", inout(reg) 1 + 2);
|
|
| ^^^^^ cannot assign to this expression
|
|
|
|
error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
|
|
--> $DIR/type-check-1.rs:22:28
|
|
|
|
|
LL | asm!("{}", in(reg) v[..]);
|
|
| ^^^^^ doesn't have a size known at compile-time
|
|
|
|
|
= help: the trait `Sized` is not implemented for `[u64]`
|
|
= note: all inline asm arguments must have a statically known size
|
|
|
|
error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
|
|
--> $DIR/type-check-1.rs:25:29
|
|
|
|
|
LL | asm!("{}", out(reg) v[..]);
|
|
| ^^^^^ doesn't have a size known at compile-time
|
|
|
|
|
= help: the trait `Sized` is not implemented for `[u64]`
|
|
= note: all inline asm arguments must have a statically known size
|
|
|
|
error[E0277]: the size for values of type `[u64]` cannot be known at compilation time
|
|
--> $DIR/type-check-1.rs:28:31
|
|
|
|
|
LL | asm!("{}", inout(reg) v[..]);
|
|
| ^^^^^ doesn't have a size known at compile-time
|
|
|
|
|
= help: the trait `Sized` is not implemented for `[u64]`
|
|
= note: all inline asm arguments must have a statically known size
|
|
|
|
error: cannot use value of type `[u64]` for inline assembly
|
|
--> $DIR/type-check-1.rs:22:28
|
|
|
|
|
LL | asm!("{}", in(reg) v[..]);
|
|
| ^^^^^
|
|
|
|
|
= note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
|
|
|
|
error: cannot use value of type `[u64]` for inline assembly
|
|
--> $DIR/type-check-1.rs:25:29
|
|
|
|
|
LL | asm!("{}", out(reg) v[..]);
|
|
| ^^^^^
|
|
|
|
|
= note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
|
|
|
|
error: cannot use value of type `[u64]` for inline assembly
|
|
--> $DIR/type-check-1.rs:28:31
|
|
|
|
|
LL | asm!("{}", inout(reg) v[..]);
|
|
| ^^^^^
|
|
|
|
|
= note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/type-check-1.rs:57:26
|
|
|
|
|
LL | asm!("{}", const 0f32);
|
|
| ^^^^ expected integer, found `f32`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/type-check-1.rs:59:26
|
|
|
|
|
LL | asm!("{}", const 0 as *mut u8);
|
|
| ^^^^^^^^^^^^ expected integer, found `*mut u8`
|
|
|
|
|
= note: expected type `{integer}`
|
|
found raw pointer `*mut u8`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/type-check-1.rs:61:26
|
|
|
|
|
LL | asm!("{}", const &0);
|
|
| ^^ expected integer, found `&{integer}`
|
|
|
|
|
help: consider removing the borrow
|
|
|
|
|
LL - asm!("{}", const &0);
|
|
LL + asm!("{}", const 0);
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/type-check-1.rs:75:25
|
|
|
|
|
LL | global_asm!("{}", const 0f32);
|
|
| ^^^^ expected integer, found `f32`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/type-check-1.rs:77:25
|
|
|
|
|
LL | global_asm!("{}", const 0 as *mut u8);
|
|
| ^^^^^^^^^^^^ expected integer, found `*mut u8`
|
|
|
|
|
= note: expected type `{integer}`
|
|
found raw pointer `*mut u8`
|
|
|
|
error: aborting due to 17 previous errors
|
|
|
|
Some errors have detailed explanations: E0277, E0308, E0435.
|
|
For more information about an error, try `rustc --explain E0277`.
|