about summary refs log tree commit diff
path: root/compiler/rustc_resolve
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-02-04 20:56:32 -0800
committerMichael Goulet <michael@errs.io>2022-02-05 01:30:14 -0800
commitbcf98841d47b23dfc4cc85568fcd8dbb79748965 (patch)
treeb34122b9d04123892daf884b733c904067463b9a /compiler/rustc_resolve
parentb3800860e123443ffada615538926beed6bc4f85 (diff)
downloadrust-bcf98841d47b23dfc4cc85568fcd8dbb79748965.tar.gz
rust-bcf98841d47b23dfc4cc85568fcd8dbb79748965.zip
resolve lifetimes for const generic defaults
Diffstat (limited to 'compiler/rustc_resolve')
-rw-r--r--compiler/rustc_resolve/src/late/lifetimes.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs
index 6ef85c426be..f3d57139e08 100644
--- a/compiler/rustc_resolve/src/late/lifetimes.rs
+++ b/compiler/rustc_resolve/src/late/lifetimes.rs
@@ -1339,11 +1339,14 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                             this.visit_ty(&ty);
                         }
                     }
-                    GenericParamKind::Const { ref ty, .. } => {
+                    GenericParamKind::Const { ref ty, default } => {
                         let was_in_const_generic = this.is_in_const_generic;
                         this.is_in_const_generic = true;
                         walk_list!(this, visit_param_bound, param.bounds);
                         this.visit_ty(&ty);
+                        if let Some(default) = default {
+                            this.visit_body(this.tcx.hir().body(default.body));
+                        }
                         this.is_in_const_generic = was_in_const_generic;
                     }
                 }