-
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
document that target features are unsafe #63597
Comments
Compiler triage meeting: Marking as P-medium |
@rustbot claim |
The reference section about Behavior considered undefined mentions this:
The link to the target_feature section of the reference mentions this as well:
So maybe the |
That is one way in which target_feature is unsafe, but it's not the one which was the subject of #63466 so just pointing at the reference as it is is insufficient. Plus, it's also more about |
I think that for users to better properly understand the UB involved, it might be more educational to say that The reference does not document all current perils of using Independently of whether we document that in the rustc book as well or not, that bit should also probably be documented in the reference, because it is easy to trigger this. On stable Rust, I think one can indeed only trigger this via |
When discussing #63466 in the compiler team triage meeting, it became clear that target-features ought to be considered generally unsafe. We should document this fact in the
-Chelp
and in the rustc book. Ideally, we'd also start listing out known gotchas.For example, in #63466 @nikic noted that:
and @rkruppe had a much more detailed comment.
This issue has been assigned to @togiberlin via this comment.
The text was updated successfully, but these errors were encountered: