File tree 2 files changed +51
-12
lines changed
2 files changed +51
-12
lines changed Original file line number Diff line number Diff line change 1
1
fn main ( ) {
2
- let x = "foo" ;
2
+ let _ = match true {
3
+ true => (
3
4
4
5
5
6
@@ -87,5 +88,30 @@ fn main() {
87
88
88
89
89
90
90
- let y = & mut x; //~ ERROR cannot borrow
91
+
92
+ ) ,
93
+ false => "
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+ " , //~^^^^^^^^^^^^^^^^^^^^^^ ERROR `match` arms have incompatible types
116
+ } ;
91
117
}
Original file line number Diff line number Diff line change 1
- error[E0596 ]: cannot borrow `x` as mutable, as it is not declared as mutable
2
- --> $DIR/huge_multispan_highlight.rs:90:13
1
+ error[E0308 ]: `match` arms have incompatible types
2
+ --> $DIR/huge_multispan_highlight.rs:93:18
3
3
|
4
- LL | let y = &mut x;
5
- | ^^^^^^ cannot borrow as mutable
6
- |
7
- help: consider changing this to be mutable
8
- |
9
- LL | let mut x = "foo";
10
- | +++
4
+ LL | let _ = match true {
5
+ | ---------- `match` arms have incompatible types
6
+ LL | true => (
7
+ | _________________-
8
+ LL | |
9
+ LL | |
10
+ LL | |
11
+ ... |
12
+ LL | |
13
+ LL | | ),
14
+ | |_________- this is found to be of type `()`
15
+ LL | false => "
16
+ | __________________^
17
+ LL | |
18
+ LL | |
19
+ LL | |
20
+ ... |
21
+ LL | |
22
+ LL | | ",
23
+ | |_________^ expected `()`, found `&str`
11
24
12
25
error: aborting due to 1 previous error
13
26
14
- For more information about this error, try `rustc --explain E0596 `.
27
+ For more information about this error, try `rustc --explain E0308 `.
You can’t perform that action at this time.
0 commit comments