blob: 090bd67117eab8cdad015950777c29ad481944e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
error[E0308]: mismatched types
--> $DIR/pat-type-err-let-stmt.rs:6:29
|
LL | let Ok(0): Option<u8> = 42u8;
| ---------- ^^^^ expected enum `Option`, found `u8`
| |
| expected due to this
|
= note: expected enum `Option<u8>`
found type `u8`
help: try wrapping the expression in `Some`
|
LL | let Ok(0): Option<u8> = Some(42u8);
| +++++ +
error[E0308]: mismatched types
--> $DIR/pat-type-err-let-stmt.rs:6:9
|
LL | let Ok(0): Option<u8> = 42u8;
| ^^^^^ ---------- expected due to this
| |
| expected enum `Option`, found enum `Result`
|
= note: expected enum `Option<u8>`
found enum `Result<_, _>`
error[E0308]: mismatched types
--> $DIR/pat-type-err-let-stmt.rs:11:9
|
LL | let Ok(0): Option<u8>;
| ^^^^^ ---------- expected due to this
| |
| expected enum `Option`, found enum `Result`
|
= note: expected enum `Option<u8>`
found enum `Result<_, _>`
error[E0308]: mismatched types
--> $DIR/pat-type-err-let-stmt.rs:15:9
|
LL | let Ok(0) = 42u8;
| ^^^^^ ---- this expression has type `u8`
| |
| expected `u8`, found enum `Result`
|
= note: expected type `u8`
found enum `Result<_, _>`
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.
|