rust
rust copied to clipboard
Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error
r? @ghost
@bors try
:hourglass: Trying commit 191f8a971b06684f802fcc33a2398bd15df8a3ab with merge 96e388c3ccda74650413d435528d8e0ed2872a21...
:sunny: Try build successful - checks-actions
Build commit: 96e388c3ccda74650413d435528d8e0ed2872a21 (96e388c3ccda74650413d435528d8e0ed2872a21
)
@craterbot check
:ok_hand: Experiment pr-84022
created and queued.
:robot: Automatically detected try build 96e388c3ccda74650413d435528d8e0ed2872a21
:warning: Try build based on commit 2e495d2e845cf27740e3665f718acfd3aa17253e, but latest commit is 191f8a971b06684f802fcc33a2398bd15df8a3ab. Did you forget to make a new try build?
:mag: You can check out the queue and this experiment's details.
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:construction: Experiment pr-84022
is now running
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:tada: Experiment pr-84022
is completed!
:bar_chart: 90 regressed and 8 fixed (155930 total)
:newspaper: Open the full report.
:warning: If you notice any spurious failure please add them to the blacklist! :information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
Unfortunately, one of the regressions is in the unmaintained crate https://github.com/MaikKlein/enumflags
cc @petrochenkov - I'm not sure how you'd like to move forward with this. We could try to move people off https://github.com/MaikKlein/enumflags before we remove the hack, but that would still result in the crate become unusable (the last update was in 2019, and the repository has been archived).
I'm not sure how you'd like to move forward with this.
Leave it as is for a couple more years? There's no pressure to remove deprecation lints urgently. It can also be turned into an error on 2021 edition only in the meantime.
@Aaron1011 Do you want to turn this into an error on 2021 and later editions only? Or do you prefer this be closed?
@crlf0710 I think that would be reasonable. While this could theoretically break some 2018 edition code in the presence of a sufficiently weird proc-macro (e.g. a proc-macro which marks the input tokens with a 2021 edition span), I think it would be good to make progress on this issue.
triage: @Aaron1011 - what is the status of this PR? Thanks.
@bors try
:hourglass: Trying commit 36066293017525460ed9946570f9d819805c7ab5 with merge 5fe169892b3912c8118f59c03c27c622bbade2b5...
:sunny: Try build successful - checks-actions
Build commit: 5fe169892b3912c8118f59c03c27c622bbade2b5 (5fe169892b3912c8118f59c03c27c622bbade2b5
)
@craterbot check
:ok_hand: Experiment pr-84022
created and queued.
:robot: Automatically detected try build 5fe169892b3912c8118f59c03c27c622bbade2b5
:mag: You can check out the queue and this experiment's details.
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:construction: Experiment pr-84022
is now running
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:tada: Experiment pr-84022
is completed!
:bar_chart: 69 regressed and 9 fixed (244852 total)
:newspaper: Open the full report.
:warning: If you notice any spurious failure please add them to the blacklist! :information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
cc @rust-lang/compiler
This PR removes a backwards-compatibility hack that was added four years ago in https://github.com/rust-lang/rust/pull/51952. Currently, we accept code like this:
// proc-macro crate
#[proc_macro_derive(AnswerFn)]
pub fn derive_answer_fn(_item: TokenStream) -> TokenStream {
quote ! { mod generated_mod { struct Generated(TypeFromParent); }
}
// other crate
struct TypeFromParent;
#[derive(MyDeriveMacro)]
struct SomeOtherType;
Normally, this code would fail to compile, since TypeFromParent
has not been imported into generate_mod.
However, we currently detect this kind of usage in derive-macros only, and let it compile with a warning. (Note - this is about path resolution, not hygiene).
Now that https://crates.io/crates/enumflags-derive/0.4.2 has been released, all affected crates should have an upgrade path.
This has been part of cargo report-future-incompat
since feature the future-incompat report feature was stabilized (https://github.com/rust-lang/rust/pull/89523), and has been deny-by-default since https://github.com/rust-lang/rust/pull/88041. There have been zero issues opened on rust-lang/rust mentioning either of these decisions.
This PR removes all of the backwards-compatibility code (along with the lint), simplifying rustc_resolve
in the process. Any crates broken by this change are almost certainly unmaintained, and have an upgrade path if they use a dependency that's tested by Crater.
@rfcbot fcp merge
Team member @lcnr has proposed to merge this. The next step is review by the rest of the tagged team members:
- [x] @Aaron1011
- [x] @cjgillot
- [x] @davidtwco
- [x] @eddyb
- [x] @estebank
- [x] @lcnr
- [x] @matthewjasper
- [x] @michaelwoerister
- [ ] @nagisa
- [ ] @nikomatsakis
- [x] @oli-obk
- [x] @petrochenkov
- [x] @pnkfelix
- [x] @wesleywiser
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
cc @nagisa @estebank @nikomatsakis @pnkfelix for review and checkboxes
:bell: This is now entering its final comment period, as per the review above. :bell:
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.
This will be merged soon.
r? @petrochenkov
@bors r+
:pushpin: Commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36 has been approved by petrochenkov
It is now in the queue for this repository.
this probably should have been marked as rollup=never