about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/const_eval
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-10-13 08:58:33 +0000
committerMichael Goulet <michael@errs.io>2023-10-13 08:59:36 +0000
commitb2d2184edea578109a48ec3d8decbee5948e8f35 (patch)
tree84a351b1b08b838e0adcb1062ec04c344524e6c2 /compiler/rustc_const_eval/src/const_eval
parent2763ca50da1192aa28295ef4dbe5d06443e1b90a (diff)
downloadrust-b2d2184edea578109a48ec3d8decbee5948e8f35.tar.gz
rust-b2d2184edea578109a48ec3d8decbee5948e8f35.zip
Format all the let chains in compiler
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
-rw-r--r--compiler/rustc_const_eval/src/const_eval/fn_queries.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/fn_queries.rs b/compiler/rustc_const_eval/src/const_eval/fn_queries.rs
index 4ee4ebbb9e4..9e992637f46 100644
--- a/compiler/rustc_const_eval/src/const_eval/fn_queries.rs
+++ b/compiler/rustc_const_eval/src/const_eval/fn_queries.rs
@@ -39,8 +39,13 @@ fn constness(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::Constness {
         hir::Node::Ctor(_)
         | hir::Node::AnonConst(_)
         | hir::Node::ConstBlock(_)
-        | hir::Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Const(..), .. }) => hir::Constness::Const,
-        hir::Node::Item(hir::Item { kind: hir::ItemKind::Impl(_), .. }) => tcx.generics_of(def_id).host_effect_index.map_or(hir::Constness::NotConst, |_| hir::Constness::Const),
+        | hir::Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Const(..), .. }) => {
+            hir::Constness::Const
+        }
+        hir::Node::Item(hir::Item { kind: hir::ItemKind::Impl(_), .. }) => tcx
+            .generics_of(def_id)
+            .host_effect_index
+            .map_or(hir::Constness::NotConst, |_| hir::Constness::Const),
         hir::Node::ForeignItem(hir::ForeignItem { kind: hir::ForeignItemKind::Fn(..), .. }) => {
             // Intrinsics use `rustc_const_{un,}stable` attributes to indicate constness. All other
             // foreign items cannot be evaluated at compile-time.