-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
#[target_feature] is allowed on #[panic_handler] with target_feature 1.1 #109411
Comments
cc @LeSeulArtichaut , author of #108651 Note that this is about the no_std panic handler, not about the #![feature(target_feature_11)]
use core::panic::PanicInfo;
#[target_feature(enable = "avx2")]
fn panic(_info: &PanicInfo) {
loop {}
}
fn main() {
std::panic::set_hook(Box::new(panic));
} gives
|
ugh we really need a way to make sure that every single "this is called by rust" function gets a check... |
Yeah sadly we do need to make sure, not just for the constructs that we have now but also it needs to be kept in mind for the future constructs we add or stabilize. A lot thankfully goes through either the trait system (operators or the GlobalAlloc trait used by The best list of lang items I could find was in the unstable book, so that would be a great start for such an exhaustive search. Thankfully most of them are unstable, but still it needs to be addressed for each of them before stabilization (if that is a target). |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
@rustbot label +requires-nightly |
There is also another table of lang items in the source code, here. |
Prevent using `#[target_feature]` on lang item functions Fixes rust-lang/rust#109411 and also prevents from using `#[target_feature]` on other `fn` lang items to mitigate the concerns from rust-lang/rust#109411 (comment).
Prevent using `#[target_feature]` on lang item functions Fixes rust-lang/rust#109411 and also prevents from using `#[target_feature]` on other `fn` lang items to mitigate the concerns from rust-lang/rust#109411 (comment).
Prevent using `#[target_feature]` on lang item functions Fixes rust-lang/rust#109411 and also prevents from using `#[target_feature]` on other `fn` lang items to mitigate the concerns from rust-lang/rust#109411 (comment).
This works (but it shouldn't):
similar to #108645 , cc #69098 (tracking issue)
@rustbot label T-lang T-compiler C-bug I-unsound F-target_feature_11
The text was updated successfully, but these errors were encountered: