From dc0db358abe19481e475e10c32149b53370f1a1c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:57:31 +0200 Subject: Merging upstream version 1.72.1+dfsg1. Signed-off-by: Daniel Baumann --- src/tools/clippy/tests/workspace_test/Cargo.toml | 2 +- .../module_style/pass_mod_with_dep_in_subdir/Cargo.toml | 10 ++++++++++ .../pass_mod_with_dep_in_subdir/dep_no_mod/Cargo.toml | 9 +++++++++ .../pass_mod_with_dep_in_subdir/dep_no_mod/src/foo.rs | 2 ++ .../pass_mod_with_dep_in_subdir/dep_no_mod/src/foo/hello.rs | 1 + .../pass_mod_with_dep_in_subdir/dep_no_mod/src/lib.rs | 5 +++++ .../module_style/pass_mod_with_dep_in_subdir/src/bad/mod.rs | 1 + .../module_style/pass_mod_with_dep_in_subdir/src/main.rs | 13 +++++++++++++ .../pass_mod_with_dep_in_subdir/src/more/foo.rs | 1 + .../pass_mod_with_dep_in_subdir/src/more/inner/mod.rs | 1 + .../pass_mod_with_dep_in_subdir/src/more/mod.rs | 2 ++ .../module_style/pass_no_mod_with_dep_in_subdir/Cargo.toml | 10 ++++++++++ .../pass_no_mod_with_dep_in_subdir/dep_with_mod/Cargo.toml | 9 +++++++++ .../pass_no_mod_with_dep_in_subdir/dep_with_mod/src/lib.rs | 7 +++++++ .../dep_with_mod/src/with_mod/inner.rs | 1 + .../dep_with_mod/src/with_mod/inner/stuff.rs | 3 +++ .../dep_with_mod/src/with_mod/inner/stuff/most.rs | 1 + .../dep_with_mod/src/with_mod/mod.rs | 3 +++ .../module_style/pass_no_mod_with_dep_in_subdir/src/good.rs | 1 + .../module_style/pass_no_mod_with_dep_in_subdir/src/main.rs | 9 +++++++++ 20 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/Cargo.toml create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/Cargo.toml create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/foo.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/foo/hello.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/lib.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/bad/mod.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/main.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/foo.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/inner/mod.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/mod.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/Cargo.toml create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/Cargo.toml create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/lib.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner/stuff.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner/stuff/most.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/mod.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/src/good.rs create mode 100644 src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/src/main.rs (limited to 'src/tools/clippy/tests/workspace_test') diff --git a/src/tools/clippy/tests/workspace_test/Cargo.toml b/src/tools/clippy/tests/workspace_test/Cargo.toml index bf5b4ca52..d24b278cc 100644 --- a/src/tools/clippy/tests/workspace_test/Cargo.toml +++ b/src/tools/clippy/tests/workspace_test/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" edition = "2018" [workspace] -members = ["subcrate"] +members = ["subcrate", "module_style/pass_no_mod_with_dep_in_subdir", "module_style/pass_mod_with_dep_in_subdir"] diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/Cargo.toml b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/Cargo.toml new file mode 100644 index 000000000..15dcde4e3 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "pass-mod-with-dep-in-subdir" +version = "0.1.0" +edition = "2018" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +dep-no-mod = { path = "dep_no_mod"} diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/Cargo.toml b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/Cargo.toml new file mode 100644 index 000000000..55569bc25 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "dep-no-mod" +version = "0.1.0" +edition = "2018" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/foo.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/foo.rs new file mode 100644 index 000000000..7b0966a45 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/foo.rs @@ -0,0 +1,2 @@ +pub mod hello; +pub struct Thing; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/foo/hello.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/foo/hello.rs new file mode 100644 index 000000000..99940dce5 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/foo/hello.rs @@ -0,0 +1 @@ +pub struct Hello; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/lib.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/lib.rs new file mode 100644 index 000000000..c62f9acbf --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/dep_no_mod/src/lib.rs @@ -0,0 +1,5 @@ +pub mod foo; + +pub fn foo() { + let _ = foo::Thing; +} diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/bad/mod.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/bad/mod.rs new file mode 100644 index 000000000..f19ab10d5 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/bad/mod.rs @@ -0,0 +1 @@ +pub struct Thing; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/main.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/main.rs new file mode 100644 index 000000000..5cb4795e9 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/main.rs @@ -0,0 +1,13 @@ +#![deny(clippy::self_named_module_files)] + +mod bad; +mod more; +extern crate dep_no_mod; + +fn main() { + let _ = bad::Thing; + let _ = more::foo::Foo; + let _ = more::inner::Inner; + let _ = dep_no_mod::foo::Thing; + let _ = dep_no_mod::foo::hello::Hello; +} diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/foo.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/foo.rs new file mode 100644 index 000000000..4a835673a --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/foo.rs @@ -0,0 +1 @@ +pub struct Foo; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/inner/mod.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/inner/mod.rs new file mode 100644 index 000000000..aa84f78cc --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/inner/mod.rs @@ -0,0 +1 @@ +pub struct Inner; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/mod.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/mod.rs new file mode 100644 index 000000000..d79569f78 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_mod_with_dep_in_subdir/src/more/mod.rs @@ -0,0 +1,2 @@ +pub mod foo; +pub mod inner; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/Cargo.toml b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/Cargo.toml new file mode 100644 index 000000000..060cb18dc --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "pass-no-mod-with-dep-in-subdir" +version = "0.1.0" +edition = "2018" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +dep-with-mod = { path = "dep_with_mod"} diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/Cargo.toml b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/Cargo.toml new file mode 100644 index 000000000..b25725cd5 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "dep-with-mod" +version = "0.1.0" +edition = "2018" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/lib.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/lib.rs new file mode 100644 index 000000000..4647424f2 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/lib.rs @@ -0,0 +1,7 @@ +pub mod with_mod; + +pub fn foo() { + let _ = with_mod::Thing; + let _ = with_mod::inner::stuff::Inner; + let _ = with_mod::inner::stuff::most::Snarks; +} diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner.rs new file mode 100644 index 000000000..91cd540a2 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner.rs @@ -0,0 +1 @@ +pub mod stuff; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner/stuff.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner/stuff.rs new file mode 100644 index 000000000..7713fa9d3 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner/stuff.rs @@ -0,0 +1,3 @@ +pub mod most; + +pub struct Inner; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner/stuff/most.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner/stuff/most.rs new file mode 100644 index 000000000..5a5eaf967 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/inner/stuff/most.rs @@ -0,0 +1 @@ +pub struct Snarks; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/mod.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/mod.rs new file mode 100644 index 000000000..a12734db7 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/dep_with_mod/src/with_mod/mod.rs @@ -0,0 +1,3 @@ +pub mod inner; + +pub struct Thing; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/src/good.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/src/good.rs new file mode 100644 index 000000000..f19ab10d5 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/src/good.rs @@ -0,0 +1 @@ +pub struct Thing; diff --git a/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/src/main.rs b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/src/main.rs new file mode 100644 index 000000000..42eb99cd7 --- /dev/null +++ b/src/tools/clippy/tests/workspace_test/module_style/pass_no_mod_with_dep_in_subdir/src/main.rs @@ -0,0 +1,9 @@ +#![deny(clippy::mod_module_files)] + +mod good; +pub use dep_with_mod::with_mod::Thing; + +fn main() { + let _ = good::Thing; + let _ = dep_with_mod::with_mod::Thing; +} -- cgit v1.2.3