Skip to content

Commit

Permalink
Work around rust-lang#96304 by ignoring one test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu authored and folkertdev committed Jul 21, 2024
1 parent a44289a commit a7dca3d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 43 deletions.
13 changes: 7 additions & 6 deletions tests/ui/asm/type-check-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ fn main() {
asm!("{}", const 0i32);
asm!("{}", const 0i128);
asm!("{}", const 0f32);
//~^ ERROR mismatched types
//~^ ERROR invalid type for `const` operand
asm!("{}", const 0 as *mut u8);
//~^ ERROR mismatched types
asm!("{}", const &0);
//~^ ERROR mismatched types
//~^ ERROR invalid type for `const` operand

// FIXME: Currently ICEs due to #96304
//asm!("{}", const &0);
}
}

Expand All @@ -73,6 +74,6 @@ global_asm!("{}", const 0);
global_asm!("{}", const 0i32);
global_asm!("{}", const 0i128);
global_asm!("{}", const 0f32);
//~^ ERROR mismatched types
//~^ ERROR invalid type for `const` operand
global_asm!("{}", const 0 as *mut u8);
//~^ ERROR mismatched types
//~^ ERROR invalid type for `const` operand
72 changes: 35 additions & 37 deletions tests/ui/asm/type-check-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ LL | asm!("{}", sym x);
|
= help: `sym` operands must refer to either a function or a static

error: invalid type for `const` operand
--> $DIR/type-check-1.rs:76: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/type-check-1.rs:78:19
|
LL | global_asm!("{}", const 0 as *mut u8);
| ^^^^^^------------
| |
| is a `*mut u8`
|
= help: `const` operands must be of an integer type

error: invalid asm output
--> $DIR/type-check-1.rs:14:29
|
Expand Down Expand Up @@ -102,49 +122,27 @@ 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
error: invalid type for `const` operand
--> $DIR/type-check-1.rs:57:20
|
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`
| ^^^^^^----
| |
| is an `f32`
|
= note: expected type `{integer}`
found raw pointer `*mut u8`
= help: `const` operands must be of an integer type

error[E0308]: mismatched types
--> $DIR/type-check-1.rs:61:26
error: invalid type for `const` operand
--> $DIR/type-check-1.rs:59:20
|
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`
LL | asm!("{}", const 0 as *mut u8);
| ^^^^^^------------
| |
| is a `*mut u8`
|
= note: expected type `{integer}`
found raw pointer `*mut u8`
= help: `const` operands must be of an integer type

error: aborting due to 17 previous errors
error: aborting due to 16 previous errors

Some errors have detailed explanations: E0277, E0308, E0435.
Some errors have detailed explanations: E0277, E0435.
For more information about an error, try `rustc --explain E0277`.

0 comments on commit a7dca3d

Please sign in to comment.