-
Notifications
You must be signed in to change notification settings - Fork 955
build: migrate the codebase to the 2024 Language Edition #4191
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
Conversation
6799481
to
665f283
Compare
665f283
to
396623f
Compare
Nice work! |
Following <https://users.rust-lang.org/t/rust-2024-compatibility-lint-and-the-if-let-temporary-scope/125969/5>, I have manually audited all `if_let_rescope` cases and found out that certain existing cases can be rewritten to make it clearer semantically. So these migrations have been made in advance so that the only cases of `if-let` remaining are false positives of this lint. The crux of determining false positives here is that, according to <rust-lang/rust#133167>, `if let Some()` and other similar cases where the `else` drop is not significant are not affected by the Edition change.
396623f
to
ff252c5
Compare
ff252c5
to
85b90f6
Compare
@@ -129,7 +129,7 @@ impl NotificationLevel { | |||
/// A [`tracing::Subscriber`] [`Layer`][`tracing_subscriber::Layer`] that corresponds to Rustup's | |||
/// optional `opentelemetry` (a.k.a. `otel`) feature. | |||
#[cfg(feature = "otel")] | |||
fn telemetry<S>(process: &Process) -> impl Layer<S> | |||
fn telemetry<S>(process: &Process) -> impl Layer<S> + use<S> |
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.
@djc So basically impl Layer<S> + use<S>
means "this impl Layer<S>
has nothing to do with 'process
" (this function is generic over both 'process
and S
, so we use<S>
to exclude 'process
), and the same thing goes for other fixes in this commit.
I just did one more check and have again found no missing significant drops. I think it should be safe to merge this one now. |
Continuation of #4190.
This is a semi-automatic migration due to the sheer amount of false positives in the
rust-2024-compatibility
lint group and theif_let_rescope
lint in particular. Some steps have more details in the corresponding commit messages.You can get a clearer version of the PR diff via semanticdiff.
Concerns
if-let
correctly migrated?if_let_rescope
auto migration #4192 to include all the suggestions made byclippy
where there are a lot of false positives.