Skip to content

Commit 0b24295

Browse files
committed
Update stderr files
1 parent 39917a0 commit 0b24295

10 files changed

+58
-56
lines changed

tests/ui/doc_errors.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: docs for function returning `Result` missing `# Errors` section
2-
--> $DIR/doc_errors.rs:7:1
2+
--> $DIR/doc_errors.rs:8:1
33
|
44
LL | / pub fn pub_fn_missing_errors_header() -> Result<(), ()> {
55
LL | | unimplemented!();
@@ -9,47 +9,47 @@ LL | | }
99
= note: `-D clippy::missing-errors-doc` implied by `-D warnings`
1010

1111
error: docs for function returning `Result` missing `# Errors` section
12-
--> $DIR/doc_errors.rs:11:1
12+
--> $DIR/doc_errors.rs:12:1
1313
|
1414
LL | / pub async fn async_pub_fn_missing_errors_header() -> Result<(), ()> {
1515
LL | | unimplemented!();
1616
LL | | }
1717
| |_^
1818

1919
error: docs for function returning `Result` missing `# Errors` section
20-
--> $DIR/doc_errors.rs:16:1
20+
--> $DIR/doc_errors.rs:17:1
2121
|
2222
LL | / pub fn pub_fn_returning_io_result() -> io::Result<()> {
2323
LL | | unimplemented!();
2424
LL | | }
2525
| |_^
2626

2727
error: docs for function returning `Result` missing `# Errors` section
28-
--> $DIR/doc_errors.rs:21:1
28+
--> $DIR/doc_errors.rs:22:1
2929
|
3030
LL | / pub async fn async_pub_fn_returning_io_result() -> io::Result<()> {
3131
LL | | unimplemented!();
3232
LL | | }
3333
| |_^
3434

3535
error: docs for function returning `Result` missing `# Errors` section
36-
--> $DIR/doc_errors.rs:51:5
36+
--> $DIR/doc_errors.rs:52:5
3737
|
3838
LL | / pub fn pub_method_missing_errors_header() -> Result<(), ()> {
3939
LL | | unimplemented!();
4040
LL | | }
4141
| |_____^
4242

4343
error: docs for function returning `Result` missing `# Errors` section
44-
--> $DIR/doc_errors.rs:56:5
44+
--> $DIR/doc_errors.rs:57:5
4545
|
4646
LL | / pub async fn async_pub_method_missing_errors_header() -> Result<(), ()> {
4747
LL | | unimplemented!();
4848
LL | | }
4949
| |_____^
5050

5151
error: docs for function returning `Result` missing `# Errors` section
52-
--> $DIR/doc_errors.rs:85:5
52+
--> $DIR/doc_errors.rs:86:5
5353
|
5454
LL | fn trait_method_missing_errors_header() -> Result<(), ()>;
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/drop_ref.stderr

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,108 @@
11
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
2-
--> $DIR/drop_ref.rs:10:5
2+
--> $DIR/drop_ref.rs:11:5
33
|
44
LL | drop(&SomeStruct);
55
| ^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::drop-ref` implied by `-D warnings`
88
note: argument has type `&SomeStruct`
9-
--> $DIR/drop_ref.rs:10:10
9+
--> $DIR/drop_ref.rs:11:10
1010
|
1111
LL | drop(&SomeStruct);
1212
| ^^^^^^^^^^^
1313

1414
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
15-
--> $DIR/drop_ref.rs:13:5
15+
--> $DIR/drop_ref.rs:14:5
1616
|
1717
LL | drop(&owned1);
1818
| ^^^^^^^^^^^^^
1919
|
2020
note: argument has type `&SomeStruct`
21-
--> $DIR/drop_ref.rs:13:10
21+
--> $DIR/drop_ref.rs:14:10
2222
|
2323
LL | drop(&owned1);
2424
| ^^^^^^^
2525

2626
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
27-
--> $DIR/drop_ref.rs:14:5
27+
--> $DIR/drop_ref.rs:15:5
2828
|
2929
LL | drop(&&owned1);
3030
| ^^^^^^^^^^^^^^
3131
|
3232
note: argument has type `&&SomeStruct`
33-
--> $DIR/drop_ref.rs:14:10
33+
--> $DIR/drop_ref.rs:15:10
3434
|
3535
LL | drop(&&owned1);
3636
| ^^^^^^^^
3737

3838
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
39-
--> $DIR/drop_ref.rs:15:5
39+
--> $DIR/drop_ref.rs:16:5
4040
|
4141
LL | drop(&mut owned1);
4242
| ^^^^^^^^^^^^^^^^^
4343
|
4444
note: argument has type `&mut SomeStruct`
45-
--> $DIR/drop_ref.rs:15:10
45+
--> $DIR/drop_ref.rs:16:10
4646
|
4747
LL | drop(&mut owned1);
4848
| ^^^^^^^^^^^
4949

5050
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
51-
--> $DIR/drop_ref.rs:19:5
51+
--> $DIR/drop_ref.rs:20:5
5252
|
5353
LL | drop(reference1);
5454
| ^^^^^^^^^^^^^^^^
5555
|
5656
note: argument has type `&SomeStruct`
57-
--> $DIR/drop_ref.rs:19:10
57+
--> $DIR/drop_ref.rs:20:10
5858
|
5959
LL | drop(reference1);
6060
| ^^^^^^^^^^
6161

6262
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
63-
--> $DIR/drop_ref.rs:22:5
63+
--> $DIR/drop_ref.rs:23:5
6464
|
6565
LL | drop(reference2);
6666
| ^^^^^^^^^^^^^^^^
6767
|
6868
note: argument has type `&mut SomeStruct`
69-
--> $DIR/drop_ref.rs:22:10
69+
--> $DIR/drop_ref.rs:23:10
7070
|
7171
LL | drop(reference2);
7272
| ^^^^^^^^^^
7373

7474
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
75-
--> $DIR/drop_ref.rs:25:5
75+
--> $DIR/drop_ref.rs:26:5
7676
|
7777
LL | drop(reference3);
7878
| ^^^^^^^^^^^^^^^^
7979
|
8080
note: argument has type `&SomeStruct`
81-
--> $DIR/drop_ref.rs:25:10
81+
--> $DIR/drop_ref.rs:26:10
8282
|
8383
LL | drop(reference3);
8484
| ^^^^^^^^^^
8585

8686
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
87-
--> $DIR/drop_ref.rs:30:5
87+
--> $DIR/drop_ref.rs:31:5
8888
|
8989
LL | drop(&val);
9090
| ^^^^^^^^^^
9191
|
9292
note: argument has type `&T`
93-
--> $DIR/drop_ref.rs:30:10
93+
--> $DIR/drop_ref.rs:31:10
9494
|
9595
LL | drop(&val);
9696
| ^^^^
9797

9898
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
99-
--> $DIR/drop_ref.rs:38:5
99+
--> $DIR/drop_ref.rs:39:5
100100
|
101101
LL | std::mem::drop(&SomeStruct);
102102
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
103103
|
104104
note: argument has type `&SomeStruct`
105-
--> $DIR/drop_ref.rs:38:20
105+
--> $DIR/drop_ref.rs:39:20
106106
|
107107
LL | std::mem::drop(&SomeStruct);
108108
| ^^^^^^^^^^^

tests/ui/manual_unwrap_or.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
#![allow(dead_code)]
3-
#![allow(unused_variables)]
3+
#![allow(unused_variables, clippy::unnecessary_wrap)]
44

55
fn option_unwrap_or() {
66
// int case

tests/ui/manual_unwrap_or.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
#![allow(dead_code)]
3-
#![allow(unused_variables)]
3+
#![allow(unused_variables, clippy::unnecessary_wrap)]
44

55
fn option_unwrap_or() {
66
// int case

tests/ui/map_err.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::map_err_ignore)]
2+
#![allow(clippy::unnecessary_wrap)]
23
use std::convert::TryFrom;
34
use std::error::Error;
45
use std::fmt;

tests/ui/map_err.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `map_err(|_|...` ignores the original error
2-
--> $DIR/map_err.rs:22:32
2+
--> $DIR/map_err.rs:23:32
33
|
44
LL | println!("{:?}", x.map_err(|_| Errors::Ignored));
55
| ^^^

tests/ui/or_fun_call.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,31 +61,31 @@ LL | without_default.unwrap_or(Foo::new());
6161
| ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(Foo::new)`
6262

6363
error: use of `or_insert` followed by a function call
64-
--> $DIR/or_fun_call.rs:62:19
64+
--> $DIR/or_fun_call.rs:63:19
6565
|
6666
LL | map.entry(42).or_insert(String::new());
6767
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
6868

6969
error: use of `or_insert` followed by a function call
70-
--> $DIR/or_fun_call.rs:65:21
70+
--> $DIR/or_fun_call.rs:66:21
7171
|
7272
LL | btree.entry(42).or_insert(String::new());
7373
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
7474

7575
error: use of `unwrap_or` followed by a function call
76-
--> $DIR/or_fun_call.rs:68:21
76+
--> $DIR/or_fun_call.rs:69:21
7777
|
7878
LL | let _ = stringy.unwrap_or("".to_owned());
7979
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`
8080

8181
error: use of `or` followed by a function call
82-
--> $DIR/or_fun_call.rs:93:35
82+
--> $DIR/or_fun_call.rs:94:35
8383
|
8484
LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
8585
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))`
8686

8787
error: use of `or` followed by a function call
88-
--> $DIR/or_fun_call.rs:97:10
88+
--> $DIR/or_fun_call.rs:98:10
8989
|
9090
LL | .or(Some(Bar(b, Duration::from_secs(2))));
9191
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some(Bar(b, Duration::from_secs(2))))`

tests/ui/redundant_pattern_matching.stderr

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ LL | if let Err(_) = Err::<i32, i32>(42) {}
1919
| -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
2020

2121
error: redundant pattern matching, consider using `is_ok()`
22-
--> $DIR/redundant_pattern_matching.rs:21:15
22+
--> $DIR/redundant_pattern_matching.rs:22:15
2323
|
2424
LL | while let Ok(_) = Ok::<i32, i32>(10) {}
2525
| ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
2626

2727
error: redundant pattern matching, consider using `is_err()`
28-
--> $DIR/redundant_pattern_matching.rs:23:15
28+
--> $DIR/redundant_pattern_matching.rs:24:15
2929
|
3030
LL | while let Err(_) = Ok::<i32, i32>(10) {}
3131
| ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
3232

3333
error: redundant pattern matching, consider using `is_ok()`
34-
--> $DIR/redundant_pattern_matching.rs:33:5
34+
--> $DIR/redundant_pattern_matching.rs:34:5
3535
|
3636
LL | / match Ok::<i32, i32>(42) {
3737
LL | | Ok(_) => true,
@@ -40,7 +40,7 @@ LL | | };
4040
| |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
4141

4242
error: redundant pattern matching, consider using `is_err()`
43-
--> $DIR/redundant_pattern_matching.rs:38:5
43+
--> $DIR/redundant_pattern_matching.rs:39:5
4444
|
4545
LL | / match Ok::<i32, i32>(42) {
4646
LL | | Ok(_) => false,
@@ -49,7 +49,7 @@ LL | | };
4949
| |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
5050

5151
error: redundant pattern matching, consider using `is_err()`
52-
--> $DIR/redundant_pattern_matching.rs:43:5
52+
--> $DIR/redundant_pattern_matching.rs:44:5
5353
|
5454
LL | / match Err::<i32, i32>(42) {
5555
LL | | Ok(_) => false,
@@ -58,7 +58,7 @@ LL | | };
5858
| |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
5959

6060
error: redundant pattern matching, consider using `is_ok()`
61-
--> $DIR/redundant_pattern_matching.rs:48:5
61+
--> $DIR/redundant_pattern_matching.rs:49:5
6262
|
6363
LL | / match Err::<i32, i32>(42) {
6464
LL | | Ok(_) => true,
@@ -67,73 +67,73 @@ LL | | };
6767
| |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
6868

6969
error: redundant pattern matching, consider using `is_ok()`
70-
--> $DIR/redundant_pattern_matching.rs:53:20
70+
--> $DIR/redundant_pattern_matching.rs:54:20
7171
|
7272
LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
7373
| -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
7474

7575
error: redundant pattern matching, consider using `is_ok()`
76-
--> $DIR/redundant_pattern_matching.rs:59:20
76+
--> $DIR/redundant_pattern_matching.rs:60:20
7777
|
7878
LL | let _ = if let Ok(_) = gen_res() {
7979
| -------^^^^^------------ help: try this: `if gen_res().is_ok()`
8080

8181
error: redundant pattern matching, consider using `is_err()`
82-
--> $DIR/redundant_pattern_matching.rs:61:19
82+
--> $DIR/redundant_pattern_matching.rs:62:19
8383
|
8484
LL | } else if let Err(_) = gen_res() {
8585
| -------^^^^^^------------ help: try this: `if gen_res().is_err()`
8686

8787
error: redundant pattern matching, consider using `is_some()`
88-
--> $DIR/redundant_pattern_matching.rs:84:19
88+
--> $DIR/redundant_pattern_matching.rs:85:19
8989
|
9090
LL | while let Some(_) = r#try!(result_opt()) {}
9191
| ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
9292

9393
error: redundant pattern matching, consider using `is_some()`
94-
--> $DIR/redundant_pattern_matching.rs:85:16
94+
--> $DIR/redundant_pattern_matching.rs:86:16
9595
|
9696
LL | if let Some(_) = r#try!(result_opt()) {}
9797
| -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
9898

9999
error: redundant pattern matching, consider using `is_some()`
100-
--> $DIR/redundant_pattern_matching.rs:91:12
100+
--> $DIR/redundant_pattern_matching.rs:92:12
101101
|
102102
LL | if let Some(_) = m!() {}
103103
| -------^^^^^^^------- help: try this: `if m!().is_some()`
104104

105105
error: redundant pattern matching, consider using `is_some()`
106-
--> $DIR/redundant_pattern_matching.rs:92:15
106+
--> $DIR/redundant_pattern_matching.rs:93:15
107107
|
108108
LL | while let Some(_) = m!() {}
109109
| ----------^^^^^^^------- help: try this: `while m!().is_some()`
110110

111111
error: redundant pattern matching, consider using `is_ok()`
112-
--> $DIR/redundant_pattern_matching.rs:110:12
112+
--> $DIR/redundant_pattern_matching.rs:111:12
113113
|
114114
LL | if let Ok(_) = Ok::<i32, i32>(42) {}
115115
| -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
116116

117117
error: redundant pattern matching, consider using `is_err()`
118-
--> $DIR/redundant_pattern_matching.rs:112:12
118+
--> $DIR/redundant_pattern_matching.rs:113:12
119119
|
120120
LL | if let Err(_) = Err::<i32, i32>(42) {}
121121
| -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
122122

123123
error: redundant pattern matching, consider using `is_ok()`
124-
--> $DIR/redundant_pattern_matching.rs:114:15
124+
--> $DIR/redundant_pattern_matching.rs:115:15
125125
|
126126
LL | while let Ok(_) = Ok::<i32, i32>(10) {}
127127
| ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
128128

129129
error: redundant pattern matching, consider using `is_err()`
130-
--> $DIR/redundant_pattern_matching.rs:116:15
130+
--> $DIR/redundant_pattern_matching.rs:117:15
131131
|
132132
LL | while let Err(_) = Ok::<i32, i32>(10) {}
133133
| ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
134134

135135
error: redundant pattern matching, consider using `is_ok()`
136-
--> $DIR/redundant_pattern_matching.rs:118:5
136+
--> $DIR/redundant_pattern_matching.rs:119:5
137137
|
138138
LL | / match Ok::<i32, i32>(42) {
139139
LL | | Ok(_) => true,
@@ -142,7 +142,7 @@ LL | | };
142142
| |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
143143

144144
error: redundant pattern matching, consider using `is_err()`
145-
--> $DIR/redundant_pattern_matching.rs:123:5
145+
--> $DIR/redundant_pattern_matching.rs:124:5
146146
|
147147
LL | / match Err::<i32, i32>(42) {
148148
LL | | Ok(_) => false,

0 commit comments

Comments
 (0)