Skip to content

Commit

Permalink
Make is_intrinsic query return the intrinsic name
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Feb 12, 2024
1 parent 036d00b commit d55fdb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_utils/src/qualify_min_const_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,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 tcx.is_intrinsic(fn_def_id) && tcx.item_name(fn_def_id) == sym::transmute {
if matches!(tcx.intrinsic(fn_def_id), Some(sym::transmute)) {
return Err((
span,
"can only call `transmute` from const items, not `const fn`".into(),
Expand Down

0 comments on commit d55fdb2

Please sign in to comment.