-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc: Forbid #[inline(always)] with #[target_feature] #49425
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
ee6fd0d
to
bd5048e
Compare
The discussion in the RFC2045 concluded that this is the right first step. Whether |
@bors r+ |
📌 Commit bd5048e has been approved by |
Wait, Travis fails. |
Once a target feature is enabled for a function that means that it in general can't be inlined into other functions which don't have that target feature enabled. This can cause both safety and LLVM issues if we were to actually inline it, so `#[inline(always)]` both can't be respected and would be an error if we did so! Today LLVM doesn't inline functions with different `#[target_feature]` annotations, but it turns out that if one is tagged with `#[inline(always)]` it'll override this and cause scary LLVM error to arise! This commit fixes this issue by forbidding these two attributes to be used in conjunction with one another. cc rust-lang/stdarch#404
@bors: r=petrochenkov |
📌 Commit bd5048e has been approved by |
bd5048e
to
38d48ef
Compare
@bors: r=petrochenkov |
📌 Commit 38d48ef has been approved by |
…enkov rustc: Forbid #[inline(always)] with #[target_feature] Once a target feature is enabled for a function that means that it in general can't be inlined into other functions which don't have that target feature enabled. This can cause both safety and LLVM issues if we were to actually inline it, so `#[inline(always)]` both can't be respected and would be an error if we did so! Today LLVM doesn't inline functions with different `#[target_feature]` annotations, but it turns out that if one is tagged with `#[inline(always)]` it'll override this and cause scary LLVM error to arise! This commit fixes this issue by forbidding these two attributes to be used in conjunction with one another. Closes rust-lang/stdarch#404
☀️ Test successful - status-appveyor, status-travis |
Once a target feature is enabled for a function that means that it in general
can't be inlined into other functions which don't have that target feature
enabled. This can cause both safety and LLVM issues if we were to actually
inline it, so
#[inline(always)]
both can't be respected and would be an errorif we did so!
Today LLVM doesn't inline functions with different
#[target_feature]
annotations, but it turns out that if one is tagged with
#[inline(always)]
it'll override this and cause scary LLVM error to arise!
This commit fixes this issue by forbidding these two attributes to be used in
conjunction with one another.
Closes rust-lang/stdarch#404