]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type/type-check/assignment-in-if.stderr
fix [type error] for error E0029 and E0277
[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    |        ^^^^^ expected `bool`, found `()`
6    |
7 help: you might have meant to compare for equality
8    |
9 LL |     if x == x {
10    |           +
11
12 error[E0308]: mismatched types
13   --> $DIR/assignment-in-if.rs:20:8
14    |
15 LL |     if (x = x) {
16    |        ^^^^^^^ expected `bool`, found `()`
17    |
18 help: you might have meant to compare for equality
19    |
20 LL |     if (x == x) {
21    |            +
22
23 error[E0308]: mismatched types
24   --> $DIR/assignment-in-if.rs:25:8
25    |
26 LL |     if y = (Foo { foo: x }) {
27    |        ^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
28    |
29 help: you might have meant to compare for equality
30    |
31 LL |     if y == (Foo { foo: x }) {
32    |           +
33
34 error[E0308]: mismatched types
35   --> $DIR/assignment-in-if.rs:30:8
36    |
37 LL |     if 3 = x {
38    |        ^^^^^ expected `bool`, found `()`
39    |
40 help: you might have meant to compare for equality
41    |
42 LL |     if 3 == x {
43    |           +
44
45 error[E0308]: mismatched types
46   --> $DIR/assignment-in-if.rs:36:13
47    |
48 LL |             x = 4
49    |             ^^^^^ expected `bool`, found `()`
50    |
51 help: you might have meant to compare for equality
52    |
53 LL |             x == 4
54    |                +
55
56 error[E0308]: mismatched types
57   --> $DIR/assignment-in-if.rs:38:13
58    |
59 LL |             x = 5
60    |             ^^^^^ expected `bool`, found `()`
61    |
62 help: you might have meant to compare for equality
63    |
64 LL |             x == 5
65    |                +
66
67 error[E0308]: mismatched types
68   --> $DIR/assignment-in-if.rs:44:18
69    |
70 LL |     if x == x && x = x && x == x {
71    |        ------    ^ expected `bool`, found `usize`
72    |        |
73    |        expected because this is `bool`
74
75 error[E0308]: mismatched types
76   --> $DIR/assignment-in-if.rs:44:22
77    |
78 LL |     if x == x && x = x && x == x {
79    |                      ^ expected `bool`, found `usize`
80
81 error[E0308]: mismatched types
82   --> $DIR/assignment-in-if.rs:44:8
83    |
84 LL |     if x == x && x = x && x == x {
85    |        ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
86    |
87 help: you might have meant to compare for equality
88    |
89 LL |     if x == x && x == x && x == x {
90    |                     +
91
92 error[E0308]: mismatched types
93   --> $DIR/assignment-in-if.rs:51:28
94    |
95 LL |     if x == x && x == x && x = x {
96    |        ----------------    ^ expected `bool`, found `usize`
97    |        |
98    |        expected because this is `bool`
99
100 error[E0308]: mismatched types
101   --> $DIR/assignment-in-if.rs:51:8
102    |
103 LL |     if x == x && x == x && x = x {
104    |        ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
105    |
106 help: you might have meant to compare for equality
107    |
108 LL |     if x == x && x == x && x == x {
109    |                               +
110
111 error[E0308]: mismatched types
112   --> $DIR/assignment-in-if.rs:57:12
113    |
114 LL |     if x = 1 && x == 1 {
115    |            ^ expected `bool`, found integer
116
117 error[E0308]: mismatched types
118   --> $DIR/assignment-in-if.rs:57:8
119    |
120 LL |     if x = 1 && x == 1 {
121    |        ^^^^^^^^^^^^^^^ expected `bool`, found `()`
122    |
123 help: you might have meant to compare for equality
124    |
125 LL |     if x == 1 && x == 1 {
126    |           +
127
128 error: aborting due to 13 previous errors
129
130 For more information about this error, try `rustc --explain E0308`.