|
10 | 10 |
|
11 | 11 | use astconv::AstConv; |
12 | 12 |
|
13 | | -use super::{FnCtxt, LvalueOp}; |
| 13 | +use super::{FnCtxt, LvalueOp, LvaluePreference}; |
14 | 14 | use super::method::MethodCallee; |
15 | 15 |
|
16 | 16 | use rustc::infer::InferOk; |
17 | 17 | use rustc::session::DiagnosticMessageId; |
18 | 18 | use rustc::traits; |
19 | 19 | use rustc::ty::{self, Ty, TraitRef}; |
20 | 20 | use rustc::ty::{ToPredicate, TypeFoldable}; |
21 | | -use rustc::ty::{LvaluePreference, NoPreference}; |
22 | 21 | use rustc::ty::adjustment::{Adjustment, Adjust, OverloadedDeref}; |
23 | 22 |
|
24 | 23 | use syntax_pos::Span; |
@@ -85,7 +84,7 @@ impl<'a, 'gcx, 'tcx> Iterator for Autoderef<'a, 'gcx, 'tcx> { |
85 | 84 |
|
86 | 85 | // Otherwise, deref if type is derefable: |
87 | 86 | let (kind, new_ty) = |
88 | | - if let Some(mt) = self.cur_ty.builtin_deref(self.include_raw_pointers, NoPreference) { |
| 87 | + if let Some(mt) = self.cur_ty.builtin_deref(self.include_raw_pointers) { |
89 | 88 | (AutoderefKind::Builtin, mt.ty) |
90 | 89 | } else { |
91 | 90 | let ty = self.overloaded_deref_ty(self.cur_ty)?; |
@@ -238,8 +237,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { |
238 | 237 | pub fn try_overloaded_deref(&self, |
239 | 238 | span: Span, |
240 | 239 | base_ty: Ty<'tcx>, |
241 | | - pref: LvaluePreference) |
| 240 | + needs: Needs) |
242 | 241 | -> Option<InferOk<'tcx, MethodCallee<'tcx>>> { |
243 | | - self.try_overloaded_lvalue_op(span, base_ty, &[], pref, LvalueOp::Deref) |
| 242 | + self.try_overloaded_lvalue_op(span, base_ty, &[], needs, LvalueOp::Deref) |
244 | 243 | } |
245 | 244 | } |
0 commit comments