]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/utils/mod.rs
Auto merge of #3700 - phansch:would_you_like_some_help_with_this_const_fn, r=oli-obk
[rust.git] / clippy_lints / src / utils / mod.rs
index af9b1599649dc21d49d906c3efb4fc3d48b86b9a..2b2b3e8b2f6a58b807aff8b7aaccb493f7925d3a 100644 (file)
@@ -82,6 +82,10 @@ pub fn in_constant(cx: &LateContext<'_, '_>, id: NodeId) -> bool {
             node: ItemKind::Static(..),
             ..
         }) => true,
+        Node::Item(&Item {
+            node: ItemKind::Fn(_, header, ..),
+            ..
+        }) => header.constness == Constness::Const,
         _ => false,
     }
 }