mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-26 22:50:56 +00:00
Add is_intrinsic
helper
This commit is contained in:
parent
550b276109
commit
ea92548c56
1 changed files with 1 additions and 1 deletions
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue