Add test for issue-47486

This commit is contained in:
Yuki Okushi 2019-10-14 10:45:56 +09:00
parent 5c8fdc1954
commit 6323180b4a
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,4 @@
fn main() {
() < std::mem::size_of::<_>(); //~ ERROR: mismatched types
[0u8; std::mem::size_of::<_>()]; //~ ERROR: type annotations needed
}

View 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`.