1 error: file opened with "truncate" and "read"
2 --> open_options.rs:8:5
4 8 | OpenOptions::new().read(true).truncate(true).open("foo.txt");
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 = note: `-D nonsensical-open-options` implied by `-D warnings`
9 error: file opened with "append" and "truncate"
10 --> open_options.rs:9:5
12 9 | OpenOptions::new().append(true).truncate(true).open("foo.txt");
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 = note: `-D nonsensical-open-options` implied by `-D warnings`
17 error: the method "read" is called more than once
18 --> open_options.rs:11:5
20 11 | OpenOptions::new().read(true).read(false).open("foo.txt");
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 = note: `-D nonsensical-open-options` implied by `-D warnings`
25 error: the method "create" is called more than once
26 --> open_options.rs:12:5
28 12 | OpenOptions::new().create(true).create(false).open("foo.txt");
29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31 = note: `-D nonsensical-open-options` implied by `-D warnings`
33 error: the method "write" is called more than once
34 --> open_options.rs:13:5
36 13 | OpenOptions::new().write(true).write(false).open("foo.txt");
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 = note: `-D nonsensical-open-options` implied by `-D warnings`
41 error: the method "append" is called more than once
42 --> open_options.rs:14:5
44 14 | OpenOptions::new().append(true).append(false).open("foo.txt");
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47 = note: `-D nonsensical-open-options` implied by `-D warnings`
49 error: the method "truncate" is called more than once
50 --> open_options.rs:15:5
52 15 | OpenOptions::new().truncate(true).truncate(false).open("foo.txt");
53 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55 = note: `-D nonsensical-open-options` implied by `-D warnings`
57 error: aborting due to previous error(s)
60 To learn more, run the command again with --verbose.