summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2024-03-30 23:48:22 +0100
committerLinus Färnstrand <linus@mullvad.net>2024-04-02 12:53:10 +0200
commitb283fdfdd39ae151be0e79e79d62dd5f13e285e8 (patch)
treee0efb4a0e4d3902b8eb8a0695993aa1e220f536f
parent03be1ea82c036ac5fec780dcd6d55d19fcf6df0c (diff)
downloadmullvadvpn-b283fdfdd39ae151be0e79e79d62dd5f13e285e8.tar.xz
mullvadvpn-b283fdfdd39ae151be0e79e79d62dd5f13e285e8.zip
Enable more of the Allowed-by-default lints in rustc
* macro_use_extern_crate - Forbid #[macro_use] to bring macros into global scope. Even using `extern crate` is deprecated by now, so just extra protection against that * explicit_outlives_requirements - Warn aginst explicit lifetime bounds that can be inferred from the code. Keeps noise away. * absolute_paths_not_starting_with_crate - Catches Rust 2015 style absolute paths and denies them. * missing_abi - Force explicitly stating the ABI of `extern` items. Less implicit code * unused_lifetimes - Warn if you have lifetimes that are not used. Same reason as warning against unused variables * unused_macro_rules - Warn if you have a declarative macro with a rule that is never used. Basically same reason as warning on unused variables. Removes dead code
-rw-r--r--Cargo.toml11
-rw-r--r--test/Cargo.toml10
2 files changed, 19 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index c79b3969ff..d517588917 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -45,8 +45,17 @@ members = [
# Security
non_ascii_idents = "forbid"
-# Modern, easy to read style and opinionated best practices
+# Deny old style Rust
rust_2018_idioms = "deny"
+macro_use_extern_crate = "deny"
+absolute_paths_not_starting_with_crate = "deny"
+
+# Easy to read style and opinionated best practices
+explicit_outlives_requirements = "warn"
+missing_abi = "deny"
+unused_lifetimes = "warn"
+unused_macro_rules = "warn"
+
[workspace.lints.clippy]
unused_async = "deny"
diff --git a/test/Cargo.toml b/test/Cargo.toml
index 35c87980e9..d8763a3cc4 100644
--- a/test/Cargo.toml
+++ b/test/Cargo.toml
@@ -20,8 +20,16 @@ members = [
# Security
non_ascii_idents = "forbid"
-# Modern, easy to read style and opinionated best practices
+# Deny old style Rust
rust_2018_idioms = "deny"
+macro_use_extern_crate = "deny"
+absolute_paths_not_starting_with_crate = "deny"
+
+# Easy to read style and opinionated best practices
+explicit_outlives_requirements = "warn"
+missing_abi = "deny"
+unused_lifetimes = "warn"
+unused_macro_rules = "warn"
[workspace.lints.clippy]
unused_async = "deny"