Skip to content

Commit 6323180

Browse files
committed
Add test for issue-47486
1 parent 5c8fdc1 commit 6323180

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/test/ui/issues/issue-47486.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
() < std::mem::size_of::<_>(); //~ ERROR: mismatched types
3+
[0u8; std::mem::size_of::<_>()]; //~ ERROR: type annotations needed
4+
}

src/test/ui/issues/issue-47486.stderr

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-47486.rs:2:10
3+
|
4+
LL | () < std::mem::size_of::<_>();
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found usize
6+
|
7+
= note: expected type `()`
8+
found type `usize`
9+
10+
error[E0282]: type annotations needed
11+
--> $DIR/issue-47486.rs:3:11
12+
|
13+
LL | [0u8; std::mem::size_of::<_>()];
14+
| ^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
15+
16+
error: aborting due to 2 previous errors
17+
18+
Some errors have detailed explanations: E0282, E0308.
19+
For more information about an error, try `rustc --explain E0282`.

0 commit comments

Comments
 (0)