-
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
Add #[rustc_safe_intrinsic]
#100719
Add #[rustc_safe_intrinsic]
#100719
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
Hm, Does this need a compiler MCP? |
r? @wesleywiser since you said you would review the patches :) |
☔ The latest upstream changes (presumably #96946) made this pull request unmergeable. Please resolve the merge conflicts. |
3f0b2b8
to
a255c4b
Compare
This comment has been minimized.
This comment has been minimized.
a255c4b
to
4a8bdfd
Compare
Following the discussion around the MCP, I've added the logic for checking the presence of the attribute on top of the existing "safe intrinsic list". This allows consumers of the |
4a8bdfd
to
422fad6
Compare
This comment has been minimized.
This comment has been minimized.
422fad6
to
79545e3
Compare
The first commit is a spurious duplicate of a commit that has already landed on master. |
☔ The latest upstream changes (presumably #101483) made this pull request unmergeable. Please resolve the merge conflicts. |
d880fd4
to
bb2d43d
Compare
This was fixed in 9192089 and bb2d43d by the way |
bb2d43d
to
062b103
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind also adding a UI test for the compiler error? It would be good to test both #[rustc_safe_intrinsic]
on an intrinsic that isn't safe and not having the attribute on an intrinsic that is safe. Since we call err
and not fatal
, I think you should be able to put both cases in the test.
Other than that, this looks good to me! 🙂
☔ The latest upstream changes (presumably #102051) made this pull request unmergeable. Please resolve the merge conflicts. |
062b103
to
8a38ca1
Compare
I've fixed the formatting, added the test and fixed the merge conflicts. The error does not have any location info at the moment, so I don't mind spending a little more time on that if you think it'd be worth it @wesleywiser |
☔ The latest upstream changes (presumably #102306) made this pull request unmergeable. Please resolve the merge conflicts. |
8a38ca1
to
cedc019
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be easy enough to get a nice span associated with the error (I believe the suggestion I left is sufficient for that to happen) so let's go ahead and do that. The rest of this looks good to me!
cedc019
to
b1b8649
Compare
Thanks @CohenArthur! @bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ce7f0f1): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Footnotes |
…ibute, r=wesleywiser Add `#[rustc_safe_intrinsic]` This PR adds the `#[rustc_safe_intrinsic]` attribute as mentionned on Zulip. The goal of this attribute is to avoid keeping a list of symbols as the source for stable intrinsics, and instead rely on an attribute. This is similar to `#[rustc_const_stable]` and `#[rustc_const_unstable]`, which among other things, are used to mark the constness of intrinsic functions.
This PR adds the
#[rustc_safe_intrinsic]
attribute as mentionned on Zulip. The goal of this attribute is to avoid keeping a list of symbols as the source for stable intrinsics, and instead rely on an attribute. This is similar to#[rustc_const_stable]
and#[rustc_const_unstable]
, which among other things, are used to mark the constness of intrinsic functions.