about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2021-12-03 13:36:06 -0800
committerNoah Lev <camelidcamel@gmail.com>2021-12-03 14:05:41 -0800
commitf9ed012000e6b97878abe6ad41c7842be23590c3 (patch)
tree1e682b075645d85989e36998a777b6bdb12b6d8c
parent927a5e393ccb68fc7166f7737459dad42d5e50ca (diff)
downloadrust-f9ed012000e6b97878abe6ad41c7842be23590c3.tar.gz
rust-f9ed012000e6b97878abe6ad41c7842be23590c3.zip
Clean up definition of `clean_ty_generics` a bit
-rw-r--r--src/librustdoc/clean/mod.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 110ee839f7c..116364ea310 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -31,6 +31,7 @@ use rustc_typeck::hir_ty_to_ty;
 
 use std::assert_matches::assert_matches;
 use std::collections::hash_map::Entry;
+use std::collections::BTreeMap;
 use std::default::Default;
 use std::hash::Hash;
 use std::{mem, vec};
@@ -527,9 +528,6 @@ fn clean_ty_generics(
     gens: &ty::Generics,
     preds: ty::GenericPredicates<'tcx>,
 ) -> Generics {
-    use self::WherePredicate as WP;
-    use std::collections::BTreeMap;
-
     // Don't populate `cx.impl_trait_bounds` before `clean`ning `where` clauses,
     // since `Clean for ty::Predicate` would consume them.
     let mut impl_trait = BTreeMap::<ImplTraitParam, Vec<GenericBound>>::default();
@@ -650,7 +648,7 @@ fn clean_ty_generics(
     // handled in cleaning associated types
     let mut sized_params = FxHashSet::default();
     where_predicates.retain(|pred| match *pred {
-        WP::BoundPredicate { ty: Generic(ref g), ref bounds, .. } => {
+        WherePredicate::BoundPredicate { ty: Generic(ref g), ref bounds, .. } => {
             if bounds.iter().any(|b| b.is_sized_bound(cx)) {
                 sized_params.insert(*g);
                 false
@@ -667,7 +665,7 @@ fn clean_ty_generics(
         if matches!(tp.kind, types::GenericParamDefKind::Type { .. })
             && !sized_params.contains(&tp.name)
         {
-            where_predicates.push(WP::BoundPredicate {
+            where_predicates.push(WherePredicate::BoundPredicate {
                 ty: Type::Generic(tp.name),
                 bounds: vec![GenericBound::maybe_sized(cx)],
                 bound_params: Vec::new(),