|
11 | 11 | use super::{probe, MethodCallee}; |
12 | 12 |
|
13 | 13 | use astconv::AstConv; |
14 | | -use check::{FnCtxt, LvalueOp, callee, LvaluePreference, PreferMutLvalue}; |
| 14 | +use check::{FnCtxt, LvalueOp, callee, Needs}; |
15 | 15 | use hir::def_id::DefId; |
16 | 16 | use rustc::ty::subst::Substs; |
17 | 17 | use rustc::traits; |
@@ -155,7 +155,7 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { |
155 | 155 | let (_, n) = autoderef.nth(pick.autoderefs).unwrap(); |
156 | 156 | assert_eq!(n, pick.autoderefs); |
157 | 157 |
|
158 | | - let mut adjustments = autoderef.adjust_steps(LvaluePreference::NoPreference); |
| 158 | + let mut adjustments = autoderef.adjust_steps(Needs::None); |
159 | 159 |
|
160 | 160 | let mut target = autoderef.unambiguous_final_ty(); |
161 | 161 |
|
@@ -449,10 +449,10 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { |
449 | 449 | .adjustments_mut() |
450 | 450 | .remove(expr.hir_id); |
451 | 451 | if let Some(mut adjustments) = previous_adjustments { |
452 | | - let pref = LvaluePreference::PreferMutLvalue; |
| 452 | + let needs = Needs::MutPlace; |
453 | 453 | for adjustment in &mut adjustments { |
454 | 454 | if let Adjust::Deref(Some(ref mut deref)) = adjustment.kind { |
455 | | - if let Some(ok) = self.try_overloaded_deref(expr.span, source, pref) { |
| 455 | + if let Some(ok) = self.try_overloaded_deref(expr.span, source, needs) { |
456 | 456 | let method = self.register_infer_ok_obligations(ok); |
457 | 457 | if let ty::TyRef(region, mt) = method.sig.output().sty { |
458 | 458 | *deref = OverloadedDeref { |
@@ -505,7 +505,7 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { |
505 | 505 | .ty; |
506 | 506 |
|
507 | 507 | let method = self.try_overloaded_lvalue_op( |
508 | | - expr.span, base_ty, arg_tys, PreferMutLvalue, op); |
| 508 | + expr.span, base_ty, arg_tys, Needs::MutPlace, op); |
509 | 509 | let method = match method { |
510 | 510 | Some(ok) => self.register_infer_ok_obligations(ok), |
511 | 511 | None => return self.tcx.sess.delay_span_bug(expr.span, "re-trying op failed") |
|
0 commit comments