-
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
Introduce proc_macro_back_compat
lint, and emit for time-macros-impl
#83127
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
The lint documentation needs to be adjusted as described in the doc comment to |
Now that future-incompat-report support has landed in nightly Cargo, we can start to make progress towards removing the various proc-macro back-compat hacks that have accumulated in the compiler. This PR introduces a new lint `proc_macro_back_compat`, which results in a future-incompat-report entry being generated. All proc-macro back-compat warnings will be grouped under this lint. Note that this lint will never actually become a hard error - instead, we will remove the special cases for various macros, which will cause older versions of those crates to emit some other error. I've added code to fire this lint for the `time-macros-impl` case. This is the easiest case out of all of our current back-compat hacks - the crate was renamed to `time-macros`, so seeing a filename with `time-macros-impl` guarantees that an older version of the parent `time` crate is in use. When Cargo's future-incompat-report feature gets stabilized, affected users will start to see future-incompat warnings when they build their crates.
508d0a1
to
f190bc4
Compare
@bors r=petrochenkov |
📌 Commit f190bc4 has been approved by |
…petrochenkov Introduce `proc_macro_back_compat` lint, and emit for `time-macros-impl` Now that future-incompat-report support has landed in nightly Cargo, we can start to make progress towards removing the various proc-macro back-compat hacks that have accumulated in the compiler. This PR introduces a new lint `proc_macro_back_compat`, which results in a future-incompat-report entry being generated. All proc-macro back-compat warnings will be grouped under this lint. Note that this lint will never actually become a hard error - instead, we will remove the special cases for various macros, which will cause older versions of those crates to emit some other error. I've added code to fire this lint for the `time-macros-impl` case. This is the easiest case out of all of our current back-compat hacks - the crate was renamed to `time-macros`, so seeing a filename with `time-macros-impl` guarantees that an older version of the parent `time` crate is in use. When Cargo's future-incompat-report feature gets stabilized, affected users will start to see future-incompat warnings when they build their crates.
…petrochenkov Introduce `proc_macro_back_compat` lint, and emit for `time-macros-impl` Now that future-incompat-report support has landed in nightly Cargo, we can start to make progress towards removing the various proc-macro back-compat hacks that have accumulated in the compiler. This PR introduces a new lint `proc_macro_back_compat`, which results in a future-incompat-report entry being generated. All proc-macro back-compat warnings will be grouped under this lint. Note that this lint will never actually become a hard error - instead, we will remove the special cases for various macros, which will cause older versions of those crates to emit some other error. I've added code to fire this lint for the `time-macros-impl` case. This is the easiest case out of all of our current back-compat hacks - the crate was renamed to `time-macros`, so seeing a filename with `time-macros-impl` guarantees that an older version of the parent `time` crate is in use. When Cargo's future-incompat-report feature gets stabilized, affected users will start to see future-incompat warnings when they build their crates.
Rollup of 10 pull requests Successful merges: - rust-lang#82989 (Custom error on literal names from other languages) - rust-lang#83054 (Validate rustc_layout_scalar_valid_range_{start,end} attributes) - rust-lang#83098 (Find more invalid doc attributes) - rust-lang#83108 (Remove unused `opt_local_def_id_to_hir_id` function) - rust-lang#83110 (Fix typos in `library/core/src/ptr/mod.rs` and `library/std/src/sys_common/thread_local_dtor.rs`) - rust-lang#83113 (Minor refactoring in try_index_step) - rust-lang#83127 (Introduce `proc_macro_back_compat` lint, and emit for `time-macros-impl`) - rust-lang#83132 (Don't encode file information for span with a dummy location) - rust-lang#83141 (:arrow_up: rust-analyzer) - rust-lang#83144 (Introduce `rustc_interface::interface::Config::parse_sess_created` callback) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Hey there! As the maintainer of the time-macros-impl crate, what behavior should change (if any)? And with regard to the crate renaming, this hasn't yet happened on crates.io, but the code on the main branch is completely different (rewritten to avoid using syn/quote). |
There isn't actually anything wrong with In order to land a To answer your question: this shouldn't affect the behavior of any versions of |
Ah, I remember when that happened in |
We still check for the `rental`/`allsorts-rental` crates. But now if they are detected we just emit a fatal error, instead of emitting a warning and providing alternative behaviour. The original "hack" implementing alternative behaviour was added in rust-lang#73345. The lint was added in rust-lang#83127. The tracking issue is rust-lang#83125. The direct motivation for the change is that providing the alternative behaviour is interfering with rust-lang#125174 and follow-on work.
We still check for the `rental`/`allsorts-rental` crates. But now if they are detected we just emit a fatal error, instead of emitting a warning and providing alternative behaviour. The original "hack" implementing alternative behaviour was added in rust-lang#73345. The lint was added in rust-lang#83127. The tracking issue is rust-lang#83125. The direct motivation for the change is that providing the alternative behaviour is interfering with rust-lang#125174 and follow-on work.
Convert `proc_macro_back_compat` lint to an unconditional error. We still check for the `rental`/`allsorts-rental` crates. But now if they are detected we just emit a fatal error, instead of emitting a warning and providing alternative behaviour. The original "hack" implementing alternative behaviour was added in rust-lang#73345. The lint was added in rust-lang#83127. The tracking issue is rust-lang#83125. The direct motivation for the change is that providing the alternative behaviour is interfering with rust-lang#125174 and follow-on work. r? `@estebank`
…stebank Convert `proc_macro_back_compat` lint to an unconditional error. We still check for the `rental`/`allsorts-rental` crates. But now if they are detected we just emit a fatal error, instead of emitting a warning and providing alternative behaviour. The original "hack" implementing alternative behaviour was added in rust-lang#73345. The lint was added in rust-lang#83127. The tracking issue is rust-lang#83125. The direct motivation for the change is that providing the alternative behaviour is interfering with rust-lang#125174 and follow-on work. r? `@estebank`
…stebank Convert `proc_macro_back_compat` lint to an unconditional error. We still check for the `rental`/`allsorts-rental` crates. But now if they are detected we just emit a fatal error, instead of emitting a warning and providing alternative behaviour. The original "hack" implementing alternative behaviour was added in rust-lang#73345. The lint was added in rust-lang#83127. The tracking issue is rust-lang#83125. The direct motivation for the change is that providing the alternative behaviour is interfering with rust-lang#125174 and follow-on work. r? ``@estebank``
Rollup merge of rust-lang#125596 - nnethercote:rental-hard-error, r=estebank Convert `proc_macro_back_compat` lint to an unconditional error. We still check for the `rental`/`allsorts-rental` crates. But now if they are detected we just emit a fatal error, instead of emitting a warning and providing alternative behaviour. The original "hack" implementing alternative behaviour was added in rust-lang#73345. The lint was added in rust-lang#83127. The tracking issue is rust-lang#83125. The direct motivation for the change is that providing the alternative behaviour is interfering with rust-lang#125174 and follow-on work. r? ``@estebank``
We still check for the `rental`/`allsorts-rental` crates. But now if they are detected we just emit a fatal error, instead of emitting a warning and providing alternative behaviour. The original "hack" implementing alternative behaviour was added in rust-lang#73345. The lint was added in rust-lang#83127. The tracking issue is rust-lang#83125. The direct motivation for the change is that providing the alternative behaviour is interfering with rust-lang#125174 and follow-on work.
Now that future-incompat-report support has landed in nightly Cargo, we
can start to make progress towards removing the various proc-macro
back-compat hacks that have accumulated in the compiler.
This PR introduces a new lint
proc_macro_back_compat
, which results ina future-incompat-report entry being generated. All proc-macro
back-compat warnings will be grouped under this lint. Note that this
lint will never actually become a hard error - instead, we will remove
the special cases for various macros, which will cause older versions of
those crates to emit some other error.
I've added code to fire this lint for the
time-macros-impl
case. Thisis the easiest case out of all of our current back-compat hacks - the
crate was renamed to
time-macros
, so seeing a filename withtime-macros-impl
guarantees that an older version of the parenttime
crate is in use.
When Cargo's future-incompat-report feature gets stabilized, affected
users will start to see future-incompat warnings when they build their
crates.