@@ -72,7 +72,7 @@ fn main() {
7272 {
7373 let mut e = Baz :: X ( 2 ) ;
7474 let _e0 = e. x ( ) ;
75- match e {
75+ match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed
7676 Baz :: X ( value) => value
7777 //[ast]~^ ERROR cannot use `e.0` because it was mutably borrowed
7878 //[mir]~^^ ERROR cannot use `e.0` because it was mutably borrowed
@@ -110,7 +110,7 @@ fn main() {
110110 {
111111 let mut e = Box :: new ( Baz :: X ( 3 ) ) ;
112112 let _e0 = e. x ( ) ;
113- match * e {
113+ match * e { //[mir]~ ERROR cannot use `*e` because it was mutably borrowed
114114 Baz :: X ( value) => value
115115 //[ast]~^ ERROR cannot use `e.0` because it was mutably borrowed
116116 //[mir]~^^ ERROR cannot use `e.0` because it was mutably borrowed
@@ -127,25 +127,25 @@ fn main() {
127127 {
128128 let mut v = & [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ;
129129 let _v = & mut v;
130- match v {
130+ match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed
131131 & [ x, _, .., _, _] => println ! ( "{}" , x) ,
132132 //[ast]~^ ERROR cannot use `v[..]` because it was mutably borrowed
133133 //[mir]~^^ ERROR cannot use `v[..]` because it was mutably borrowed
134134 _ => panic ! ( "other case" ) ,
135135 }
136- match v {
136+ match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed
137137 & [ _, x, .., _, _] => println ! ( "{}" , x) ,
138138 //[ast]~^ ERROR cannot use `v[..]` because it was mutably borrowed
139139 //[mir]~^^ ERROR cannot use `v[..]` because it was mutably borrowed
140140 _ => panic ! ( "other case" ) ,
141141 }
142- match v {
142+ match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed
143143 & [ _, _, .., x, _] => println ! ( "{}" , x) ,
144144 //[ast]~^ ERROR cannot use `v[..]` because it was mutably borrowed
145145 //[mir]~^^ ERROR cannot use `v[..]` because it was mutably borrowed
146146 _ => panic ! ( "other case" ) ,
147147 }
148- match v {
148+ match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed
149149 & [ _, _, .., _, x] => println ! ( "{}" , x) ,
150150 //[ast]~^ ERROR cannot use `v[..]` because it was mutably borrowed
151151 //[mir]~^^ ERROR cannot use `v[..]` because it was mutably borrowed
@@ -156,25 +156,25 @@ fn main() {
156156 {
157157 let mut v = & [ 1 , 2 , 3 , 4 , 5 ] ;
158158 let _v = & mut v;
159- match v {
159+ match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed
160160 & [ x..] => println ! ( "{:?}" , x) ,
161161 //[ast]~^ ERROR cannot use `v[..]` because it was mutably borrowed
162162 //[mir]~^^ ERROR cannot use `v[..]` because it was mutably borrowed
163163 _ => panic ! ( "other case" ) ,
164164 }
165- match v {
165+ match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed
166166 & [ _, x..] => println ! ( "{:?}" , x) ,
167167 //[ast]~^ ERROR cannot use `v[..]` because it was mutably borrowed
168168 //[mir]~^^ ERROR cannot use `v[..]` because it was mutably borrowed
169169 _ => panic ! ( "other case" ) ,
170170 }
171- match v {
171+ match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed
172172 & [ x.., _] => println ! ( "{:?}" , x) ,
173173 //[ast]~^ ERROR cannot use `v[..]` because it was mutably borrowed
174174 //[mir]~^^ ERROR cannot use `v[..]` because it was mutably borrowed
175175 _ => panic ! ( "other case" ) ,
176176 }
177- match v {
177+ match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed
178178 & [ _, x.., _] => println ! ( "{:?}" , x) ,
179179 //[ast]~^ ERROR cannot use `v[..]` because it was mutably borrowed
180180 //[mir]~^^ ERROR cannot use `v[..]` because it was mutably borrowed
@@ -187,7 +187,7 @@ fn main() {
187187
188188 let mut e = E :: A ( 3 ) ;
189189 let _e = & mut e;
190- match e {
190+ match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed
191191 E :: A ( ref ax) =>
192192 //[ast]~^ ERROR cannot borrow `e.0` as immutable because `e` is also borrowed as mutable
193193 //[mir]~^^ ERROR cannot borrow `e.0` as immutable because it is also borrowed as mutable
@@ -205,14 +205,14 @@ fn main() {
205205 struct S { x : F , y : ( u32 , u32 ) , } ;
206206 let mut s = S { x : F { x : 1 , y : 2 } , y : ( 999 , 998 ) } ;
207207 let _s = & mut s;
208- match s {
208+ match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed
209209 S { y : ( ref y0, _) , .. } =>
210210 //[ast]~^ ERROR cannot borrow `s.y.0` as immutable because `s` is also borrowed as mutable
211211 //[mir]~^^ ERROR cannot borrow `s.y.0` as immutable because it is also borrowed as mutable
212212 println ! ( "y0: {:?}" , y0) ,
213213 _ => panic ! ( "other case" ) ,
214214 }
215- match s {
215+ match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed
216216 S { x : F { y : ref x0, .. } , .. } =>
217217 //[ast]~^ ERROR cannot borrow `s.x.y` as immutable because `s` is also borrowed as mutable
218218 //[mir]~^^ ERROR cannot borrow `s.x.y` as immutable because it is also borrowed as mutable
@@ -263,7 +263,7 @@ fn main() {
263263 struct F { x : u32 , y : u32 } ;
264264 let mut v = & [ F { x : 1 , y : 2 } , F { x : 3 , y : 4 } ] ;
265265 let _v = & mut v;
266- match v {
266+ match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed
267267 & [ _, F { x : ref xf, ..} ] => println ! ( "{}" , xf) ,
268268 //[mir]~^ ERROR cannot borrow `v[..].x` as immutable because it is also borrowed as mutable
269269 // No errors in AST
0 commit comments