Skip to content

Commit 5bb17a0

Browse files
m-ou-secalebcartwright
authored andcommitted
Account for new ast::GenericParamKind::Const::default in rust_ast.
1 parent a6b0c18 commit 5bb17a0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/spanned.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,14 @@ impl Spanned for ast::Param {
113113

114114
impl Spanned for ast::GenericParam {
115115
fn span(&self) -> Span {
116-
let lo = if self.attrs.is_empty() {
116+
let lo = if let ast::GenericParamKind::Const {
117+
ty: _,
118+
kw_span,
119+
default: _,
120+
} = self.kind
121+
{
122+
kw_span.lo()
123+
} else if self.attrs.is_empty() {
117124
self.ident.span.lo()
118125
} else {
119126
self.attrs[0].span.lo()

src/types.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,12 @@ impl Rewrite for ast::GenericParam {
563563
_ => (),
564564
}
565565

566-
if let rustc_ast::ast::GenericParamKind::Const { ref ty, .. } = &self.kind {
566+
if let ast::GenericParamKind::Const {
567+
ref ty,
568+
kw_span: _,
569+
default: _,
570+
} = &self.kind
571+
{
567572
result.push_str("const ");
568573
result.push_str(rewrite_ident(context, self.ident));
569574
result.push_str(": ");

0 commit comments

Comments
 (0)