diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 0f976c11938c..8581c40c843e 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -3247,6 +3247,23 @@ impl Clean for hir::Path { } } +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Debug, Hash)] +pub enum GenericArg { + Lifetime(Lifetime), + Type(Type), + Const(Constant), +} + +impl fmt::Display for GenericArg { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + GenericArg::Lifetime(lt) => lt.fmt(f), + GenericArg::Type(ty) => ty.fmt(f), + GenericArg::Const(ct) => ct.fmt(f), + } + } +} + #[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Debug, Hash)] pub enum GenericArgs { AngleBracketed {