Skip to content

Commit 3991ba7

Browse files
varkoryodaldevoid
andcommitted
Support const generics in save analysis
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
1 parent 06abaee commit 3991ba7

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/librustc_save_analysis/dump_visitor.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
364364
);
365365
}
366366
}
367+
ast::GenericParamKind::Const { .. } => {}
367368
}
368369
}
369370
self.visit_generics(generics);
@@ -1447,9 +1448,16 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
14471448

14481449
fn visit_generics(&mut self, generics: &'l ast::Generics) {
14491450
for param in &generics.params {
1450-
if let ast::GenericParamKind::Type { ref default, .. } = param.kind {
1451-
self.process_bounds(&param.bounds);
1452-
if let Some(ref ty) = default {
1451+
match param.kind {
1452+
ast::GenericParamKind::Lifetime { .. } => {}
1453+
ast::GenericParamKind::Type { ref default, .. } => {
1454+
self.process_bounds(&param.bounds);
1455+
if let Some(ref ty) = default {
1456+
self.visit_ty(&ty);
1457+
}
1458+
}
1459+
ast::GenericParamKind::Const { ref ty } => {
1460+
self.process_bounds(&param.bounds);
14531461
self.visit_ty(&ty);
14541462
}
14551463
}

0 commit comments

Comments
 (0)