]> git.lizzy.rs Git - rust.git/blob - tests/ui/open_options.stderr
rustup and compile-fail -> ui test move
[rust.git] / tests / ui / open_options.stderr
1 error: file opened with "truncate" and "read"
2  --> $DIR/open_options.rs:8:5
3   |
4 8 |     OpenOptions::new().read(true).truncate(true).open("foo.txt"); //~ERROR file opened with "truncate" and "read"
5   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6   |
7 note: lint level defined here
8  --> $DIR/open_options.rs:6:8
9   |
10 6 | #[deny(nonsensical_open_options)]
11   |        ^^^^^^^^^^^^^^^^^^^^^^^^
12
13 error: file opened with "append" and "truncate"
14  --> $DIR/open_options.rs:9:5
15   |
16 9 |     OpenOptions::new().append(true).truncate(true).open("foo.txt"); //~ERROR file opened with "append" and "truncate"
17   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
19 error: the method "read" is called more than once
20   --> $DIR/open_options.rs:11:5
21    |
22 11 |     OpenOptions::new().read(true).read(false).open("foo.txt"); //~ERROR the method "read" is called more than once
23    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
25 error: the method "create" is called more than once
26   --> $DIR/open_options.rs:12:5
27    |
28 12 |     OpenOptions::new().create(true).create(false).open("foo.txt"); //~ERROR the method "create" is called more than once
29    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
31 error: the method "write" is called more than once
32   --> $DIR/open_options.rs:13:5
33    |
34 13 |     OpenOptions::new().write(true).write(false).open("foo.txt"); //~ERROR the method "write" is called more than once
35    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36
37 error: the method "append" is called more than once
38   --> $DIR/open_options.rs:14:5
39    |
40 14 |     OpenOptions::new().append(true).append(false).open("foo.txt"); //~ERROR the method "append" is called more than once
41    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42
43 error: the method "truncate" is called more than once
44   --> $DIR/open_options.rs:15:5
45    |
46 15 |     OpenOptions::new().truncate(true).truncate(false).open("foo.txt"); //~ERROR the method "truncate" is called more than once
47    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48
49 error: aborting due to 7 previous errors
50