Stabilize #![feature(target_feature_11)] - #99767
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stabilization report
Summary
Allows for safe functions to be marked with
#[target_feature]attributes.Functions marked with
#[target_feature]are generally considered as unsafe functions: they are unsafe to call, cannot be assigned to safe function pointers, and don't implement theFn*traits.However, calling them from other
#[target_feature]functions with a superset of features is safe.Test cases
Tests for this feature can be found in
src/test/ui/rfcs/rfc-2396-target_feature-11/.Edge cases
Closures defined inside functions marked with
#[target_feature]inherit the target features of their parent function. They can still be assigned to safe function pointers and implement the appropriateFn*traits.This means that in order to call a function with
#[target_feature], you must show that the target-feature is available while the function executes and for as long as whatever may escape from that function lives.Documentation
target_feature_11feature reference#1181cc tracking issue #69098
r? @ghost