From ea92548c5696d599c1cda0c5bf1c49ce83b0cd2b Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 19 Feb 2024 22:51:45 +0000 Subject: [PATCH] Add `is_intrinsic` helper --- clippy_utils/src/qualify_min_const_fn.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_utils/src/qualify_min_const_fn.rs b/clippy_utils/src/qualify_min_const_fn.rs index 183dbe3aecc16..e369cb9d0a40e 100644 --- a/clippy_utils/src/qualify_min_const_fn.rs +++ b/clippy_utils/src/qualify_min_const_fn.rs @@ -334,7 +334,7 @@ fn check_terminator<'tcx>( // within const fns. `transmute` is allowed in all other const contexts. // This won't really scale to more intrinsics or functions. Let's allow const // transmutes in const fn before we add more hacks to this. - if matches!(tcx.intrinsic(fn_def_id), Some(sym::transmute)) { + if tcx.is_intrinsic(fn_def_id, sym::transmute) { return Err(( span, "can only call `transmute` from const items, not `const fn`".into(),