@@ -258,25 +258,25 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
258
258
format ! ( "cannot use `{}=` on type `{}`" ,
259
259
op. node. as_str( ) , lhs_ty) ) ;
260
260
let mut suggested_deref = false ;
261
- if let TyRef ( _, mut ty_mut ) = lhs_ty. sty {
261
+ if let TyRef ( _, mut rty , _ ) = lhs_ty. sty {
262
262
if {
263
263
!self . infcx . type_moves_by_default ( self . param_env ,
264
- ty_mut . ty ,
264
+ rty ,
265
265
lhs_expr. span ) &&
266
- self . lookup_op_method ( ty_mut . ty ,
267
- & [ rhs_ty] ,
268
- Op :: Binary ( op, is_assign) )
266
+ self . lookup_op_method ( rty ,
267
+ & [ rhs_ty] ,
268
+ Op :: Binary ( op, is_assign) )
269
269
. is_ok ( )
270
270
} {
271
271
if let Ok ( lstring) = codemap. span_to_snippet ( lhs_expr. span ) {
272
- while let TyRef ( _, ty_mut_inner ) = ty_mut . ty . sty {
273
- ty_mut = ty_mut_inner ;
272
+ while let TyRef ( _, rty_inner , _ ) = rty . sty {
273
+ rty = rty_inner ;
274
274
}
275
275
let msg = & format ! (
276
276
"`{}=` can be used on '{}', you can \
277
277
dereference `{2}`: `*{2}`",
278
278
op. node. as_str( ) ,
279
- ty_mut . ty ,
279
+ rty ,
280
280
lstring
281
281
) ;
282
282
err. help ( msg) ;
@@ -326,25 +326,25 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
326
326
op. node. as_str( ) ,
327
327
lhs_ty) ;
328
328
let mut suggested_deref = false ;
329
- if let TyRef ( _, mut ty_mut ) = lhs_ty. sty {
329
+ if let TyRef ( _, mut rty , _ ) = lhs_ty. sty {
330
330
if {
331
331
!self . infcx . type_moves_by_default ( self . param_env ,
332
- ty_mut . ty ,
332
+ rty ,
333
333
lhs_expr. span ) &&
334
- self . lookup_op_method ( ty_mut . ty ,
335
- & [ rhs_ty] ,
336
- Op :: Binary ( op, is_assign) )
334
+ self . lookup_op_method ( rty ,
335
+ & [ rhs_ty] ,
336
+ Op :: Binary ( op, is_assign) )
337
337
. is_ok ( )
338
338
} {
339
339
if let Ok ( lstring) = codemap. span_to_snippet ( lhs_expr. span ) {
340
- while let TyRef ( _, ty_mut_inner ) = ty_mut . ty . sty {
341
- ty_mut = ty_mut_inner ;
340
+ while let TyRef ( _, rty_inner , _ ) = rty . sty {
341
+ rty = rty_inner ;
342
342
}
343
343
let msg = & format ! (
344
344
"`{}` can be used on '{}', you can \
345
345
dereference `{2}`: `*{2}`",
346
346
op. node. as_str( ) ,
347
- ty_mut . ty ,
347
+ rty ,
348
348
lstring
349
349
) ;
350
350
err. help ( msg) ;
@@ -478,7 +478,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
478
478
err. note ( & format ! ( "unsigned values cannot be negated" ) ) ;
479
479
} ,
480
480
TyStr | TyNever | TyChar | TyTuple ( _) | TyArray ( _, _) => { } ,
481
- TyRef ( _, ref lty) if lty. ty . sty == TyStr => { } ,
481
+ TyRef ( _, ref lty, _ ) if lty. sty == TyStr => { } ,
482
482
_ => {
483
483
let missing_trait = match op {
484
484
hir:: UnNeg => "std::ops::Neg" ,
0 commit comments