about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/spanned.rs9
-rw-r--r--src/types.rs7
2 files changed, 14 insertions, 2 deletions
diff --git a/src/spanned.rs b/src/spanned.rs
index 7bf370c131e..9e3658dd22f 100644
--- a/src/spanned.rs
+++ b/src/spanned.rs
@@ -113,7 +113,14 @@ impl Spanned for ast::Param {
 
 impl Spanned for ast::GenericParam {
     fn span(&self) -> Span {
-        let lo = if self.attrs.is_empty() {
+        let lo = if let ast::GenericParamKind::Const {
+            ty: _,
+            kw_span,
+            default: _,
+        } = self.kind
+        {
+            kw_span.lo()
+        } else if self.attrs.is_empty() {
             self.ident.span.lo()
         } else {
             self.attrs[0].span.lo()
diff --git a/src/types.rs b/src/types.rs
index 6e1fc8fc387..bedc29fbc1a 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -563,7 +563,12 @@ impl Rewrite for ast::GenericParam {
             _ => (),
         }
 
-        if let rustc_ast::ast::GenericParamKind::Const { ref ty, .. } = &self.kind {
+        if let ast::GenericParamKind::Const {
+            ref ty,
+            kw_span: _,
+            default: _,
+        } = &self.kind
+        {
             result.push_str("const ");
             result.push_str(rewrite_ident(context, self.ident));
             result.push_str(": ");