Add GenericArg

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
This commit is contained in:
varkor 2019-03-13 23:39:03 +00:00
parent 14913159e0
commit 29ed491743

View file

@ -3247,6 +3247,23 @@ impl Clean<Path> 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 {