Skip to content

Commit d55fdb2

Browse files
committed
Make is_intrinsic query return the intrinsic name
1 parent 036d00b commit d55fdb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_utils/src/qualify_min_const_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ fn check_terminator<'tcx>(
335335
// within const fns. `transmute` is allowed in all other const contexts.
336336
// This won't really scale to more intrinsics or functions. Let's allow const
337337
// transmutes in const fn before we add more hacks to this.
338-
if tcx.is_intrinsic(fn_def_id) && tcx.item_name(fn_def_id) == sym::transmute {
338+
if matches!(tcx.intrinsic(fn_def_id), Some(sym::transmute)) {
339339
return Err((
340340
span,
341341
"can only call `transmute` from const items, not `const fn`".into(),

0 commit comments

Comments
 (0)