From 25444cdd04eb07d4500be73b82eb3bd4f3eec8c5 Mon Sep 17 00:00:00 2001 From: Tetsuharu Ohzeki Date: Fri, 29 Dec 2023 22:58:50 +0900 Subject: [PATCH 1/2] Bump rust-version to 1.74 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d4cff420bcb51..80dfb75920f92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ exclude = ["crates/proc-macro-srv/proc-macro-test/"] resolver = "2" [workspace.package] -rust-version = "1.70" +rust-version = "1.74" edition = "2021" license = "MIT OR Apache-2.0" authors = ["rust-analyzer team"] From efc87092b3d9e350f12b87f5e3823bc44561ba9b Mon Sep 17 00:00:00 2001 From: Tetsuharu Ohzeki Date: Fri, 29 Dec 2023 23:22:29 +0900 Subject: [PATCH 2/2] Use Cargo's [workspace.lints.*] to config clippy --- .cargo/config.toml | 2 +- Cargo.toml | 6 ++++++ crates/base-db/Cargo.toml | 3 +++ crates/cfg/Cargo.toml | 3 +++ crates/flycheck/Cargo.toml | 3 +++ crates/hir-def/Cargo.toml | 3 +++ crates/hir-expand/Cargo.toml | 3 +++ crates/hir-ty/Cargo.toml | 3 +++ crates/hir/Cargo.toml | 3 +++ crates/ide-assists/Cargo.toml | 3 +++ crates/ide-completion/Cargo.toml | 3 +++ crates/ide-db/Cargo.toml | 3 +++ crates/ide-diagnostics/Cargo.toml | 3 +++ crates/ide-ssr/Cargo.toml | 3 +++ crates/ide/Cargo.toml | 3 +++ crates/intern/Cargo.toml | 3 +++ crates/limit/Cargo.toml | 3 +++ crates/load-cargo/Cargo.toml | 3 +++ crates/mbe/Cargo.toml | 3 +++ crates/parser/Cargo.toml | 3 +++ crates/paths/Cargo.toml | 3 +++ crates/proc-macro-api/Cargo.toml | 3 +++ crates/proc-macro-srv-cli/Cargo.toml | 3 +++ crates/proc-macro-srv/Cargo.toml | 3 +++ crates/profile/Cargo.toml | 3 +++ crates/project-model/Cargo.toml | 3 +++ crates/rust-analyzer/Cargo.toml | 3 +++ crates/rustc-dependencies/Cargo.toml | 3 +++ crates/sourcegen/Cargo.toml | 3 +++ crates/span/Cargo.toml | 3 +++ crates/stdx/Cargo.toml | 3 +++ crates/syntax/Cargo.toml | 3 +++ crates/syntax/fuzz/Cargo.toml | 3 +++ crates/test-fixture/Cargo.toml | 3 +++ crates/test-utils/Cargo.toml | 3 +++ crates/text-edit/Cargo.toml | 3 +++ crates/toolchain/Cargo.toml | 3 +++ crates/tt/Cargo.toml | 3 +++ crates/vfs-notify/Cargo.toml | 3 +++ crates/vfs/Cargo.toml | 3 +++ lib/la-arena/Cargo.toml | 3 +++ lib/line-index/Cargo.toml | 3 +++ lib/lsp-server/Cargo.toml | 3 +++ xtask/Cargo.toml | 3 +++ 44 files changed, 133 insertions(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index c9ad7803951ad..c3cfda85517e4 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,7 +2,7 @@ xtask = "run --package xtask --bin xtask --" tq = "test -- -q" qt = "tq" -lint = "clippy --all-targets -- -Aclippy::collapsible_if -Aclippy::needless_pass_by_value -Aclippy::nonminimal_bool -Aclippy::redundant_pattern_matching --cap-lints warn" +lint = "clippy --all-targets -- --cap-lints warn" [target.x86_64-pc-windows-msvc] linker = "rust-lld" diff --git a/Cargo.toml b/Cargo.toml index 80dfb75920f92..d40db83e15630 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -133,3 +133,9 @@ xshell = "0.2.5" # We need to freeze the version of the crate, as the raw-api feature is considered unstable dashmap = { version = "=5.5.3", features = ["raw-api"] } + +[workspace.lints.clippy] +collapsible_if = "allow" +needless_pass_by_value = "allow" +nonminimal_bool = "allow" +redundant_pattern_matching = "allow" \ No newline at end of file diff --git a/crates/base-db/Cargo.toml b/crates/base-db/Cargo.toml index 13b2665558123..1aa43175f90b2 100644 --- a/crates/base-db/Cargo.toml +++ b/crates/base-db/Cargo.toml @@ -25,3 +25,6 @@ stdx.workspace = true syntax.workspace = true vfs.workspace = true span.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/cfg/Cargo.toml b/crates/cfg/Cargo.toml index a90dec6b7d9e7..fbda065b10f34 100644 --- a/crates/cfg/Cargo.toml +++ b/crates/cfg/Cargo.toml @@ -29,3 +29,6 @@ derive_arbitrary = "1.3.2" # local deps mbe.workspace = true syntax.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/flycheck/Cargo.toml b/crates/flycheck/Cargo.toml index 6f91ea31bb28d..b8c10da1b6e34 100644 --- a/crates/flycheck/Cargo.toml +++ b/crates/flycheck/Cargo.toml @@ -24,3 +24,6 @@ command-group.workspace = true paths.workspace = true stdx.workspace = true toolchain.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/hir-def/Cargo.toml b/crates/hir-def/Cargo.toml index 5e8cf0d7e4a28..5933d30040fad 100644 --- a/crates/hir-def/Cargo.toml +++ b/crates/hir-def/Cargo.toml @@ -54,3 +54,6 @@ test-fixture.workspace = true [features] in-rust-tree = ["rustc-dependencies/in-rust-tree"] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/hir-expand/Cargo.toml b/crates/hir-expand/Cargo.toml index e8a8f3ee073e5..506a188a211dc 100644 --- a/crates/hir-expand/Cargo.toml +++ b/crates/hir-expand/Cargo.toml @@ -36,3 +36,6 @@ span.workspace = true [dev-dependencies] expect-test = "1.4.0" + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/hir-ty/Cargo.toml b/crates/hir-ty/Cargo.toml index 45e69c59d71e7..1873e7bfe6a5c 100644 --- a/crates/hir-ty/Cargo.toml +++ b/crates/hir-ty/Cargo.toml @@ -58,3 +58,6 @@ test-fixture.workspace = true [features] in-rust-tree = ["rustc-dependencies/in-rust-tree"] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/hir/Cargo.toml b/crates/hir/Cargo.toml index 063365a16bc21..e4e4bcea6108d 100644 --- a/crates/hir/Cargo.toml +++ b/crates/hir/Cargo.toml @@ -33,3 +33,6 @@ tt.workspace = true [features] in-rust-tree = [] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/ide-assists/Cargo.toml b/crates/ide-assists/Cargo.toml index 69d98fd78fd3b..4d4bac5fb9664 100644 --- a/crates/ide-assists/Cargo.toml +++ b/crates/ide-assists/Cargo.toml @@ -36,3 +36,6 @@ sourcegen.workspace = true [features] in-rust-tree = [] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/ide-completion/Cargo.toml b/crates/ide-completion/Cargo.toml index f7fec3cf7738c..7fbcf3d19e0f1 100644 --- a/crates/ide-completion/Cargo.toml +++ b/crates/ide-completion/Cargo.toml @@ -36,3 +36,6 @@ expect-test = "1.4.0" # local deps test-utils.workspace = true test-fixture.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/ide-db/Cargo.toml b/crates/ide-db/Cargo.toml index a3b1dc5b604c9..f14d9ed1b9334 100644 --- a/crates/ide-db/Cargo.toml +++ b/crates/ide-db/Cargo.toml @@ -50,3 +50,6 @@ xshell.workspace = true test-utils.workspace = true test-fixture.workspace = true sourcegen.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/ide-diagnostics/Cargo.toml b/crates/ide-diagnostics/Cargo.toml index fd77badbd6594..3ed48457a2842 100644 --- a/crates/ide-diagnostics/Cargo.toml +++ b/crates/ide-diagnostics/Cargo.toml @@ -37,3 +37,6 @@ sourcegen.workspace = true [features] in-rust-tree = [] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/ide-ssr/Cargo.toml b/crates/ide-ssr/Cargo.toml index 9ea7beaf985de..57b1f9465ad3e 100644 --- a/crates/ide-ssr/Cargo.toml +++ b/crates/ide-ssr/Cargo.toml @@ -32,3 +32,6 @@ expect-test = "1.4.0" # local deps test-utils.workspace = true test-fixture.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index daff8bdac12de..9f0a2f30f658a 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml @@ -54,3 +54,6 @@ test-fixture.workspace = true [features] in-rust-tree = ["ide-assists/in-rust-tree", "ide-diagnostics/in-rust-tree"] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/intern/Cargo.toml b/crates/intern/Cargo.toml index 3b0c2559482d8..67b4164ce1fe0 100644 --- a/crates/intern/Cargo.toml +++ b/crates/intern/Cargo.toml @@ -18,3 +18,6 @@ dashmap.workspace = true hashbrown.workspace = true rustc-hash.workspace = true triomphe.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/limit/Cargo.toml b/crates/limit/Cargo.toml index c088869099227..c89722cc40dee 100644 --- a/crates/limit/Cargo.toml +++ b/crates/limit/Cargo.toml @@ -11,3 +11,6 @@ rust-version.workspace = true [features] tracking = [] default = ["tracking"] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/load-cargo/Cargo.toml b/crates/load-cargo/Cargo.toml index ae7c7e2ac7508..dcab6328a4e89 100644 --- a/crates/load-cargo/Cargo.toml +++ b/crates/load-cargo/Cargo.toml @@ -26,3 +26,6 @@ vfs-notify.workspace = true span.workspace = true hir-expand.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/mbe/Cargo.toml b/crates/mbe/Cargo.toml index 77f48a57f90a3..f50d796e139f1 100644 --- a/crates/mbe/Cargo.toml +++ b/crates/mbe/Cargo.toml @@ -26,3 +26,6 @@ span.workspace = true [dev-dependencies] test-utils.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml index efb326323f915..0c63484634be9 100644 --- a/crates/parser/Cargo.toml +++ b/crates/parser/Cargo.toml @@ -25,3 +25,6 @@ sourcegen.workspace = true [features] in-rust-tree = ["rustc-dependencies/in-rust-tree"] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/paths/Cargo.toml b/crates/paths/Cargo.toml index 28b54be5212f4..3d8752b5a829d 100644 --- a/crates/paths/Cargo.toml +++ b/crates/paths/Cargo.toml @@ -16,3 +16,6 @@ doctest = false # serde-derive crate. Even though we don't activate the derive feature here, # someone else in the crate graph certainly does! # serde.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/proc-macro-api/Cargo.toml b/crates/proc-macro-api/Cargo.toml index 209cbb945d7fc..49a0979f4f5c6 100644 --- a/crates/proc-macro-api/Cargo.toml +++ b/crates/proc-macro-api/Cargo.toml @@ -38,3 +38,6 @@ span.workspace = true # InternIds for the syntax context base-db.workspace = true la-arena.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/proc-macro-srv-cli/Cargo.toml b/crates/proc-macro-srv-cli/Cargo.toml index 8f03c6ec7b572..980eab2696bfa 100644 --- a/crates/proc-macro-srv-cli/Cargo.toml +++ b/crates/proc-macro-srv-cli/Cargo.toml @@ -18,3 +18,6 @@ sysroot-abi = ["proc-macro-srv/sysroot-abi"] [[bin]] name = "rust-analyzer-proc-macro-srv" path = "src/main.rs" + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/proc-macro-srv/Cargo.toml b/crates/proc-macro-srv/Cargo.toml index bef2c30e9fb6b..b6686fa5b65d3 100644 --- a/crates/proc-macro-srv/Cargo.toml +++ b/crates/proc-macro-srv/Cargo.toml @@ -38,3 +38,6 @@ proc-macro-test.path = "./proc-macro-test" [features] sysroot-abi = ["proc-macro-test/sysroot-abi"] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/profile/Cargo.toml b/crates/profile/Cargo.toml index 56ce9d11c085f..5350023c88fac 100644 --- a/crates/profile/Cargo.toml +++ b/crates/profile/Cargo.toml @@ -31,3 +31,6 @@ jemalloc = ["jemalloc-ctl"] # Uncomment to enable for the whole crate graph # default = [ "cpu_profiler" ] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/project-model/Cargo.toml b/crates/project-model/Cargo.toml index a36c9aca52d65..3552ed191628e 100644 --- a/crates/project-model/Cargo.toml +++ b/crates/project-model/Cargo.toml @@ -33,3 +33,6 @@ toolchain.workspace = true [dev-dependencies] expect-test = "1.4.0" + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index a9bf4d8c33638..ad24d6d28cd7a 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml @@ -94,3 +94,6 @@ in-rust-tree = [ "hir-def/in-rust-tree", "hir-ty/in-rust-tree", ] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/rustc-dependencies/Cargo.toml b/crates/rustc-dependencies/Cargo.toml index 1b3b6ec735e75..0bf04301df169 100644 --- a/crates/rustc-dependencies/Cargo.toml +++ b/crates/rustc-dependencies/Cargo.toml @@ -18,3 +18,6 @@ ra-ap-rustc_abi = { version = "0.21.0", default-features = false } [features] in-rust-tree = [] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/sourcegen/Cargo.toml b/crates/sourcegen/Cargo.toml index 8e3e426ae13c9..d5ea4c39aa175 100644 --- a/crates/sourcegen/Cargo.toml +++ b/crates/sourcegen/Cargo.toml @@ -14,3 +14,6 @@ doctest = false [dependencies] xshell.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/span/Cargo.toml b/crates/span/Cargo.toml index 8b078f9df1374..69b88b5a17b53 100644 --- a/crates/span/Cargo.toml +++ b/crates/span/Cargo.toml @@ -16,3 +16,6 @@ rust-analyzer-salsa.workspace = true vfs.workspace = true syntax.workspace = true stdx.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/stdx/Cargo.toml b/crates/stdx/Cargo.toml index c914ae2144b59..e6014cf812e56 100644 --- a/crates/stdx/Cargo.toml +++ b/crates/stdx/Cargo.toml @@ -27,3 +27,6 @@ winapi = { version = "0.3.9", features = ["winerror"] } [features] # Uncomment to enable for the whole crate graph # default = [ "backtrace" ] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index 1cb9a4aedc5aa..40a93fec2cec2 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml @@ -42,3 +42,6 @@ sourcegen.workspace = true [features] in-rust-tree = ["rustc-dependencies/in-rust-tree"] + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/syntax/fuzz/Cargo.toml b/crates/syntax/fuzz/Cargo.toml index 6070222f1f192..ebf538aa24718 100644 --- a/crates/syntax/fuzz/Cargo.toml +++ b/crates/syntax/fuzz/Cargo.toml @@ -24,3 +24,6 @@ path = "fuzz_targets/parser.rs" [[bin]] name = "reparse" path = "fuzz_targets/reparse.rs" + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/test-fixture/Cargo.toml b/crates/test-fixture/Cargo.toml index ff921aa83d33f..35e39229894f2 100644 --- a/crates/test-fixture/Cargo.toml +++ b/crates/test-fixture/Cargo.toml @@ -16,3 +16,6 @@ base-db.workspace = true rustc-hash.workspace = true span.workspace = true stdx.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/test-utils/Cargo.toml b/crates/test-utils/Cargo.toml index 8b3924dd86b68..56067d8341789 100644 --- a/crates/test-utils/Cargo.toml +++ b/crates/test-utils/Cargo.toml @@ -19,3 +19,6 @@ rustc-hash.workspace = true stdx.workspace = true profile.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/text-edit/Cargo.toml b/crates/text-edit/Cargo.toml index 4620cc72d0a22..f745674794c99 100644 --- a/crates/text-edit/Cargo.toml +++ b/crates/text-edit/Cargo.toml @@ -14,3 +14,6 @@ doctest = false [dependencies] itertools.workspace = true text-size.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/toolchain/Cargo.toml b/crates/toolchain/Cargo.toml index a283f9a884214..f9b120772f038 100644 --- a/crates/toolchain/Cargo.toml +++ b/crates/toolchain/Cargo.toml @@ -13,3 +13,6 @@ doctest = false [dependencies] home = "0.5.4" + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/tt/Cargo.toml b/crates/tt/Cargo.toml index e2c0f7d9c794b..77683fd48afb2 100644 --- a/crates/tt/Cargo.toml +++ b/crates/tt/Cargo.toml @@ -19,3 +19,6 @@ stdx.workspace = true # FIXME: Remove this dependency once the `Span` trait is gone (that is once Span::DUMMY has been removed) span.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/vfs-notify/Cargo.toml b/crates/vfs-notify/Cargo.toml index fe6cb0a2c3fd9..a6d5027c3a60a 100644 --- a/crates/vfs-notify/Cargo.toml +++ b/crates/vfs-notify/Cargo.toml @@ -20,3 +20,6 @@ notify = "6.1.1" stdx.workspace = true vfs.workspace = true paths.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/crates/vfs/Cargo.toml b/crates/vfs/Cargo.toml index af4cc034c3c0a..c88f346655984 100644 --- a/crates/vfs/Cargo.toml +++ b/crates/vfs/Cargo.toml @@ -19,3 +19,6 @@ nohash-hasher.workspace = true paths.workspace = true stdx.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/lib/la-arena/Cargo.toml b/lib/la-arena/Cargo.toml index 01f2b87b39d22..589d026142bb7 100644 --- a/lib/la-arena/Cargo.toml +++ b/lib/la-arena/Cargo.toml @@ -8,3 +8,6 @@ documentation = "https://docs.rs/la-arena" categories = ["data-structures", "memory-management", "rust-patterns"] edition = "2021" rust-version = "1.56" + +[lints] +workspace = true diff --git a/lib/line-index/Cargo.toml b/lib/line-index/Cargo.toml index 494a7fa979a78..77e187de1ed80 100644 --- a/lib/line-index/Cargo.toml +++ b/lib/line-index/Cargo.toml @@ -9,3 +9,6 @@ edition = "2021" [dependencies] text-size = "1.1.1" nohash-hasher = "0.2.0" + +[lints] +workspace = true \ No newline at end of file diff --git a/lib/lsp-server/Cargo.toml b/lib/lsp-server/Cargo.toml index e802bf185b3e6..14c917a4f2a8f 100644 --- a/lib/lsp-server/Cargo.toml +++ b/lib/lsp-server/Cargo.toml @@ -15,3 +15,6 @@ crossbeam-channel = "0.5.6" [dev-dependencies] lsp-types = "=0.95" ctrlc = "3.4.1" + +[lints] +workspace = true \ No newline at end of file diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 1c785b60a3d8f..863a63ac82e72 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -15,3 +15,6 @@ xflags = "0.3.0" time = { version = "0.3", default-features = false } zip = { version = "0.6", default-features = false, features = ["deflate", "time"] } # Avoid adding more dependencies to this crate + +[lints] +workspace = true \ No newline at end of file