diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index d774359fa79..d7d56ef659a 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -389,10 +389,17 @@ impl PathSegment { } } +#[derive(Clone, RustcEncodable, RustcDecodable, Debug)] +pub struct ConstArg { + pub value: AnonConst, + pub span: Span, +} + #[derive(Clone, RustcEncodable, RustcDecodable, Debug)] pub enum GenericArg { Lifetime(Lifetime), Type(Ty), + Const(ConstArg), } impl GenericArg { @@ -400,6 +407,7 @@ impl GenericArg { match self { GenericArg::Lifetime(l) => l.span, GenericArg::Type(t) => t.span, + GenericArg::Const(c) => c.span, } } @@ -407,6 +415,7 @@ impl GenericArg { match self { GenericArg::Lifetime(l) => l.id, GenericArg::Type(t) => t.id, + GenericArg::Const(c) => c.value.id, } } } @@ -448,6 +457,7 @@ impl GenericArgs { } break; } + GenericArg::Const(_) => {} } } } @@ -464,6 +474,7 @@ impl GenericArgs { match arg { GenericArg::Lifetime(_) => own_counts.lifetimes += 1, GenericArg::Type(_) => own_counts.types += 1, + GenericArg::Const(_) => own_counts.consts += 1, }; } @@ -528,6 +539,9 @@ pub enum GenericParamKind { Type { default: Option
>,
synthetic: Option