Skip to content

Commit 3ecb9ed

Browse files
committed
Split out ast::ItemKind::Const into its own struct
1 parent ced3cd8 commit 3ecb9ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/items.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,7 @@ impl<'a> StaticParts<'a> {
18081808
ast::ItemKind::Static(ast::Static { ref ty, mutability, ref expr}) => {
18091809
(None, "static", ty, mutability, expr)
18101810
}
1811-
ast::ItemKind::Const(defaultness, ref ty, ref expr) => {
1811+
ast::ItemKind::Const(ast::ConstItem { defaultness, ref ty, ref expr}) => {
18121812
(Some(defaultness), "const", ty, ast::Mutability::Not, expr)
18131813
}
18141814
_ => unreachable!(),
@@ -1827,8 +1827,8 @@ impl<'a> StaticParts<'a> {
18271827

18281828
pub(crate) fn from_trait_item(ti: &'a ast::AssocItem) -> Self {
18291829
let (defaultness, ty, expr_opt) = match ti.kind {
1830-
ast::AssocItemKind::Const(defaultness, ref ty, ref expr_opt) => {
1831-
(defaultness, ty, expr_opt)
1830+
ast::AssocItemKind::Const(ast::ConstItem {defaultness, ref ty, ref expr}) => {
1831+
(defaultness, ty, expr)
18321832
}
18331833
_ => unreachable!(),
18341834
};
@@ -1846,7 +1846,7 @@ impl<'a> StaticParts<'a> {
18461846

18471847
pub(crate) fn from_impl_item(ii: &'a ast::AssocItem) -> Self {
18481848
let (defaultness, ty, expr) = match ii.kind {
1849-
ast::AssocItemKind::Const(defaultness, ref ty, ref expr) => (defaultness, ty, expr),
1849+
ast::AssocItemKind::Const(ast::ConstItem { defaultness, ref ty, ref expr}) => (defaultness, ty, expr),
18501850
_ => unreachable!(),
18511851
};
18521852
StaticParts {

0 commit comments

Comments
 (0)