about summary refs log tree commit diff
path: root/compiler/rustc_lint
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-05 00:13:01 +0000
committerbors <bors@rust-lang.org>2024-03-05 00:13:01 +0000
commit2eeff462b762ed00f9d557d8c6ad7a3d562f692a (patch)
treed5e2442dec8294e89a12d0680109e0ef3fd8d7cf /compiler/rustc_lint
parent50e77f133f8eb1f745e05681163a0143d6c4dd7d (diff)
parentc04f0caaff5b09a2202bb220579ef45722e74ed2 (diff)
downloadrust-2eeff462b762ed00f9d557d8c6ad7a3d562f692a.tar.gz
rust-2eeff462b762ed00f9d557d8c6ad7a3d562f692a.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
Diffstat (limited to 'compiler/rustc_lint')
-rw-r--r--compiler/rustc_lint/src/builtin.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index 8d61d297839..65a0ce96a64 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -1231,7 +1231,7 @@ impl<'tcx> LateLintPass<'tcx> for MutableTransmutes {
         }
 
         fn def_id_is_transmute(cx: &LateContext<'_>, def_id: DefId) -> bool {
-            matches!(cx.tcx.intrinsic(def_id), Some(sym::transmute))
+            cx.tcx.is_intrinsic(def_id, sym::transmute)
         }
     }
 }