Add test for issue-47486
This commit is contained in:
parent
5c8fdc1954
commit
6323180b4a
2 changed files with 23 additions and 0 deletions
4
src/test/ui/issues/issue-47486.rs
Normal file
4
src/test/ui/issues/issue-47486.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
fn main() {
|
||||
() < std::mem::size_of::<_>(); //~ ERROR: mismatched types
|
||||
[0u8; std::mem::size_of::<_>()]; //~ ERROR: type annotations needed
|
||||
}
|
19
src/test/ui/issues/issue-47486.stderr
Normal file
19
src/test/ui/issues/issue-47486.stderr
Normal file
|
@ -0,0 +1,19 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-47486.rs:2:10
|
||||
|
|
||||
LL | () < std::mem::size_of::<_>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found usize
|
||||
|
|
||||
= note: expected type `()`
|
||||
found type `usize`
|
||||
|
||||
error[E0282]: type annotations needed
|
||||
--> $DIR/issue-47486.rs:3:11
|
||||
|
|
||||
LL | [0u8; std::mem::size_of::<_>()];
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0282, E0308.
|
||||
For more information about an error, try `rustc --explain E0282`.
|
Loading…
Add table
Reference in a new issue