-
Notifications
You must be signed in to change notification settings - Fork 502
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
chore: enable Rust 2024 edition lints #2728
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2728 +/- ##
=====================================
Coverage 79.4% 79.4%
=====================================
Files 123 123
Lines 22781 22781
=====================================
Hits 18106 18106
Misses 4675 4675 ☔ View full report in Codecov by Sentry. |
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.
Cool! I reckon we should deal with the lints at the same time, but other than that I think this is a great idea.
@@ -85,5 +85,12 @@ opentelemetry = { path = "opentelemetry" } | |||
opentelemetry_sdk = { path = "opentelemetry-sdk" } | |||
opentelemetry-stdout = { path = "opentelemetry-stdout" } | |||
|
|||
[workspace.lints.rust] | |||
rust_2024_compatibility = { level = "warn", priority = -1 } | |||
# No need to enable those, because it either not needed or results in ugly syntax |
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.
IMHO idiomatic rust syntax is what the default rustc
lint set enforces; I think we should have strong reasons to opt out of these, and it would be nice to make the linter happy at the same time as we turn on the linting support.
Appreciate though that this will add a bunch of noise to the PR beyond the core 'turn on 2024 linting' flag. @cijothomas what do you think?
if_let_rescope - cargo clippy --fix
seems to clean up most of these.
tail_expr_drop_order - this one can't be autofixed, but seems fairly straightforward:
However, the most probable fix is to hoist Droppy into its own local variable binding.
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.
LGTM. I think it would be good to create a separate issue to track fixing these lint's.
Changes
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes