mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 10:05:06 +03:00
8162cf582b
Remove unsound `target_feature_inline_always` feature ## Summary - Remove `target_feature_inline_always` - Update stdarch generators to only use `#[inline]` & regenerate stdarch. ## Why? Succinctly; the feature relies on LLVMs `AlwaysInlinerPass()` running before LLVMs heuristic based inliner pass. Which is not a basis for sound code. This has been discussed in [the tracking issue](https://github.com/rust-lang/rust/issues/145574). If the ordering of the passes were to change, of which they have in the past, it is very possible we could inline functions across callsites with mismatching target features leading to unsound code. Checks proposed in; https://github.com/rust-lang/rust/pull/155426 would only take into account caller -> callee which is not enough to guard against possibly of generating unsound code if the pass ordering were to change. There doesn't seem to be a way, presently, this this mechanism to provide soundness guarantees nor does it seem like `AlwaysInlinerPass()` is a desired feature of LLVM, which this feature relies on. r? @RalfJung
Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.