Skip to content

Commit f9ed012

Browse files
committed
Clean up definition of clean_ty_generics a bit
1 parent 927a5e3 commit f9ed012

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use rustc_typeck::hir_ty_to_ty;
3131

3232
use std::assert_matches::assert_matches;
3333
use std::collections::hash_map::Entry;
34+
use std::collections::BTreeMap;
3435
use std::default::Default;
3536
use std::hash::Hash;
3637
use std::{mem, vec};
@@ -527,9 +528,6 @@ fn clean_ty_generics(
527528
gens: &ty::Generics,
528529
preds: ty::GenericPredicates<'tcx>,
529530
) -> Generics {
530-
use self::WherePredicate as WP;
531-
use std::collections::BTreeMap;
532-
533531
// Don't populate `cx.impl_trait_bounds` before `clean`ning `where` clauses,
534532
// since `Clean for ty::Predicate` would consume them.
535533
let mut impl_trait = BTreeMap::<ImplTraitParam, Vec<GenericBound>>::default();
@@ -650,7 +648,7 @@ fn clean_ty_generics(
650648
// handled in cleaning associated types
651649
let mut sized_params = FxHashSet::default();
652650
where_predicates.retain(|pred| match *pred {
653-
WP::BoundPredicate { ty: Generic(ref g), ref bounds, .. } => {
651+
WherePredicate::BoundPredicate { ty: Generic(ref g), ref bounds, .. } => {
654652
if bounds.iter().any(|b| b.is_sized_bound(cx)) {
655653
sized_params.insert(*g);
656654
false
@@ -667,7 +665,7 @@ fn clean_ty_generics(
667665
if matches!(tp.kind, types::GenericParamDefKind::Type { .. })
668666
&& !sized_params.contains(&tp.name)
669667
{
670-
where_predicates.push(WP::BoundPredicate {
668+
where_predicates.push(WherePredicate::BoundPredicate {
671669
ty: Type::Generic(tp.name),
672670
bounds: vec![GenericBound::maybe_sized(cx)],
673671
bound_params: Vec::new(),

0 commit comments

Comments
 (0)