Skip to content

Commit 0e9ea62

Browse files
committed
XXX: various fixes for CI failures
1 parent c0a3752 commit 0e9ea62

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

compiler/rustc_ast/src/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! - [`Stmt`] and [`StmtKind`]: An executable action that does not return a value.
1313
//! - [`FnDecl`], [`FnHeader`] and [`Param`]: Metadata associated with a function declaration.
1414
//! - [`Generics`], [`GenericParam`], [`WhereClause`]: Metadata associated with generic parameters.
15-
//! - [`EnumDef`] and [`Variant`]: Enum declaration.
15+
//! - [`Enum`] and [`Variant`]: Enum declaration.
1616
//! - [`Lit`] and [`LitKind`]: Literal expressions.
1717
//! - [`MacroDef`], [`MacStmtStyle`], [`MacCall`], [`MacDelimiter`]: Macro definition and invocation.
1818
//! - [`Attribute`]: Metadata associated with item.

src/tools/rustfmt/src/items.rs

+27-27
Original file line numberDiff line numberDiff line change
@@ -1803,9 +1803,13 @@ impl<'a> StaticParts<'a> {
18031803
ast::ItemKind::Static(ref static_) => {
18041804
(None, "static", &static_.ty, static_.mutbl, &static_.expr)
18051805
}
1806-
ast::ItemKind::Const(ref const_) => {
1807-
(Some(const_.defaultness), "const", &const_.ty, ast::Mutability::Not, &const_.expr)
1808-
}
1806+
ast::ItemKind::Const(ref const_) => (
1807+
Some(const_.defaultness),
1808+
"const",
1809+
&const_.ty,
1810+
ast::Mutability::Not,
1811+
&const_.expr,
1812+
),
18091813
_ => unreachable!(),
18101814
};
18111815
StaticParts {
@@ -1822,36 +1826,32 @@ impl<'a> StaticParts<'a> {
18221826

18231827
pub(crate) fn from_trait_item(ti: &'a ast::AssocItem) -> Self {
18241828
match &ti.kind {
1825-
ast::AssocItemKind::Const(const_) => {
1826-
StaticParts {
1827-
prefix: "const",
1828-
vis: &ti.vis,
1829-
ident: ti.ident,
1830-
ty: &const_.ty,
1831-
mutability: ast::Mutability::Not,
1832-
expr_opt: const_.expr.as_ref(),
1833-
defaultness: Some(const_.defaultness),
1834-
span: ti.span,
1835-
}
1836-
}
1829+
ast::AssocItemKind::Const(const_) => StaticParts {
1830+
prefix: "const",
1831+
vis: &ti.vis,
1832+
ident: ti.ident,
1833+
ty: &const_.ty,
1834+
mutability: ast::Mutability::Not,
1835+
expr_opt: const_.expr.as_ref(),
1836+
defaultness: Some(const_.defaultness),
1837+
span: ti.span,
1838+
},
18371839
_ => unreachable!(),
18381840
}
18391841
}
18401842

18411843
pub(crate) fn from_impl_item(ii: &'a ast::AssocItem) -> Self {
18421844
match &ii.kind {
1843-
ast::AssocItemKind::Const(const_) => {
1844-
StaticParts {
1845-
prefix: "const",
1846-
vis: &ii.vis,
1847-
ident: ii.ident,
1848-
ty: &const_.ty,
1849-
mutability: ast::Mutability::Not,
1850-
expr_opt: const_.expr.as_ref(),
1851-
defaultness: Some(const_.defaultness),
1852-
span: ii.span,
1853-
}
1854-
}
1845+
ast::AssocItemKind::Const(const_) => StaticParts {
1846+
prefix: "const",
1847+
vis: &ii.vis,
1848+
ident: ii.ident,
1849+
ty: &const_.ty,
1850+
mutability: ast::Mutability::Not,
1851+
expr_opt: const_.expr.as_ref(),
1852+
defaultness: Some(const_.defaultness),
1853+
span: ii.span,
1854+
},
18551855
_ => unreachable!(),
18561856
}
18571857
}

0 commit comments

Comments
 (0)