We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c8fdc1 commit 6323180Copy full SHA for 6323180
src/test/ui/issues/issue-47486.rs
@@ -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
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-47486.rs:2:10
+ |
+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