summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/open_options.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /src/tools/clippy/tests/ui/open_options.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/open_options.rs')
-rw-r--r--src/tools/clippy/tests/ui/open_options.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/open_options.rs b/src/tools/clippy/tests/ui/open_options.rs
index 9063fafbc..0cdc5bf2b 100644
--- a/src/tools/clippy/tests/ui/open_options.rs
+++ b/src/tools/clippy/tests/ui/open_options.rs
@@ -4,11 +4,19 @@ use std::fs::OpenOptions;
#[warn(clippy::nonsensical_open_options)]
fn main() {
OpenOptions::new().read(true).truncate(true).open("foo.txt");
+ //~^ ERROR: file opened with `truncate` and `read`
+ //~| NOTE: `-D clippy::nonsensical-open-options` implied by `-D warnings`
OpenOptions::new().append(true).truncate(true).open("foo.txt");
+ //~^ ERROR: file opened with `append` and `truncate`
OpenOptions::new().read(true).read(false).open("foo.txt");
+ //~^ ERROR: the method `read` is called more than once
OpenOptions::new().create(true).create(false).open("foo.txt");
+ //~^ ERROR: the method `create` is called more than once
OpenOptions::new().write(true).write(false).open("foo.txt");
+ //~^ ERROR: the method `write` is called more than once
OpenOptions::new().append(true).append(false).open("foo.txt");
+ //~^ ERROR: the method `append` is called more than once
OpenOptions::new().truncate(true).truncate(false).open("foo.txt");
+ //~^ ERROR: the method `truncate` is called more than once
}