]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_ast_lowering/src/lib.rs
Store a LocalDefId in hir::AnonConst.
[rust.git] / compiler / rustc_ast_lowering / src / lib.rs
index 66003cada4afcd09df79f97a937669411bae4033..0182147683aa37f3ba2d93fa66a7b133e0b58ea7 100644 (file)
@@ -1160,7 +1160,7 @@ fn lower_generic_arg(
                                 let node_id = self.next_node_id();
 
                                 // Add a definition for the in-band const def.
-                                self.create_def(
+                                let def_id = self.create_def(
                                     parent_def_id.def_id,
                                     node_id,
                                     DefPathData::AnonConst,
@@ -1176,6 +1176,7 @@ fn lower_generic_arg(
                                 };
 
                                 let ct = self.with_new_scopes(|this| hir::AnonConst {
+                                    def_id,
                                     hir_id: this.lower_node_id(node_id),
                                     body: this.lower_const_body(path_expr.span, Some(&path_expr)),
                                 });
@@ -2346,6 +2347,7 @@ fn lower_array_length(&mut self, c: &AnonConst) -> hir::ArrayLen {
 
     fn lower_anon_const(&mut self, c: &AnonConst) -> hir::AnonConst {
         self.with_new_scopes(|this| hir::AnonConst {
+            def_id: this.local_def_id(c.id),
             hir_id: this.lower_node_id(c.id),
             body: this.lower_const_body(c.value.span, Some(&c.value)),
         })