fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.4 KiB56 linesraw
1error[E0425]: cannot find value `x` in this scope
2  --> $DIR/while-let-typo.rs:4:16
3   |
4LL |     while Some(x) = foo {}
5   |                ^ not found in this scope
6   |
7help: you might have meant to use pattern matching
8   |
9LL |     while let Some(x) = foo {}
10   |           +++
11
12error[E0425]: cannot find value `x` in this scope
13  --> $DIR/while-let-typo.rs:8:11
14   |
15LL |     while x = 5 {}
16   |           ^ not found in this scope
17   |
18help: you might have meant to use pattern matching
19   |
20LL |     while let x = 5 {}
21   |           +++
22
23error[E0308]: mismatched types
24  --> $DIR/while-let-typo.rs:5:11
25   |
26LL |     while Some(foo) = bar {}
27   |           ^^^^^^^^^^^^^^^ expected `bool`, found `()`
28   |
29help: consider adding `let`
30   |
31LL |     while let Some(foo) = bar {}
32   |           +++
33
34error[E0308]: mismatched types
35  --> $DIR/while-let-typo.rs:6:11
36   |
37LL |     while 3 = foo {}
38   |           ^^^^^^^ expected `bool`, found `()`
39
40error[E0070]: invalid left-hand side of assignment
41  --> $DIR/while-let-typo.rs:7:19
42   |
43LL |     while Some(3) = foo {}
44   |                -  ^
45   |                |
46   |                cannot assign to this expression
47   |
48help: you might have meant to use pattern destructuring
49   |
50LL |     while let Some(3) = foo {}
51   |           +++
52
53error: aborting due to 5 previous errors
54
55Some errors have detailed explanations: E0070, E0308, E0425.
56For more information about an error, try `rustc --explain E0070`.