diff options
| author | bors <bors@rust-lang.org> | 2024-03-05 00:13:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-05 00:13:01 +0000 |
| commit | 415b1f1fa7ca7f96742cea125f0a0f11b3e8a2f3 (patch) | |
| tree | 75b3f319cb5976b69fe3940ac8f93e2289e33c86 | |
| parent | b74b4b09d118aed77d41387642d4f7b7b6b4c487 (diff) | |
| parent | ea92548c5696d599c1cda0c5bf1c49ce83b0cd2b (diff) | |
| download | rust-415b1f1fa7ca7f96742cea125f0a0f11b3e8a2f3.tar.gz rust-415b1f1fa7ca7f96742cea125f0a0f11b3e8a2f3.zip | |
Auto merge of #120675 - oli-obk:intrinsics3.0, r=pnkfelix
Add a scheme for moving away from `extern "rust-intrinsic"` entirely All `rust-intrinsic`s can become free functions now, either with a fallback body, or with a dummy body and an attribute, requiring backends to actually implement the intrinsic. This PR demonstrates the dummy-body scheme with the `vtable_size` intrinsic. cc https://github.com/rust-lang/rust/issues/63585 follow-up to #120500 MCP at https://github.com/rust-lang/compiler-team/issues/720
| -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(), |
