Skip to content

Commit 415b1f1

Browse files
committed
Auto merge of rust-lang#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 rust-lang#63585 follow-up to rust-lang#120500 MCP at rust-lang/compiler-team#720
2 parents b74b4b0 + ea92548 commit 415b1f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_utils/src/qualify_min_const_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ fn check_terminator<'tcx>(
334334
// within const fns. `transmute` is allowed in all other const contexts.
335335
// This won't really scale to more intrinsics or functions. Let's allow const
336336
// transmutes in const fn before we add more hacks to this.
337-
if matches!(tcx.intrinsic(fn_def_id), Some(sym::transmute)) {
337+
if tcx.is_intrinsic(fn_def_id, sym::transmute) {
338338
return Err((
339339
span,
340340
"can only call `transmute` from const items, not `const fn`".into(),

0 commit comments

Comments
 (0)