Skip to content

Commit d04308a

Browse files
committed
resolved merge conflict
1 parent 7c8a43b commit d04308a

File tree

1 file changed

+17
-17
lines changed
  • src/librustc_typeck/check

1 file changed

+17
-17
lines changed

src/librustc_typeck/check/op.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -258,25 +258,25 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
258258
format!("cannot use `{}=` on type `{}`",
259259
op.node.as_str(), lhs_ty));
260260
let mut suggested_deref = false;
261-
if let TyRef(_, mut ty_mut) = lhs_ty.sty {
261+
if let TyRef(_, mut rty, _) = lhs_ty.sty {
262262
if {
263263
!self.infcx.type_moves_by_default(self.param_env,
264-
ty_mut.ty,
264+
rty,
265265
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))
269269
.is_ok()
270270
} {
271271
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;
274274
}
275275
let msg = &format!(
276276
"`{}=` can be used on '{}', you can \
277277
dereference `{2}`: `*{2}`",
278278
op.node.as_str(),
279-
ty_mut.ty,
279+
rty,
280280
lstring
281281
);
282282
err.help(msg);
@@ -326,25 +326,25 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
326326
op.node.as_str(),
327327
lhs_ty);
328328
let mut suggested_deref = false;
329-
if let TyRef(_, mut ty_mut) = lhs_ty.sty {
329+
if let TyRef(_, mut rty, _) = lhs_ty.sty {
330330
if {
331331
!self.infcx.type_moves_by_default(self.param_env,
332-
ty_mut.ty,
332+
rty,
333333
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))
337337
.is_ok()
338338
} {
339339
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;
342342
}
343343
let msg = &format!(
344344
"`{}` can be used on '{}', you can \
345345
dereference `{2}`: `*{2}`",
346346
op.node.as_str(),
347-
ty_mut.ty,
347+
rty,
348348
lstring
349349
);
350350
err.help(msg);
@@ -478,7 +478,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
478478
err.note(&format!("unsigned values cannot be negated"));
479479
},
480480
TyStr | TyNever | TyChar | TyTuple(_) | TyArray(_,_) => {},
481-
TyRef(_, ref lty) if lty.ty.sty == TyStr => {},
481+
TyRef(_, ref lty, _) if lty.sty == TyStr => {},
482482
_ => {
483483
let missing_trait = match op {
484484
hir::UnNeg => "std::ops::Neg",

0 commit comments

Comments
 (0)