about summary refs log tree commit diff
path: root/src/librustdoc
diff options
context:
space:
mode:
authorjackh726 <jack.huey@umassmed.edu>2021-08-15 04:17:36 -0400
committerjackh726 <jack.huey@umassmed.edu>2021-09-07 18:25:57 -0400
commit22ef04e22fc78ce0dcaaf8c8faa5944c983cdc1d (patch)
tree9d734e51862656f47ca0d6ad15a56e74ec30351b /src/librustdoc
parent216906fb75a7211f7905d3b37274c6b6ec331295 (diff)
downloadrust-22ef04e22fc78ce0dcaaf8c8faa5944c983cdc1d.tar.gz
rust-22ef04e22fc78ce0dcaaf8c8faa5944c983cdc1d.zip
A bit of cleanup to astconv
Diffstat (limited to 'src/librustdoc')
-rw-r--r--src/librustdoc/clean/mod.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 71348b3eb65..a95300217ab 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -129,7 +129,6 @@ impl Clean<GenericBound> for hir::GenericBound<'_> {
     fn clean(&self, cx: &mut DocContext<'_>) -> GenericBound {
         match *self {
             hir::GenericBound::Outlives(lt) => GenericBound::Outlives(lt.clean(cx)),
-            hir::GenericBound::Unsized(_) => GenericBound::maybe_sized(cx),
             hir::GenericBound::LangItemTrait(lang_item, span, _, generic_args) => {
                 let def_id = cx.tcx.require_lang_item(lang_item, Some(span));
 
@@ -557,19 +556,13 @@ impl Clean<Generics> for hir::Generics<'_> {
                 WherePredicate::BoundPredicate {
                     ty: Generic(ref name), ref mut bounds, ..
                 } => {
-                    if let [] | [GenericBound::TraitBound(_, hir::TraitBoundModifier::Maybe)] =
-                        &bounds[..]
-                    {
+                    if bounds.is_empty() {
                         for param in &mut generics.params {
                             match param.kind {
                                 GenericParamDefKind::Lifetime { .. } => {}
                                 GenericParamDefKind::Type { bounds: ref mut ty_bounds, .. } => {
                                     if &param.name == name {
                                         mem::swap(bounds, ty_bounds);
-                                        // We now keep track of `?Sized` obligations in the HIR.
-                                        // If we don't clear `ty_bounds` we end up with
-                                        // `fn foo<X: ?Sized>(_: X) where X: ?Sized`.
-                                        ty_bounds.clear();
                                         break;
                                     }
                                 }