From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/asm/type-check-1.stderr | 144 ++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 src/test/ui/asm/type-check-1.stderr (limited to 'src/test/ui/asm/type-check-1.stderr') diff --git a/src/test/ui/asm/type-check-1.stderr b/src/test/ui/asm/type-check-1.stderr new file mode 100644 index 000000000..162ff1d32 --- /dev/null +++ b/src/test/ui/asm/type-check-1.stderr @@ -0,0 +1,144 @@ +error[E0435]: attempt to use a non-constant value in a constant + --> $DIR/type-check-1.rs:42: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:45: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:48: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:50: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:15:29 + | +LL | asm!("{}", out(reg) 1 + 2); + | ^^^^^ cannot assign to this expression + +error: invalid asm output + --> $DIR/type-check-1.rs:17: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:23: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:26: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:29: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:23: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:26: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:29: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:58:26 + | +LL | asm!("{}", const 0f32); + | ^^^^ expected integer, found `f32` + +error[E0308]: mismatched types + --> $DIR/type-check-1.rs:60:26 + | +LL | asm!("{}", const 0 as *mut u8); + | ^^^^^^^^^^^^ expected integer, found *-ptr + | + = note: expected type `{integer}` + found raw pointer `*mut u8` + +error[E0308]: mismatched types + --> $DIR/type-check-1.rs:62: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:76:25 + | +LL | global_asm!("{}", const 0f32); + | ^^^^ expected integer, found `f32` + +error[E0308]: mismatched types + --> $DIR/type-check-1.rs:78:25 + | +LL | global_asm!("{}", const 0 as *mut u8); + | ^^^^^^^^^^^^ expected integer, found *-ptr + | + = 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`. -- cgit v1.2.3