]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_expand/build.rs
Auto merge of #69474 - Dylan-DPC:rollup-ciotplu, r=Dylan-DPC
[rust.git] / src / librustc_expand / build.rs
index 9030001542d75af1b818c3783c3de334284e0cda..bd6823cd4e275f586dbe26e39c00aadca1541c51 100644 (file)
@@ -634,7 +634,7 @@ pub fn item_static(
         mutbl: ast::Mutability,
         expr: P<ast::Expr>,
     ) -> P<ast::Item> {
-        self.item(span, name, Vec::new(), ast::ItemKind::Static(ty, mutbl, expr))
+        self.item(span, name, Vec::new(), ast::ItemKind::Static(ty, mutbl, Some(expr)))
     }
 
     pub fn item_const(
@@ -644,7 +644,8 @@ pub fn item_const(
         ty: P<ast::Ty>,
         expr: P<ast::Expr>,
     ) -> P<ast::Item> {
-        self.item(span, name, Vec::new(), ast::ItemKind::Const(ty, expr))
+        let def = ast::Defaultness::Final;
+        self.item(span, name, Vec::new(), ast::ItemKind::Const(def, ty, Some(expr)))
     }
 
     pub fn attribute(&self, mi: ast::MetaItem) -> ast::Attribute {