-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
optimize
attribute applied to things other than methods/functions/c…
#131814
Conversation
@rustbot label +T-compiler +T-lang |
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.
Thanks for the PR. I've noticed a discrepancy between what the diagnostic says and what the validation actually does. Also want to double-check with T-lang the concrete set of targets that the #[optimize]
attribute should be permitted on.
@jieyouxu:
And niko said:
And speaking for T-lang, TC said:
So my understanding of the gestalt is that this attribute should
The former need not await the latter. |
Fair enough. In that sense I would recommend rejecting the mod case and only accept function-like targets. |
Note also the comment from pnkfelix here:
This would apply to nightly |
a75d7e6
to
1e79649
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.
Thanks, just one missing test case then r=me.
@rustbot author |
1e79649
to
080103f
Compare
Thank you for your mentorship in getting this thing in. Here's to future collaboration. @rustbot review |
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.
Thanks, this LGTM now.
@bors r+ rollup |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#131814 (`optimize` attribute applied to things other than methods/functions/c…) - rust-lang#131927 (Check for filecheck directives in files marked `skip-filecheck`) - rust-lang#131967 (Remove `lower_mono_bounds`) - rust-lang#131973 (fix(rustdoc-json-types): document rustc-hash feature) - rust-lang#131976 (feat(rustdoc-json-types): mark simple enums as copy) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131814 - Borgerr:misapplied-optimize-attribute, r=jieyouxu `optimize` attribute applied to things other than methods/functions/c… …losures gives an error (rust-lang#128488) Duplicate of rust-lang#128943, which I had accidentally closed when rebasing. cc. `@jieyouxu` `@compiler-errors` `@nikomatsakis` `@traviscross` `@pnkfelix.`
…losures gives an error (#128488)
Duplicate of #128943, which I had accidentally closed when rebasing.
cc. @jieyouxu @compiler-errors @nikomatsakis @traviscross @pnkfelix.