File tree 2 files changed +43
-1
lines changed
2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -19,4 +19,10 @@ fn main() {
19
19
if b_mut_ref ( ) { } //~ ERROR mismatched types [E0308]
20
20
if & true { } //~ ERROR mismatched types [E0308]
21
21
if & mut true { } //~ ERROR mismatched types [E0308]
22
+
23
+ // This is also NOT:
24
+ while b_ref ( ) { } //~ ERROR mismatched types [E0308]
25
+ while b_mut_ref ( ) { } //~ ERROR mismatched types [E0308]
26
+ while & true { } //~ ERROR mismatched types [E0308]
27
+ while & mut true { } //~ ERROR mismatched types [E0308]
22
28
}
Original file line number Diff line number Diff line change @@ -34,6 +34,42 @@ LL | if &mut true {}
34
34
= note: expected type `bool`
35
35
found type `&mut bool`
36
36
37
- error: aborting due to 4 previous errors
37
+ error[E0308]: mismatched types
38
+ --> $DIR/if-no-match-bindings.rs:24:11
39
+ |
40
+ LL | while b_ref() {}
41
+ | ^^^^^^^ expected bool, found &bool
42
+ |
43
+ = note: expected type `bool`
44
+ found type `&bool`
45
+
46
+ error[E0308]: mismatched types
47
+ --> $DIR/if-no-match-bindings.rs:25:11
48
+ |
49
+ LL | while b_mut_ref() {}
50
+ | ^^^^^^^^^^^ expected bool, found &mut bool
51
+ |
52
+ = note: expected type `bool`
53
+ found type `&mut bool`
54
+
55
+ error[E0308]: mismatched types
56
+ --> $DIR/if-no-match-bindings.rs:26:11
57
+ |
58
+ LL | while &true {}
59
+ | ^^^^^ expected bool, found &bool
60
+ |
61
+ = note: expected type `bool`
62
+ found type `&bool`
63
+
64
+ error[E0308]: mismatched types
65
+ --> $DIR/if-no-match-bindings.rs:27:11
66
+ |
67
+ LL | while &mut true {}
68
+ | ^^^^^^^^^ expected bool, found &mut bool
69
+ |
70
+ = note: expected type `bool`
71
+ found type `&mut bool`
72
+
73
+ error: aborting due to 8 previous errors
38
74
39
75
For more information about this error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments