From 2c12b53082ace14f56b781cbd765dbda8980c820 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Sat, 15 Aug 2026 18:55:45 -0400 Subject: [PATCH] Prepare to make a cargo workspace --- .gitignore | 2 ++ clippy_dev/src/lib.rs | 5 +++-- clippy_dummy/Cargo.toml | 2 ++ clippy_lints/src/option_env_unwrap.rs | 4 ++-- clippy_lints/src/zombie_processes.rs | 4 ++-- .../src/repeated_is_diagnostic_item.rs | 4 ++-- clippy_utils/src/lib.rs | 10 +++------- declare_clippy_lint/src/lib.rs | 3 +++ src/driver.rs | 2 -- src/main.rs | 2 -- tests/compile-test.rs | 3 +-- tests/config-metadata.rs | 2 -- .../cargo_rust_version/fail_both_diff/Cargo.toml | 2 ++ .../cargo_rust_version/fail_both_same/Cargo.toml | 2 ++ .../ui-cargo/cargo_rust_version/fail_cargo/Cargo.toml | 2 ++ .../ui-cargo/cargo_rust_version/fail_clippy/Cargo.toml | 2 ++ .../cargo_rust_version/fail_file_attr/Cargo.toml | 2 ++ .../cargo_rust_version/pass_both_same/Cargo.toml | 2 ++ .../ui-cargo/cargo_rust_version/pass_cargo/Cargo.toml | 2 ++ .../ui-cargo/cargo_rust_version/pass_clippy/Cargo.toml | 2 ++ .../cargo_rust_version/pass_file_attr/Cargo.toml | 2 ++ .../cargo_rust_version/warn_both_diff/Cargo.toml | 2 ++ .../fail_edge_cases/Cargo.toml | 2 ++ .../definition_in_module_root/fail_mod/Cargo.toml | 2 ++ .../fail_path_attr/Cargo.toml | 2 ++ .../definition_in_module_root/pass_bin/Cargo.toml | 2 ++ .../pass_lib_with_definitions/Cargo.toml | 2 ++ .../pass_path_attr/Cargo.toml | 2 ++ tests/ui-cargo/duplicate_mod/fail/Cargo.toml | 2 ++ tests/ui-cargo/lint_groups_priority/pass/Cargo.toml | 2 ++ .../module_style/duplicated_mod_names_14697/Cargo.toml | 2 ++ tests/ui-cargo/module_style/fail_mod/Cargo.toml | 2 ++ tests/ui-cargo/module_style/fail_mod_remap/Cargo.toml | 2 ++ tests/ui-cargo/module_style/fail_no_mod/Cargo.toml | 2 ++ tests/ui-cargo/module_style/inline_mod/Cargo.toml | 2 ++ tests/ui-cargo/module_style/pass_mod/Cargo.toml | 2 ++ tests/ui-cargo/module_style/pass_no_mod/Cargo.toml | 2 ++ .../segment_with_mod_name_10271_11916/Cargo.toml | 2 +- .../module_style/with_path_attr_mod/Cargo.toml | 4 +++- .../module_style/with_path_attr_no_mod/Cargo.toml | 4 +++- .../ui-cargo/multiple_config_files/no_warn/Cargo.toml | 2 ++ tests/ui-cargo/multiple_config_files/warn/Cargo.toml | 2 ++ .../multiple_inherent_impl/config_fail/Cargo.toml | 2 ++ .../multiple_inherent_impl/crate_fail/Cargo.toml | 2 ++ .../multiple_inherent_impl/file_fail/Cargo.toml | 2 ++ .../multiple_inherent_impl/module_fail/Cargo.toml | 2 ++ .../undocumented_unsafe_blocks/fail/Cargo.toml | 4 +++- 47 files changed, 92 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index 666c4ceac4db..1c9df45b7f92 100644 --- a/.gitignore +++ b/.gitignore @@ -21,8 +21,10 @@ out *Cargo.lock !/clippy_test_deps/Cargo.lock /target +/clippy_dummy/target /clippy_lints/target /clippy_lints_internal/target +/clippy_test_deps/target /clippy_utils/target /clippy_dev/target /lintcheck/target diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs index 70783118efed..abe30ff6833a 100644 --- a/clippy_dev/src/lib.rs +++ b/clippy_dev/src/lib.rs @@ -15,10 +15,11 @@ )] #![expect(clippy::missing_panics_doc)] -extern crate rustc_arena; -extern crate rustc_data_structures; #[expect(unused_extern_crates, reason = "required to link to rustc crates")] extern crate rustc_driver; + +extern crate rustc_arena; +extern crate rustc_data_structures; extern crate rustc_lexer; pub mod dogfood; diff --git a/clippy_dummy/Cargo.toml b/clippy_dummy/Cargo.toml index 5c7ed584309a..32f257a030eb 100644 --- a/clippy_dummy/Cargo.toml +++ b/clippy_dummy/Cargo.toml @@ -14,3 +14,5 @@ categories = ["development-tools", "development-tools::cargo-plugins"] [build-dependencies] term = "1" + +[workspace] diff --git a/clippy_lints/src/option_env_unwrap.rs b/clippy_lints/src/option_env_unwrap.rs index c5410feee971..96a81f34509d 100644 --- a/clippy_lints/src/option_env_unwrap.rs +++ b/clippy_lints/src/option_env_unwrap.rs @@ -17,13 +17,13 @@ declare_clippy_lint! { /// /// ### Example /// ```rust,no_run - /// let _ = option_env!("HOME").unwrap(); + /// let _ = option_env!("CARGO").unwrap(); /// ``` /// /// Is better expressed as: /// /// ```rust,no_run - /// let _ = env!("HOME"); + /// let _ = env!("CARGO"); /// ``` #[clippy::version = "1.43.0"] pub OPTION_ENV_UNWRAP, diff --git a/clippy_lints/src/zombie_processes.rs b/clippy_lints/src/zombie_processes.rs index 68023209b34b..913ebb3ece03 100644 --- a/clippy_lints/src/zombie_processes.rs +++ b/clippy_lints/src/zombie_processes.rs @@ -37,13 +37,13 @@ declare_clippy_lint! { /// In other words, the `wait()` call must be unconditionally reachable after the spawn expression. /// /// ### Example - /// ```rust + /// ```rust,no_run /// use std::process::Command; /// /// let _child = Command::new("ls").spawn().expect("failed to execute child"); /// ``` /// Use instead: - /// ```rust + /// ```rust,no_run /// use std::process::Command; /// /// let mut child = Command::new("ls").spawn().expect("failed to execute child"); diff --git a/clippy_lints_internal/src/repeated_is_diagnostic_item.rs b/clippy_lints_internal/src/repeated_is_diagnostic_item.rs index a7599ae21350..37a84b8dc51c 100644 --- a/clippy_lints_internal/src/repeated_is_diagnostic_item.rs +++ b/clippy_lints_internal/src/repeated_is_diagnostic_item.rs @@ -25,7 +25,7 @@ declare_tool_lint! { /// While the query is cached, it's still better to avoid calling it multiple times if possible. /// /// ### Example - /// ```no_run + /// ```ignore /// ty.is_diag_item(cx, sym::Option) || ty.is_diag_item(cx, sym::Result) /// cx.tcx.is_diagnostic_item(sym::Option, did) || cx.tcx.is_diagnostic_item(sym::Result, did) /// @@ -64,7 +64,7 @@ declare_tool_lint! { /// } /// ``` /// Use instead: - /// ```no_run + /// ```ignore /// matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)) /// matches!(cx.tcx.get_diagnostic_name(did), Some(sym::Option | sym::Result)) /// diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index 0df198a393db..568984b01399 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -13,18 +13,14 @@ rustc::internal )] -// FIXME: switch to something more ergonomic here, once available. -// (Currently there is no way to opt into sysroot crates without `extern crate`.) +#[expect(unused_extern_crates, reason = "required to link to rustc crates")] +extern crate rustc_driver; + extern crate rustc_abi; extern crate rustc_ast; extern crate rustc_attr_parsing; extern crate rustc_const_eval; extern crate rustc_data_structures; -#[expect( - unused_extern_crates, - reason = "The `rustc_driver` crate seems to be required in order to use the `rust_ast` crate." -)] -extern crate rustc_driver; extern crate rustc_errors; extern crate rustc_hir; extern crate rustc_hir_analysis; diff --git a/declare_clippy_lint/src/lib.rs b/declare_clippy_lint/src/lib.rs index f7d9c64bfbd0..3cafaa8de2e6 100644 --- a/declare_clippy_lint/src/lib.rs +++ b/declare_clippy_lint/src/lib.rs @@ -1,5 +1,8 @@ #![feature(macro_metavar_expr_concat, rustc_private)] +#[expect(unused_extern_crates, reason = "required to link to rustc crates")] +extern crate rustc_driver; + extern crate rustc_lint; use rustc_lint::{Lint, LintId, LintStore}; diff --git a/src/driver.rs b/src/driver.rs index 78b9b2cd8de3..b8ef56d8bf34 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -5,8 +5,6 @@ // and on rustc internal lints rustc::internal)] -// FIXME: switch to something more ergonomic here, once available. -// (Currently there is no way to opt into sysroot crates without `extern crate`.) extern crate rustc_driver; extern crate rustc_interface; extern crate rustc_session; diff --git a/src/main.rs b/src/main.rs index 14a437fc874f..63977068c02b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -// We need this feature as it changes `dylib` linking behavior and allows us to link to -// `rustc_driver`. #![feature(rustc_private)] // warn on lints, that are included in `rust-lang/rust`s bootstrap #![warn(rust_2018_idioms, unused_lifetimes)] diff --git a/tests/compile-test.rs b/tests/compile-test.rs index a8a38e0d2c61..0b21d23e712a 100644 --- a/tests/compile-test.rs +++ b/tests/compile-test.rs @@ -144,7 +144,6 @@ impl TestContext { } fn base_config(&self, test_dir: &str, mandatory_annotations: bool) -> Config { - let target_dir = PathBuf::from(var_os("CARGO_TARGET_DIR").unwrap_or_else(|| "target".into())); let mut config = Config { output_conflict_handling: error_on_output_conflict, // Pre-fill filters with TESTNAME; will be later extended with `self.args`. @@ -165,7 +164,7 @@ impl TestContext { } else { "cargo uibless".into() }), - out_dir: target_dir.join("ui_test"), + out_dir: Path::new(env!("CARGO_TARGET_TMPDIR")).join("clippy_ui_test"), ..Config::rustc(Path::new("tests").join(test_dir)) }; let defaults = config.comment_defaults.base(); diff --git a/tests/config-metadata.rs b/tests/config-metadata.rs index a91785e78203..38a0bc108641 100644 --- a/tests/config-metadata.rs +++ b/tests/config-metadata.rs @@ -1,7 +1,5 @@ #![feature(rustc_private)] -extern crate rustc_driver; - use clippy_config::{Conf, ConfMetadata}; use itertools::Itertools as _; use regex::Regex; diff --git a/tests/ui-cargo/cargo_rust_version/fail_both_diff/Cargo.toml b/tests/ui-cargo/cargo_rust_version/fail_both_diff/Cargo.toml index 946d1b366f09..a981d0cf6100 100644 --- a/tests/ui-cargo/cargo_rust_version/fail_both_diff/Cargo.toml +++ b/tests/ui-cargo/cargo_rust_version/fail_both_diff/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/cargo_rust_version/fail_both_same/Cargo.toml b/tests/ui-cargo/cargo_rust_version/fail_both_same/Cargo.toml index 46b92a1050e3..d301302ce455 100644 --- a/tests/ui-cargo/cargo_rust_version/fail_both_same/Cargo.toml +++ b/tests/ui-cargo/cargo_rust_version/fail_both_same/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/cargo_rust_version/fail_cargo/Cargo.toml b/tests/ui-cargo/cargo_rust_version/fail_cargo/Cargo.toml index 189cc9f68dc4..83f5771dfca8 100644 --- a/tests/ui-cargo/cargo_rust_version/fail_cargo/Cargo.toml +++ b/tests/ui-cargo/cargo_rust_version/fail_cargo/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/cargo_rust_version/fail_clippy/Cargo.toml b/tests/ui-cargo/cargo_rust_version/fail_clippy/Cargo.toml index bdb7f261d9e4..3880aad6b715 100644 --- a/tests/ui-cargo/cargo_rust_version/fail_clippy/Cargo.toml +++ b/tests/ui-cargo/cargo_rust_version/fail_clippy/Cargo.toml @@ -6,3 +6,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/cargo_rust_version/fail_file_attr/Cargo.toml b/tests/ui-cargo/cargo_rust_version/fail_file_attr/Cargo.toml index 84448ea41f64..5d331bf66c2a 100644 --- a/tests/ui-cargo/cargo_rust_version/fail_file_attr/Cargo.toml +++ b/tests/ui-cargo/cargo_rust_version/fail_file_attr/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/cargo_rust_version/pass_both_same/Cargo.toml b/tests/ui-cargo/cargo_rust_version/pass_both_same/Cargo.toml index 809c0e74875b..8ee4e0a5f8ba 100644 --- a/tests/ui-cargo/cargo_rust_version/pass_both_same/Cargo.toml +++ b/tests/ui-cargo/cargo_rust_version/pass_both_same/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/cargo_rust_version/pass_cargo/Cargo.toml b/tests/ui-cargo/cargo_rust_version/pass_cargo/Cargo.toml index 32d404f842cf..e5aff0b5e936 100644 --- a/tests/ui-cargo/cargo_rust_version/pass_cargo/Cargo.toml +++ b/tests/ui-cargo/cargo_rust_version/pass_cargo/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/cargo_rust_version/pass_clippy/Cargo.toml b/tests/ui-cargo/cargo_rust_version/pass_clippy/Cargo.toml index cc937d6e6254..e6764b6dd36e 100644 --- a/tests/ui-cargo/cargo_rust_version/pass_clippy/Cargo.toml +++ b/tests/ui-cargo/cargo_rust_version/pass_clippy/Cargo.toml @@ -6,3 +6,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/cargo_rust_version/pass_file_attr/Cargo.toml b/tests/ui-cargo/cargo_rust_version/pass_file_attr/Cargo.toml index 8ef689880d41..07f884fec884 100644 --- a/tests/ui-cargo/cargo_rust_version/pass_file_attr/Cargo.toml +++ b/tests/ui-cargo/cargo_rust_version/pass_file_attr/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/cargo_rust_version/warn_both_diff/Cargo.toml b/tests/ui-cargo/cargo_rust_version/warn_both_diff/Cargo.toml index e9f94594f702..9ad3942f9899 100644 --- a/tests/ui-cargo/cargo_rust_version/warn_both_diff/Cargo.toml +++ b/tests/ui-cargo/cargo_rust_version/warn_both_diff/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/definition_in_module_root/fail_edge_cases/Cargo.toml b/tests/ui-cargo/definition_in_module_root/fail_edge_cases/Cargo.toml index 450812cfec26..a75102555df3 100644 --- a/tests/ui-cargo/definition_in_module_root/fail_edge_cases/Cargo.toml +++ b/tests/ui-cargo/definition_in_module_root/fail_edge_cases/Cargo.toml @@ -3,3 +3,5 @@ name = "fail-edge-cases" version = "0.1.0" edition = "2021" publish = false + +[workspace] diff --git a/tests/ui-cargo/definition_in_module_root/fail_mod/Cargo.toml b/tests/ui-cargo/definition_in_module_root/fail_mod/Cargo.toml index 575ff58cadec..2efe478e9239 100644 --- a/tests/ui-cargo/definition_in_module_root/fail_mod/Cargo.toml +++ b/tests/ui-cargo/definition_in_module_root/fail_mod/Cargo.toml @@ -3,3 +3,5 @@ name = "fail-mod" version = "0.1.0" edition = "2021" publish = false + +[workspace] diff --git a/tests/ui-cargo/definition_in_module_root/fail_path_attr/Cargo.toml b/tests/ui-cargo/definition_in_module_root/fail_path_attr/Cargo.toml index 3f57a420e2f6..81db76c4a0c5 100644 --- a/tests/ui-cargo/definition_in_module_root/fail_path_attr/Cargo.toml +++ b/tests/ui-cargo/definition_in_module_root/fail_path_attr/Cargo.toml @@ -3,3 +3,5 @@ name = "fail-path-attr" version = "0.1.0" edition = "2021" publish = false + +[workspace] diff --git a/tests/ui-cargo/definition_in_module_root/pass_bin/Cargo.toml b/tests/ui-cargo/definition_in_module_root/pass_bin/Cargo.toml index 757e4f2068c1..cf7e49f2c6a1 100644 --- a/tests/ui-cargo/definition_in_module_root/pass_bin/Cargo.toml +++ b/tests/ui-cargo/definition_in_module_root/pass_bin/Cargo.toml @@ -3,3 +3,5 @@ name = "pass-bin" version = "0.1.0" edition = "2021" publish = false + +[workspace] diff --git a/tests/ui-cargo/definition_in_module_root/pass_lib_with_definitions/Cargo.toml b/tests/ui-cargo/definition_in_module_root/pass_lib_with_definitions/Cargo.toml index 49d81d648aa2..00656d4cfa45 100644 --- a/tests/ui-cargo/definition_in_module_root/pass_lib_with_definitions/Cargo.toml +++ b/tests/ui-cargo/definition_in_module_root/pass_lib_with_definitions/Cargo.toml @@ -3,3 +3,5 @@ name = "pass-lib-with-definitions" version = "0.1.0" edition = "2021" publish = false + +[workspace] diff --git a/tests/ui-cargo/definition_in_module_root/pass_path_attr/Cargo.toml b/tests/ui-cargo/definition_in_module_root/pass_path_attr/Cargo.toml index d1ab114ffa85..073b961896d1 100644 --- a/tests/ui-cargo/definition_in_module_root/pass_path_attr/Cargo.toml +++ b/tests/ui-cargo/definition_in_module_root/pass_path_attr/Cargo.toml @@ -3,3 +3,5 @@ name = "pass-path-attr" version = "0.1.0" edition = "2021" publish = false + +[workspace] diff --git a/tests/ui-cargo/duplicate_mod/fail/Cargo.toml b/tests/ui-cargo/duplicate_mod/fail/Cargo.toml index bf3c817de1c4..cc966cc88b86 100644 --- a/tests/ui-cargo/duplicate_mod/fail/Cargo.toml +++ b/tests/ui-cargo/duplicate_mod/fail/Cargo.toml @@ -3,3 +3,5 @@ name = "duplicate_mod" edition = "2021" publish = false version = "0.1.0" + +[workspace] diff --git a/tests/ui-cargo/lint_groups_priority/pass/Cargo.toml b/tests/ui-cargo/lint_groups_priority/pass/Cargo.toml index 979c915cf0c1..f500f9ceacb4 100644 --- a/tests/ui-cargo/lint_groups_priority/pass/Cargo.toml +++ b/tests/ui-cargo/lint_groups_priority/pass/Cargo.toml @@ -15,3 +15,5 @@ pedantic = { level = "warn", priority = -1 } style = { level = "warn", priority = 1 } similar_names = "allow" dbg_macro = { level = "warn", priority = 2 } + +[workspace] diff --git a/tests/ui-cargo/module_style/duplicated_mod_names_14697/Cargo.toml b/tests/ui-cargo/module_style/duplicated_mod_names_14697/Cargo.toml index 569082f2f659..18f249648c32 100644 --- a/tests/ui-cargo/module_style/duplicated_mod_names_14697/Cargo.toml +++ b/tests/ui-cargo/module_style/duplicated_mod_names_14697/Cargo.toml @@ -9,3 +9,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/module_style/fail_mod/Cargo.toml b/tests/ui-cargo/module_style/fail_mod/Cargo.toml index b3d36a9fb645..f38d40443195 100644 --- a/tests/ui-cargo/module_style/fail_mod/Cargo.toml +++ b/tests/ui-cargo/module_style/fail_mod/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/module_style/fail_mod_remap/Cargo.toml b/tests/ui-cargo/module_style/fail_mod_remap/Cargo.toml index a822fad388f5..d0e934ba77ee 100644 --- a/tests/ui-cargo/module_style/fail_mod_remap/Cargo.toml +++ b/tests/ui-cargo/module_style/fail_mod_remap/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/module_style/fail_no_mod/Cargo.toml b/tests/ui-cargo/module_style/fail_no_mod/Cargo.toml index 3610d13c1f30..d4b766933891 100644 --- a/tests/ui-cargo/module_style/fail_no_mod/Cargo.toml +++ b/tests/ui-cargo/module_style/fail_no_mod/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/module_style/inline_mod/Cargo.toml b/tests/ui-cargo/module_style/inline_mod/Cargo.toml index 4108d8aaa5c0..938aaaeb0bfc 100644 --- a/tests/ui-cargo/module_style/inline_mod/Cargo.toml +++ b/tests/ui-cargo/module_style/inline_mod/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/module_style/pass_mod/Cargo.toml b/tests/ui-cargo/module_style/pass_mod/Cargo.toml index 1c2991695bc0..a9dc8772084b 100644 --- a/tests/ui-cargo/module_style/pass_mod/Cargo.toml +++ b/tests/ui-cargo/module_style/pass_mod/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/module_style/pass_no_mod/Cargo.toml b/tests/ui-cargo/module_style/pass_no_mod/Cargo.toml index 4180aaf5185c..dabdf253a3bf 100644 --- a/tests/ui-cargo/module_style/pass_no_mod/Cargo.toml +++ b/tests/ui-cargo/module_style/pass_no_mod/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/module_style/segment_with_mod_name_10271_11916/Cargo.toml b/tests/ui-cargo/module_style/segment_with_mod_name_10271_11916/Cargo.toml index 5c2fabd2283d..492ad3b4460c 100644 --- a/tests/ui-cargo/module_style/segment_with_mod_name_10271_11916/Cargo.toml +++ b/tests/ui-cargo/module_style/segment_with_mod_name_10271_11916/Cargo.toml @@ -7,4 +7,4 @@ edition = "2024" publish = false [workspace] -members = ["foo/bar"] \ No newline at end of file +members = ["foo/bar"] diff --git a/tests/ui-cargo/module_style/with_path_attr_mod/Cargo.toml b/tests/ui-cargo/module_style/with_path_attr_mod/Cargo.toml index d867377545e1..c684e8c2a233 100644 --- a/tests/ui-cargo/module_style/with_path_attr_mod/Cargo.toml +++ b/tests/ui-cargo/module_style/with_path_attr_mod/Cargo.toml @@ -1,4 +1,4 @@ -# Should not lint mod tagged with `#[path = ...]` +# Should not lint mod tagged with `#[path = ...]` [package] name = "with-path-attr-mod" version = "0.1.0" @@ -8,3 +8,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/module_style/with_path_attr_no_mod/Cargo.toml b/tests/ui-cargo/module_style/with_path_attr_no_mod/Cargo.toml index ddf2ac394cdd..f8aaf187ebb0 100644 --- a/tests/ui-cargo/module_style/with_path_attr_no_mod/Cargo.toml +++ b/tests/ui-cargo/module_style/with_path_attr_no_mod/Cargo.toml @@ -1,4 +1,4 @@ -# Should not lint mod tagged with `#[path = ...]` +# Should not lint mod tagged with `#[path = ...]` [package] name = "with-path-attr-no-mod" version = "0.1.0" @@ -8,3 +8,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/multiple_config_files/no_warn/Cargo.toml b/tests/ui-cargo/multiple_config_files/no_warn/Cargo.toml index 7eb56cc4e9d9..06c7a85b2083 100644 --- a/tests/ui-cargo/multiple_config_files/no_warn/Cargo.toml +++ b/tests/ui-cargo/multiple_config_files/no_warn/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/multiple_config_files/warn/Cargo.toml b/tests/ui-cargo/multiple_config_files/warn/Cargo.toml index b4847d070aab..0b00455ba613 100644 --- a/tests/ui-cargo/multiple_config_files/warn/Cargo.toml +++ b/tests/ui-cargo/multiple_config_files/warn/Cargo.toml @@ -7,3 +7,5 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[workspace] diff --git a/tests/ui-cargo/multiple_inherent_impl/config_fail/Cargo.toml b/tests/ui-cargo/multiple_inherent_impl/config_fail/Cargo.toml index 0a4cb6e368f6..bb4be3939aa8 100644 --- a/tests/ui-cargo/multiple_inherent_impl/config_fail/Cargo.toml +++ b/tests/ui-cargo/multiple_inherent_impl/config_fail/Cargo.toml @@ -5,3 +5,5 @@ edition = "2024" publish = false [dependencies] + +[workspace] diff --git a/tests/ui-cargo/multiple_inherent_impl/crate_fail/Cargo.toml b/tests/ui-cargo/multiple_inherent_impl/crate_fail/Cargo.toml index a280da1bd896..de95dd68a3ec 100644 --- a/tests/ui-cargo/multiple_inherent_impl/crate_fail/Cargo.toml +++ b/tests/ui-cargo/multiple_inherent_impl/crate_fail/Cargo.toml @@ -5,3 +5,5 @@ edition = "2024" publish = false [dependencies] + +[workspace] diff --git a/tests/ui-cargo/multiple_inherent_impl/file_fail/Cargo.toml b/tests/ui-cargo/multiple_inherent_impl/file_fail/Cargo.toml index 7f767c65b98c..1e939d842066 100644 --- a/tests/ui-cargo/multiple_inherent_impl/file_fail/Cargo.toml +++ b/tests/ui-cargo/multiple_inherent_impl/file_fail/Cargo.toml @@ -5,3 +5,5 @@ edition = "2024" publish = false [dependencies] + +[workspace] diff --git a/tests/ui-cargo/multiple_inherent_impl/module_fail/Cargo.toml b/tests/ui-cargo/multiple_inherent_impl/module_fail/Cargo.toml index 4b57af0d8fef..b0ca5e1fd83d 100644 --- a/tests/ui-cargo/multiple_inherent_impl/module_fail/Cargo.toml +++ b/tests/ui-cargo/multiple_inherent_impl/module_fail/Cargo.toml @@ -5,3 +5,5 @@ edition = "2024" publish = false [dependencies] + +[workspace] diff --git a/tests/ui-cargo/undocumented_unsafe_blocks/fail/Cargo.toml b/tests/ui-cargo/undocumented_unsafe_blocks/fail/Cargo.toml index 36bb3472df07..7835a87a0eb6 100644 --- a/tests/ui-cargo/undocumented_unsafe_blocks/fail/Cargo.toml +++ b/tests/ui-cargo/undocumented_unsafe_blocks/fail/Cargo.toml @@ -1,4 +1,4 @@ -# Reproducing #14553 requires the `# Safety` comment to be in the first line of +# Reproducing #14553 requires the `# Safety` comment to be in the first line of # the file. Since `unnecessary_safety_comment` is not enabled by default, we # will set it up here. @@ -10,3 +10,5 @@ version = "0.1.0" [lints.clippy] unnecessary_safety_comment = "deny" + +[workspace]