]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/if-let-typo.stderr
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / if-let-typo.stderr
1 error[E0425]: cannot find value `x` in this scope
2   --> $DIR/if-let-typo.rs:4:13
3    |
4 LL |     if Some(x) = foo {}
5    |             ^ not found in this scope
6    |
7 help: you might have meant to use pattern matching
8    |
9 LL |     if let Some(x) = foo {}
10    |        +++
11
12 error[E0425]: cannot find value `x` in this scope
13   --> $DIR/if-let-typo.rs:10:8
14    |
15 LL |     if x = 5 {}
16    |        ^ not found in this scope
17    |
18 help: you might have meant to use pattern matching
19    |
20 LL |     if let x = 5 {}
21    |        +++
22
23 error[E0308]: mismatched types
24   --> $DIR/if-let-typo.rs:4:8
25    |
26 LL |     if Some(x) = foo {}
27    |        ^^^^^^^^^^^^^ expected `bool`, found `()`
28    |
29 help: consider adding `let`
30    |
31 LL |     if let Some(x) = foo {}
32    |        +++
33
34 error[E0308]: mismatched types
35   --> $DIR/if-let-typo.rs:6:8
36    |
37 LL |     if Some(foo) = bar {}
38    |        ^^^^^^^^^^^^^^^ expected `bool`, found `()`
39    |
40 help: consider adding `let`
41    |
42 LL |     if let Some(foo) = bar {}
43    |        +++
44
45 error[E0308]: mismatched types
46   --> $DIR/if-let-typo.rs:7:8
47    |
48 LL |     if 3 = foo {}
49    |        ^^^^^^^ expected `bool`, found `()`
50
51 error[E0070]: invalid left-hand side of assignment
52   --> $DIR/if-let-typo.rs:8:16
53    |
54 LL |     if Some(3) = foo {}
55    |             -  ^
56    |             |
57    |             cannot assign to this expression
58
59 error[E0308]: mismatched types
60   --> $DIR/if-let-typo.rs:8:8
61    |
62 LL |     if Some(3) = foo {}
63    |        ^^^^^^^^^^^^^ expected `bool`, found `()`
64    |
65 help: consider adding `let`
66    |
67 LL |     if let Some(3) = foo {}
68    |        +++
69
70 error: aborting due to 7 previous errors
71
72 Some errors have detailed explanations: E0070, E0308, E0425.
73 For more information about an error, try `rustc --explain E0070`.