Skip to content
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

replace rustflags with [lints] #837

Closed
OmarTawfik opened this issue Feb 21, 2024 · 1 comment · Fixed by #880
Closed

replace rustflags with [lints] #837

OmarTawfik opened this issue Feb 21, 2024 · 1 comment · Fixed by #880
Assignees

Comments

@OmarTawfik
Copy link
Contributor

https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html#lint-configuration-through-cargo

[build]
# TODO: Replace with `[lints]` once we upgrade to Rust 1.74
# https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html#lint-configuration-through-cargo
rustflags = [
# rustc additional warnings:
"-Wunused_crate_dependencies",
"-Wunused_lifetimes",
"-Wunused_macro_rules",
"-Wunused_tuple_struct_fields", # Will be uplifed into `dead_code` (warn-by-default) with https://github.com/rust-lang/rust/pull/118297
"-Wmeta_variable_misuse",
# Rust 2018 idioms that are not yet warn-by-default:
"-Welided_lifetimes_in_paths",
"-Wunused_extern_crates",
"-Wexplicit_outlives_requirements",
# 📎 Lints that are enabled (warn/deny) by default
"-Wclippy::all",
# Cargo
"-Wclippy::cargo", # Warn about Cargo.toml issues, except...
"-Aclippy::multiple_crate_versions", # Not possible to deduplicate, should be done periodically ourselves
# Restriction (optional, neutral lints)
"-Wclippy::exit", # Prefer not `process::exit`ing directly
"-Wclippy::rest_pat_in_fully_bound_structs", # Prefer not to use `..` in fully bound structs
"-Wclippy::verbose_file_reads", # Prefer simpler and more concise `fs::read_to_string`
# Pedantic
"-Wclippy::pedantic", # Warn about pedantic lints, except...
"-Aclippy::implicit_clone", # A lot of false positives, tuned down in Clippy bundled with Rust 1.73
"-Aclippy::match_same_arms", # It's often clearer to have the same arm twice
"-Aclippy::missing_errors_doc", # Most of our code is internal; let's not clutter the docs until...
"-Aclippy::missing_panics_doc", # ... we care about the public documentation in our shipped crates
"-Aclippy::module_name_repetitions", # It seems we prefer it this way; we'd need to discuss that
"-Aclippy::must_use_candidate", # Overzealous, we'd have to `[must_use]` a lot of things
"-Aclippy::redundant_closure_for_method_calls", # Not always clearer, let's not pepper `allow`s whenever needed
# Nursery
"-Wclippy::collection_is_never_read", # Lint against collections not used after creation
"-Wclippy::equatable_if_let", # Prefer regular `==` checks over Yoda `if let $pat = $value`
"-Wclippy::useless_let_if_seq", # Use idiomatic direct assignment of `let $val = if $cond { .. } else { ..};`
]

@OmarTawfik
Copy link
Contributor Author

OmarTawfik commented Feb 21, 2024

@Xanewok I assigned this initially as P3, as I was doing #838, but please feel free to edit this as you see fit.

github-merge-queue bot pushed a commit that referenced this issue Mar 5, 2024
@github-project-automation github-project-automation bot moved this from ⏳ Todo to ✅ Done in Slang - 2024 H1 Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants