]> git.lizzy.rs Git - rust.git/commitdiff
Remove `projection_ty_from_predicates`
authorYuki Okushi <yuki.okushi@huawei.com>
Wed, 16 Jun 2021 07:33:03 +0000 (16:33 +0900)
committerYuki Okushi <yuki.okushi@huawei.com>
Wed, 16 Jun 2021 07:33:03 +0000 (16:33 +0900)
compiler/rustc_middle/src/dep_graph/dep_node.rs
compiler/rustc_middle/src/query/mod.rs
compiler/rustc_typeck/src/collect.rs

index 8476929eaeced2b1d230e5e6f6d964e2e7d2a088..aa54d1ae7b9d118426d9702dac6384725e0b50c4 100644 (file)
@@ -285,7 +285,7 @@ pub mod label_strs {
 // required that their size stay the same, but we don't want to change
 // it inadvertently. This assert just ensures we're aware of any change.
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-static_assert_size!(DepNode, 18);
+static_assert_size!(DepNode, 17);
 
 #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
 static_assert_size!(DepNode, 24);
index 0860520ef9dfe8aa1dca8fab66ba9198489a9b95..a73d193408030fad2b46b09472b426e81613520a 100644 (file)
         desc { |tcx| "elaborating item bounds for `{}`", tcx.def_path_str(key) }
     }
 
-    query projection_ty_from_predicates(key: (DefId, DefId)) -> Option<ty::ProjectionTy<'tcx>> {
-        desc { |tcx| "finding projection type inside predicates of `{}`", tcx.def_path_str(key.0) }
-    }
-
     query native_libraries(_: CrateNum) -> Lrc<Vec<NativeLib>> {
         desc { "looking up the native libraries of a linked crate" }
     }
index ee3ac3b62d9ec7ed5d56b03004ad24a21a634700..55de04bfba0fe6b7e81d566daa719441f0d5c59c 100644 (file)
@@ -77,7 +77,6 @@ pub fn provide(providers: &mut Providers) {
         generics_of,
         predicates_of,
         predicates_defined_on,
-        projection_ty_from_predicates,
         explicit_predicates_of,
         super_predicates_of,
         super_predicates_that_define_assoc_type,
@@ -2352,29 +2351,6 @@ fn explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericPredicat
     }
 }
 
-fn projection_ty_from_predicates(
-    tcx: TyCtxt<'tcx>,
-    key: (
-        // ty_def_id
-        DefId,
-        // def_id of `N` in `<T as Trait>::N`
-        DefId,
-    ),
-) -> Option<ty::ProjectionTy<'tcx>> {
-    let (ty_def_id, item_def_id) = key;
-    let mut projection_ty = None;
-    for (predicate, _) in tcx.predicates_of(ty_def_id).predicates {
-        if let ty::PredicateKind::Projection(projection_predicate) = predicate.kind().skip_binder()
-        {
-            if item_def_id == projection_predicate.projection_ty.item_def_id {
-                projection_ty = Some(projection_predicate.projection_ty);
-                break;
-            }
-        }
-    }
-    projection_ty
-}
-
 /// Converts a specific `GenericBound` from the AST into a set of
 /// predicates that apply to the self type. A vector is returned
 /// because this can be anywhere from zero predicates (`T: ?Sized` adds no