]> git.lizzy.rs Git - rust.git/commitdiff
Rename *shallow_resolve to *shallow_resolve_type
authorvarkor <github@varkor.com>
Fri, 8 Mar 2019 01:21:19 +0000 (01:21 +0000)
committervarkor <github@varkor.com>
Wed, 1 May 2019 22:10:57 +0000 (23:10 +0100)
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
src/librustc/traits/fulfill.rs
src/librustc/traits/project.rs
src/librustc/traits/select.rs
src/librustc/ty/wf.rs
src/librustc_typeck/check/_match.rs
src/librustc_typeck/check/coercion.rs
src/librustc_typeck/check/mod.rs

index e725ebb797e379af9076113c3a26ee6da943f190..59a9fd11e1d577bab77c8c3b11a6d615eacb2583 100644 (file)
@@ -255,8 +255,8 @@ fn process_obligation(&mut self,
         // doing more work yet
         if !pending_obligation.stalled_on.is_empty() {
             if pending_obligation.stalled_on.iter().all(|&ty| {
-                // Use the force-inlined variant of shallow_resolve() because this code is hot.
-                let resolved_ty = self.selcx.infcx().inlined_shallow_resolve(&ty);
+                // Use the force-inlined variant of shallow_resolve_type() because this code is hot.
+                let resolved_ty = self.selcx.infcx().inlined_shallow_resolve_type(&ty);
                 resolved_ty == ty // nothing changed here
             }) {
                 debug!("process_predicate: pending obligation {:?} still stalled on {:?}",
index 882635e21f57c899aebf9e4045a148179378da89..763fa40d8f3bbfecb0df86dc2fae1cbb4805b537 100644 (file)
@@ -1229,7 +1229,7 @@ fn confirm_object_candidate<'cx, 'gcx, 'tcx>(
     -> Progress<'tcx>
 {
     let self_ty = obligation_trait_ref.self_ty();
-    let object_ty = selcx.infcx().shallow_resolve(self_ty);
+    let object_ty = selcx.infcx().shallow_resolve_type(self_ty);
     debug!("confirm_object_candidate(object_ty={:?})",
            object_ty);
     let data = match object_ty.sty {
@@ -1346,7 +1346,7 @@ fn confirm_fn_pointer_candidate<'cx, 'gcx, 'tcx>(
     fn_pointer_vtable: VtableFnPointerData<'tcx, PredicateObligation<'tcx>>)
     -> Progress<'tcx>
 {
-    let fn_type = selcx.infcx().shallow_resolve(fn_pointer_vtable.fn_ty);
+    let fn_type = selcx.infcx().shallow_resolve_type(fn_pointer_vtable.fn_ty);
     let sig = fn_type.fn_sig(selcx.tcx());
     let Normalized {
         value: sig,
@@ -1371,7 +1371,7 @@ fn confirm_closure_candidate<'cx, 'gcx, 'tcx>(
     let tcx = selcx.tcx();
     let infcx = selcx.infcx();
     let closure_sig_ty = vtable.substs.closure_sig_ty(vtable.closure_def_id, tcx);
-    let closure_sig = infcx.shallow_resolve(&closure_sig_ty).fn_sig(tcx);
+    let closure_sig = infcx.shallow_resolve_type(&closure_sig_ty).fn_sig(tcx);
     let Normalized {
         value: closure_sig,
         obligations
index 8beabe058cf4f7ecf851993b825a967c74e7861c..18ac30b7f1eb25ca35d3b2d6ffc981ab30bd16fa 100644 (file)
@@ -2403,7 +2403,7 @@ fn sized_conditions(
 
         // NOTE: binder moved to (*)
         let self_ty = self.infcx
-            .shallow_resolve(obligation.predicate.skip_binder().self_ty());
+            .shallow_resolve_type(obligation.predicate.skip_binder().self_ty());
 
         match self_ty.sty {
             ty::Infer(ty::IntVar(_))
@@ -2467,7 +2467,7 @@ fn copy_clone_conditions(
     ) -> BuiltinImplConditions<'tcx> {
         // NOTE: binder moved to (*)
         let self_ty = self.infcx
-            .shallow_resolve(obligation.predicate.skip_binder().self_ty());
+            .shallow_resolve_type(obligation.predicate.skip_binder().self_ty());
 
         use self::BuiltinImplConditions::{Ambiguous, None, Where};
 
@@ -2866,7 +2866,7 @@ fn confirm_auto_impl_candidate(
         );
 
         let types = obligation.predicate.map_bound(|inner| {
-            let self_ty = self.infcx.shallow_resolve(inner.self_ty());
+            let self_ty = self.infcx.shallow_resolve_type(inner.self_ty());
             self.constituent_types_for_ty(self_ty)
         });
         self.vtable_auto_impl(obligation, trait_def_id, types)
@@ -2990,7 +2990,7 @@ fn confirm_object_candidate(
         // from the object. Have to try to make a broken test case that
         // results.
         let self_ty = self.infcx
-            .shallow_resolve(*obligation.self_ty().skip_binder());
+            .shallow_resolve_type(*obligation.self_ty().skip_binder());
         let poly_trait_ref = match self_ty.sty {
             ty::Dynamic(ref data, ..) =>
                 data.principal().unwrap_or_else(|| {
@@ -3045,7 +3045,7 @@ fn confirm_fn_pointer_candidate(
 
         // OK to skip binder; it is reintroduced below
         let self_ty = self.infcx
-            .shallow_resolve(*obligation.self_ty().skip_binder());
+            .shallow_resolve_type(*obligation.self_ty().skip_binder());
         let sig = self_ty.fn_sig(self.tcx());
         let trait_ref = self.tcx()
             .closure_trait_ref_and_return_type(
@@ -3125,7 +3125,7 @@ fn confirm_generator_candidate(
         // touch bound regions, they just capture the in-scope
         // type/region parameters
         let self_ty = self.infcx
-            .shallow_resolve(obligation.self_ty().skip_binder());
+            .shallow_resolve_type(obligation.self_ty().skip_binder());
         let (generator_def_id, substs) = match self_ty.sty {
             ty::Generator(id, substs, _) => (id, substs),
             _ => bug!("closure candidate for non-closure {:?}", obligation),
@@ -3183,7 +3183,7 @@ fn confirm_closure_candidate(
         // touch bound regions, they just capture the in-scope
         // type/region parameters
         let self_ty = self.infcx
-            .shallow_resolve(obligation.self_ty().skip_binder());
+            .shallow_resolve_type(obligation.self_ty().skip_binder());
         let (closure_def_id, substs) = match self_ty.sty {
             ty::Closure(id, substs) => (id, substs),
             _ => bug!("closure candidate for non-closure {:?}", obligation),
@@ -3278,14 +3278,14 @@ fn confirm_builtin_unsize_candidate(
         // assemble_candidates_for_unsizing should ensure there are no late bound
         // regions here. See the comment there for more details.
         let source = self.infcx
-            .shallow_resolve(obligation.self_ty().no_bound_vars().unwrap());
+            .shallow_resolve_type(obligation.self_ty().no_bound_vars().unwrap());
         let target = obligation
             .predicate
             .skip_binder()
             .trait_ref
             .substs
             .type_at(1);
-        let target = self.infcx.shallow_resolve(target);
+        let target = self.infcx.shallow_resolve_type(target);
 
         debug!(
             "confirm_builtin_unsize_candidate(source={:?}, target={:?})",
index b793b37fb2ae109e5f9ed0dd7ae43585af246a2b..c8ee3fd482b3f618f1c6c97f77fd8ccbb380161d 100644 (file)
@@ -406,7 +406,7 @@ fn compute(&mut self, ty0: Ty<'tcx>) -> bool {
                 //    moving. (Goal is that an "inductive hypothesis"
                 //    is satisfied to ensure termination.)
                 ty::Infer(_) => {
-                    let ty = self.infcx.shallow_resolve(ty);
+                    let ty = self.infcx.shallow_resolve_type(ty);
                     if let ty::Infer(_) = ty.sty { // not yet resolved...
                         if ty == ty0 { // ...this is the type we started from! no progress.
                             return false;
index 8cdfbf5f55ca050ace9ca29c7f9089ddc97e68f4..f03a3bde84e4ce46a0d64d9b5558f4b14c426bfe 100644 (file)
@@ -350,7 +350,7 @@ pub fn check_pat_walk(
                 }
             }
             PatKind::Ref(ref inner, mutbl) => {
-                let expected = self.shallow_resolve(expected);
+                let expected = self.shallow_resolve_type(expected);
                 if self.check_dereferencable(pat.span, expected, &inner) {
                     // `demand::subtype` would be good enough, but using
                     // `eqtype` turns out to be equally general. See (*)
@@ -519,7 +519,7 @@ pub fn check_pat_walk(
 
     pub fn check_dereferencable(&self, span: Span, expected: Ty<'tcx>, inner: &hir::Pat) -> bool {
         if let PatKind::Binding(..) = inner.node {
-            if let Some(mt) = self.shallow_resolve(expected).builtin_deref(true) {
+            if let Some(mt) = self.shallow_resolve_type(expected).builtin_deref(true) {
                 if let ty::Dynamic(..) = mt.ty.sty {
                     // This is "x = SomeTrait" being reduced from
                     // "let &x = &SomeTrait" or "let box x = Box<SomeTrait>", an error.
index 85eb0f9d499669fd27424fd81ccb24cd6352d736..1c6601536eea1943b405ac694a5e249096261a43 100644 (file)
@@ -154,7 +154,7 @@ fn unify_and<F>(&self, a: Ty<'tcx>, b: Ty<'tcx>, f: F)
     }
 
     fn coerce(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> CoerceResult<'tcx> {
-        let a = self.shallow_resolve(a);
+        let a = self.shallow_resolve_type(a);
         debug!("Coerce.tys({:?} => {:?})", a, b);
 
         // Just ignore error types.
@@ -170,8 +170,8 @@ fn coerce(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> CoerceResult<'tcx> {
             //     let _: Option<?T> = Some({ return; });
             //
             // here, we would coerce from `!` to `?T`.
-            let b = self.shallow_resolve(b);
-            return if self.shallow_resolve(b).is_ty_var() {
+            let b = self.shallow_resolve_type(b);
+            return if self.shallow_resolve_type(b).is_ty_var() {
                 // micro-optimization: no need for this if `b` is
                 // already resolved in some way.
                 let diverging_ty = self.next_diverging_ty_var(
@@ -659,7 +659,7 @@ fn coerce_from_fn_pointer(&self,
         //! into a closure or a `proc`.
         //!
 
-        let b = self.shallow_resolve(b);
+        let b = self.shallow_resolve_type(b);
         debug!("coerce_from_fn_pointer(a={:?}, b={:?})", a, b);
 
         self.coerce_from_safe_fn(a, fn_ty_a, b,
@@ -673,7 +673,7 @@ fn coerce_from_fn_item(&self,
         //! Attempts to coerce from the type of a Rust function item
         //! into a closure or a `proc`.
 
-        let b = self.shallow_resolve(b);
+        let b = self.shallow_resolve_type(b);
         debug!("coerce_from_fn_item(a={:?}, b={:?})", a, b);
 
         match b.sty {
@@ -719,7 +719,7 @@ fn coerce_closure_to_fn(&self,
         //! into a function pointer.
         //!
 
-        let b = self.shallow_resolve(b);
+        let b = self.shallow_resolve_type(b);
 
         let hir_id_a = self.tcx.hir().as_local_hir_id(def_id_a).unwrap();
         match b.sty {
@@ -1128,7 +1128,7 @@ fn coerce_inner<'a>(&mut self,
         // compatibility (hopefully that is true) by helping us
         // uncover never types better.
         if expression_ty.is_ty_var() {
-            expression_ty = fcx.infcx.shallow_resolve(expression_ty);
+            expression_ty = fcx.infcx.shallow_resolve_type(expression_ty);
         }
 
         // If we see any error types, just propagate that error
index d2d486b52b3f86bc950290d08a77204084f89872..4b772abc5f09e85432ddc936d198fedb62d1b15c 100644 (file)
@@ -281,7 +281,7 @@ impl<'a, 'gcx, 'tcx> Expectation<'tcx> {
     fn adjust_for_branches(&self, fcx: &FnCtxt<'a, 'gcx, 'tcx>) -> Expectation<'tcx> {
         match *self {
             ExpectHasType(ety) => {
-                let ety = fcx.shallow_resolve(ety);
+                let ety = fcx.shallow_resolve_type(ety);
                 if !ety.is_ty_var() {
                     ExpectHasType(ety)
                 } else {
@@ -2792,7 +2792,7 @@ fn self_type_matches_expected_vid(
         trait_ref: ty::PolyTraitRef<'tcx>,
         expected_vid: ty::TyVid,
     ) -> bool {
-        let self_ty = self.shallow_resolve(trait_ref.self_ty());
+        let self_ty = self.shallow_resolve_type(trait_ref.self_ty());
         debug!(
             "self_type_matches_expected_vid(trait_ref={:?}, self_ty={:?}, expected_vid={:?})",
             trait_ref, self_ty, expected_vid