Skip to content

Commit 5dfaa0f

Browse files
authored
Unrolled build for rust-lang#117319
Rollup merge of rust-lang#117319 - RalfJung:target-feature-inline-comment, r=tmiasko explain why we don't inline when target features differ Follow-up to rust-lang#117141 r? ``@tmiasko``
2 parents 2cad938 + f7985af commit 5dfaa0f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_mir_transform/src/inline.rs

+5
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ impl<'tcx> Inliner<'tcx> {
439439
}
440440

441441
if callee_attrs.target_features != self.codegen_fn_attrs.target_features {
442+
// In general it is not correct to inline a callee with target features that are a
443+
// subset of the caller. This is because the callee might contain calls, and the ABI of
444+
// those calls depends on the target features of the surrounding function. By moving a
445+
// `Call` terminator from one MIR body to another with more target features, we might
446+
// change the ABI of that call!
442447
return Err("incompatible target features");
443448
}
444449

0 commit comments

Comments
 (0)