1
Fork 0

Split out ast::ItemKind::Const into its own struct

This commit is contained in:
Oli Scherer 2023-03-29 09:20:45 +00:00
parent e3828777a6
commit ec74653652
14 changed files with 89 additions and 61 deletions

View file

@ -638,8 +638,13 @@ impl<'a> ExtCtxt<'a> {
ty: P<ast::Ty>,
expr: P<ast::Expr>,
) -> P<ast::Item> {
let def = ast::Defaultness::Final;
self.item(span, name, AttrVec::new(), ast::ItemKind::Const(def, ty, Some(expr)))
let defaultness = ast::Defaultness::Final;
self.item(
span,
name,
AttrVec::new(),
ast::ItemKind::Const(ast::ConstItem { defaultness, ty, expr: Some(expr) }),
)
}
// Builds `#[name]`.