]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type/type-check/assignment-in-if.stderr
05280aab2ddfb9e21ddfe84a533f66a6ad6f1b9b
[rust.git] / src / test / ui / type / type-check / assignment-in-if.stderr
1 error[E0308]: mismatched types
2   --> $DIR/assignment-in-if.rs:15:8
3    |
4 LL |     if x = x {
5    |        ^^^^^
6    |        |
7    |        expected bool, found ()
8    |        help: try comparing for equality: `x == x`
9    |
10    = note:   expected type `bool`
11            found unit type `()`
12
13 error[E0308]: mismatched types
14   --> $DIR/assignment-in-if.rs:20:8
15    |
16 LL |     if (x = x) {
17    |        ^^^^^^^
18    |        |
19    |        expected bool, found ()
20    |        help: try comparing for equality: `x == x`
21    |
22    = note:   expected type `bool`
23            found unit type `()`
24
25 error[E0308]: mismatched types
26   --> $DIR/assignment-in-if.rs:25:8
27    |
28 LL |     if y = (Foo { foo: x }) {
29    |        ^^^^^^^^^^^^^^^^^^^^
30    |        |
31    |        expected bool, found ()
32    |        help: try comparing for equality: `y == (Foo { foo: x })`
33    |
34    = note:   expected type `bool`
35            found unit type `()`
36
37 error[E0308]: mismatched types
38   --> $DIR/assignment-in-if.rs:30:8
39    |
40 LL |     if 3 = x {
41    |        ^^^^^
42    |        |
43    |        expected bool, found ()
44    |        help: try comparing for equality: `3 == x`
45    |
46    = note:   expected type `bool`
47            found unit type `()`
48
49 error[E0308]: mismatched types
50   --> $DIR/assignment-in-if.rs:36:13
51    |
52 LL |             x = 4
53    |             ^^^^^
54    |             |
55    |             expected bool, found ()
56    |             help: try comparing for equality: `x == 4`
57    |
58    = note:   expected type `bool`
59            found unit type `()`
60
61 error[E0308]: mismatched types
62   --> $DIR/assignment-in-if.rs:38:13
63    |
64 LL |             x = 5
65    |             ^^^^^
66    |             |
67    |             expected bool, found ()
68    |             help: try comparing for equality: `x == 5`
69    |
70    = note:   expected type `bool`
71            found unit type `()`
72
73 error: aborting due to 6 previous errors
74
75 For more information about this error, try `rustc --explain E0308`.