1 error: file opened with `truncate` and `read`
2 --> $DIR/open_options.rs:6:5
4 LL | OpenOptions::new().read(true).truncate(true).open("foo.txt");
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 = note: `-D clippy::nonsensical-open-options` implied by `-D warnings`
9 error: file opened with `append` and `truncate`
10 --> $DIR/open_options.rs:7:5
12 LL | OpenOptions::new().append(true).truncate(true).open("foo.txt");
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 error: the method `read` is called more than once
16 --> $DIR/open_options.rs:9:5
18 LL | OpenOptions::new().read(true).read(false).open("foo.txt");
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 error: the method `create` is called more than once
22 --> $DIR/open_options.rs:10:5
24 LL | OpenOptions::new().create(true).create(false).open("foo.txt");
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27 error: the method `write` is called more than once
28 --> $DIR/open_options.rs:11:5
30 LL | OpenOptions::new().write(true).write(false).open("foo.txt");
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33 error: the method `append` is called more than once
34 --> $DIR/open_options.rs:12:5
36 LL | OpenOptions::new().append(true).append(false).open("foo.txt");
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 error: the method `truncate` is called more than once
40 --> $DIR/open_options.rs:13:5
42 LL | OpenOptions::new().truncate(true).truncate(false).open("foo.txt");
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 error: aborting due to 7 previous errors