We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
is_intrinsic
1 parent 036d00b commit d55fdb2Copy full SHA for d55fdb2
clippy_utils/src/qualify_min_const_fn.rs
@@ -335,7 +335,7 @@ fn check_terminator<'tcx>(
335
// within const fns. `transmute` is allowed in all other const contexts.
336
// This won't really scale to more intrinsics or functions. Let's allow const
337
// 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 {
+ if matches!(tcx.intrinsic(fn_def_id), Some(sym::transmute)) {
339
return Err((
340
span,
341
"can only call `transmute` from const items, not `const fn`".into(),
0 commit comments