Lower attributes for functions without bodies - #162761
Conversation
|
|
This comment has been minimized.
This comment has been minimized.
29274ef to
5bf5ae2
Compare
|
|
||
| warning: the `must_use` attribute cannot be used on function params | ||
| --> $DIR/param-attrs-builtin-attrs.rs:40:7 | ||
| --> $DIR/param-attrs-builtin-attrs.rs:29:7 |
There was a problem hiding this comment.
the check for these warnings should go, since it causes double emissions
There was a problem hiding this comment.
Let's fix this in a follow-up PR, it will be quite a big diff to remove this error and replace it by target checking consistently
|
@rust-lang/lang Is this a PR that you would want to take a look at? fn help(x: fn(#[rustc_splat] usize)) {} |
|
@rustbot ready |
5bf5ae2 to
e6552cd
Compare
|
r=me then after some acknowledgement from t-lang. I think it falls under the same rule as earlier breaking changes in attrs (i.e. notify t-lang but do the change) but let them acknowledge that. Notably, this attribute is rather new, it's unlikely anyone depends on this. |
|
Just in case |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Lower attributes for functions without bodies
| //~| ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes | ||
| } | ||
|
|
||
| trait Test { |
There was a problem hiding this comment.
I don't know if it's worth duplicating the trait, type, and extern tests in the splat feature gate test, up to you.
There was a problem hiding this comment.
I think it's not worth duplicating the test
This comment has been minimized.
This comment has been minimized.
|
Agreed that this was clearly never supposed to be stable. @rfcbot reviewed |
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
cad361c to
9c9d810
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
@bors r=jdonszelmann |
|
📋 This PR cannot be approved because it currently has the following labels: |
|
@bors r=jdonszelmann |
… r=jdonszelmann Lower attributes for functions without bodies Fixes rust-lang#162639 This is a temporary solution to get the bug fixed. I'm going to see if we can move the function `hir::Param`s from `hir::Body` to `hir::FnSig`, this would cleanly fix this bug and would undo most of this PR. That is a large project which might take me some time to complete, so I'd prefer to get the bug fixed first with this workaround. Maybe r? @jdonszelmann since you have context? cc @mejrs cause you're probably interested
Rollup of 18 pull requests Successful merges: - #158102 (When compiling without a specified `--edition`, emit a message) - #162027 (std: add `fs::rename_noreplace`) - #162761 (Lower attributes for functions without bodies) - #163161 (implement FCW for `rustc_allowed_through_unstable_modules` items) - #163613 (Tweak the rendering of "not general enough" errors on the old trait solver) - #162062 (core: fix the docs of PanicInfo::location) - #163140 (document safety requirements for atomic intrinsics) - #163342 (Don't imply incorrect things about `Global` in the docs of `System`) - #163445 (Add safety comments for alloc::str) - #163503 (Mark Rc strong/weak count methods must_use) - #163548 (fs::set_permissions_nofollow: Android support, test cleanup) - #163585 ([triagebot] Create `debugger_visualizer` assign group) - #163597 (Add `SplitPathsRef` implementation for motor to make std build) - #163602 (Move media & home dirs tests to fs tests.) - #163667 (Finalize changes on expect messages for library/core/src/fmt/mod.rs) - #163682 ([rustdoc] Correctly link to (imported) enum variants with "jump to def") - #163683 (Fix GCC codegen backend comment in bootstrap) - #163703 (Move more `rustdoc-html tests` in the right location) Failed merges: - #161491 (Rip out old solver coherence)
Rollup of 18 pull requests Successful merges: - #158102 (When compiling without a specified `--edition`, emit a message) - #162761 (Lower attributes for functions without bodies) - #163161 (implement FCW for `rustc_allowed_through_unstable_modules` items) - #163613 (Tweak the rendering of "not general enough" errors on the old trait solver) - #162062 (core: fix the docs of PanicInfo::location) - #163140 (document safety requirements for atomic intrinsics) - #163342 (Don't imply incorrect things about `Global` in the docs of `System`) - #163445 (Add safety comments for alloc::str) - #163503 (Mark Rc strong/weak count methods must_use) - #163548 (fs::set_permissions_nofollow: Android support, test cleanup) - #163585 ([triagebot] Create `debugger_visualizer` assign group) - #163597 (Add `SplitPathsRef` implementation for motor to make std build) - #163602 (Move media & home dirs tests to fs tests.) - #163667 (Finalize changes on expect messages for library/core/src/fmt/mod.rs) - #163682 ([rustdoc] Correctly link to (imported) enum variants with "jump to def") - #163683 (Fix GCC codegen backend comment in bootstrap) - #163703 (Move more `rustdoc-html tests` in the right location) - #163725 (some crashes fixed with next-solver) Failed merges: - #161491 (Rip out old solver coherence)
Rollup merge of #162761 - JonathanBrouwer:lower-param-attrs, r=jdonszelmann Lower attributes for functions without bodies Fixes #162639 This is a temporary solution to get the bug fixed. I'm going to see if we can move the function `hir::Param`s from `hir::Body` to `hir::FnSig`, this would cleanly fix this bug and would undo most of this PR. That is a large project which might take me some time to complete, so I'd prefer to get the bug fixed first with this workaround. Maybe r? @jdonszelmann since you have context? cc @mejrs cause you're probably interested
View all comments
Fixes #162639
This is a temporary solution to get the bug fixed.
I'm going to see if we can move the function
hir::Params fromhir::Bodytohir::FnSig, this would cleanly fix this bug and would undo most of this PR. That is a large project which might take me some time to complete, so I'd prefer to get the bug fixed first with this workaround.Maybe r? @jdonszelmann since you have context?
cc @mejrs cause you're probably interested