Skip to content

Commit 29ed491

Browse files
varkoryodaldevoid
andcommitted
Add GenericArg
Co-Authored-By: Gabriel Smith <[email protected]>
1 parent 1491315 commit 29ed491

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/librustdoc/clean/mod.rs

+17
Original file line numberDiff line numberDiff line change
@@ -3247,6 +3247,23 @@ impl Clean<Path> for hir::Path {
32473247
}
32483248
}
32493249

3250+
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Debug, Hash)]
3251+
pub enum GenericArg {
3252+
Lifetime(Lifetime),
3253+
Type(Type),
3254+
Const(Constant),
3255+
}
3256+
3257+
impl fmt::Display for GenericArg {
3258+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3259+
match self {
3260+
GenericArg::Lifetime(lt) => lt.fmt(f),
3261+
GenericArg::Type(ty) => ty.fmt(f),
3262+
GenericArg::Const(ct) => ct.fmt(f),
3263+
}
3264+
}
3265+
}
3266+
32503267
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Debug, Hash)]
32513268
pub enum GenericArgs {
32523269
AngleBracketed {

0 commit comments

Comments
 (0)