File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ ( ) < std:: mem:: size_of :: < _ > ( ) ; //~ ERROR: mismatched types
3
+ [ 0u8 ; std:: mem:: size_of :: < _ > ( ) ] ; //~ ERROR: type annotations needed
4
+ }
Original file line number Diff line number Diff line change
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`.
You can’t perform that action at this time.
0 commit comments