diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index 18a4d8a475380..178b0c7419d9d 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -362,7 +362,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { let types = args .iter() .filter_map(|arg| match arg { - GenericArg::Type(ty) => Some(ty.clone()), + GenericArg::Type(ty) => Some((**ty).clone()), _ => None, }) .collect(); diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 521a88f9beb19..43026bd0f8cd7 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1767,7 +1767,7 @@ impl Clean for hir::GenericArgs<'_> { GenericArg::Lifetime(lt.clean(cx)) } hir::GenericArg::Lifetime(_) => GenericArg::Lifetime(Lifetime::elided()), - hir::GenericArg::Type(ty) => GenericArg::Type(ty.clean(cx)), + hir::GenericArg::Type(ty) => GenericArg::Type(Box::new(ty.clean(cx))), hir::GenericArg::Const(ct) => GenericArg::Const(Box::new(ct.clean(cx))), hir::GenericArg::Infer(_inf) => GenericArg::Infer, }) diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 6feba34134c59..dd3151b4ee8ad 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1985,7 +1985,7 @@ impl Path { Some( args.iter() .filter_map(|arg| match arg { - GenericArg::Type(ty) => Some(ty), + GenericArg::Type(ty) => Some(&**ty), _ => None, }) .collect(), @@ -2010,7 +2010,7 @@ impl Path { #[derive(Clone, PartialEq, Eq, Debug, Hash)] crate enum GenericArg { Lifetime(Lifetime), - Type(Type), + Type(Box), Const(Box), Infer, } @@ -2018,7 +2018,7 @@ crate enum GenericArg { // `GenericArg` can occur many times in a single `Path`, so make sure it // doesn't increase in size unexpectedly. #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] -rustc_data_structures::static_assert_size!(GenericArg, 80); +rustc_data_structures::static_assert_size!(GenericArg, 16); #[derive(Clone, PartialEq, Eq, Debug, Hash)] crate enum GenericArgs { diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index dabf1e878c9fb..65549a3b5e078 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -101,7 +101,7 @@ fn external_generic_args( } GenericArgKind::Type(ty) => { ty_kind = Some(ty.kind()); - Some(GenericArg::Type(ty.clean(cx))) + Some(GenericArg::Type(Box::new(ty.clean(cx)))) } GenericArgKind::Const(ct) => Some(GenericArg::Const(Box::new(ct.clean(cx)))), }) diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index e77bd5c922313..9adb6c382be41 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -136,7 +136,7 @@ impl FromWithTcx for GenericArg { use clean::GenericArg::*; match arg { Lifetime(l) => GenericArg::Lifetime(l.0.to_string()), - Type(t) => GenericArg::Type(t.into_tcx(tcx)), + Type(t) => GenericArg::Type((*t).into_tcx(tcx)), Const(box c) => GenericArg::Const(c.into_tcx(tcx)), Infer => GenericArg::Infer, }