diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod')
4 files changed, 28 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/Cargo.toml b/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/Cargo.toml new file mode 100644 index 000000000..3610d13c1 --- /dev/null +++ b/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "fail-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/ui-cargo/module_style/fail_no_mod/src/bad/mod.rs b/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/src/bad/mod.rs new file mode 100644 index 000000000..f19ab10d5 --- /dev/null +++ b/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/src/bad/mod.rs @@ -0,0 +1 @@ +pub struct Thing; diff --git a/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/src/main.rs b/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/src/main.rs new file mode 100644 index 000000000..c6e9045b8 --- /dev/null +++ b/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/src/main.rs @@ -0,0 +1,7 @@ +#![warn(clippy::mod_module_files)] + +mod bad; + +fn main() { + let _ = bad::Thing; +} diff --git a/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/src/main.stderr b/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/src/main.stderr new file mode 100644 index 000000000..f91940209 --- /dev/null +++ b/src/tools/clippy/tests/ui-cargo/module_style/fail_no_mod/src/main.stderr @@ -0,0 +1,11 @@ +error: `mod.rs` files are not allowed, found `bad/mod.rs` + --> $DIR/bad/mod.rs:1:1 + | +LL | pub struct Thing; + | ^ + | + = note: `-D clippy::mod-module-files` implied by `-D warnings` + = help: move `bad/mod.rs` to `bad.rs` + +error: aborting due to previous error + |