mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-23 21:23:20 +00:00
Rustfmt all the things
This commit is contained in:
parent
38cdf63acf
commit
d6c806378e
@ -65,12 +65,23 @@ pub fn differing_macro_contexts(lhs: Span, rhs: Span) -> bool {
|
|||||||
pub fn in_constant(cx: &LateContext<'_, '_>, id: NodeId) -> bool {
|
pub fn in_constant(cx: &LateContext<'_, '_>, id: NodeId) -> bool {
|
||||||
let parent_id = cx.tcx.hir().get_parent(id);
|
let parent_id = cx.tcx.hir().get_parent(id);
|
||||||
match cx.tcx.hir().get(parent_id) {
|
match cx.tcx.hir().get(parent_id) {
|
||||||
| Node::Item(&Item { node: ItemKind::Const(..), .. })
|
Node::Item(&Item {
|
||||||
| Node::TraitItem(&TraitItem { node: TraitItemKind::Const(..), .. })
|
node: ItemKind::Const(..),
|
||||||
| Node::ImplItem(&ImplItem { node: ImplItemKind::Const(..), .. })
|
..
|
||||||
|
})
|
||||||
|
| Node::TraitItem(&TraitItem {
|
||||||
|
node: TraitItemKind::Const(..),
|
||||||
|
..
|
||||||
|
})
|
||||||
|
| Node::ImplItem(&ImplItem {
|
||||||
|
node: ImplItemKind::Const(..),
|
||||||
|
..
|
||||||
|
})
|
||||||
| Node::AnonConst(_)
|
| Node::AnonConst(_)
|
||||||
| Node::Item(&Item { node: ItemKind::Static(..), .. })
|
| Node::Item(&Item {
|
||||||
=> true,
|
node: ItemKind::Static(..),
|
||||||
|
..
|
||||||
|
}) => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user