Account for new ast::GenericParamKind::Const::default in rust_ast.
This commit is contained in:
parent
a6b0c18dc9
commit
5bb17a0d36
2 changed files with 14 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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(": ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue