diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-02-19 22:51:45 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-03-04 16:13:50 +0000 |
| commit | ea92548c5696d599c1cda0c5bf1c49ce83b0cd2b (patch) | |
| tree | 4d5325fdbdf70ac0dd21516af2af02e91ae1010f | |
| parent | 550b2761097219da90c6e165549afc590c294f3f (diff) | |
| download | rust-ea92548c5696d599c1cda0c5bf1c49ce83b0cd2b.tar.gz rust-ea92548c5696d599c1cda0c5bf1c49ce83b0cd2b.zip | |
Add `is_intrinsic` helper
| -rw-r--r-- | clippy_utils/src/qualify_min_const_fn.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_utils/src/qualify_min_const_fn.rs b/clippy_utils/src/qualify_min_const_fn.rs index 183dbe3aecc..e369cb9d0a4 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(), |
