Skip to content

Commit bc64bee

Browse files
Update ui tests
1 parent 401453a commit bc64bee

11 files changed

+104
-104
lines changed

tests/ui-internal/check_formulation.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: non-standard lint formulation
44
LL | /// Check for lint formulations that are correct
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= help: try using `Checks for` instead
7+
= help: consider using `Checks for`
88
= note: `-D clippy::almost-standard-lint-formulation` implied by `-D warnings`
99
= help: to override `-D warnings` add `#[allow(clippy::almost_standard_lint_formulation)]`
1010

tests/ui/join_absolute_paths.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ help: if this is unintentional, try removing the starting separator
1111
|
1212
LL | path.join("sh");
1313
| ~~~~
14-
help: if this is intentional, try using `Path::new` instead
14+
help: if this is intentional, consider using `Path::new`
1515
|
1616
LL | PathBuf::from("/sh");
1717
| ~~~~~~~~~~~~~~~~~~~~
@@ -27,7 +27,7 @@ help: if this is unintentional, try removing the starting separator
2727
|
2828
LL | path.join("\user");
2929
| ~~~~~~~
30-
help: if this is intentional, try using `Path::new` instead
30+
help: if this is intentional, consider using `Path::new`
3131
|
3232
LL | PathBuf::from("\\user");
3333
| ~~~~~~~~~~~~~~~~~~~~~~~
@@ -43,7 +43,7 @@ help: if this is unintentional, try removing the starting separator
4343
|
4444
LL | path.join("sh");
4545
| ~~~~
46-
help: if this is intentional, try using `Path::new` instead
46+
help: if this is intentional, consider using `Path::new`
4747
|
4848
LL | PathBuf::from("/sh");
4949
| ~~~~~~~~~~~~~~~~~~~~
@@ -59,7 +59,7 @@ help: if this is unintentional, try removing the starting separator
5959
|
6060
LL | path.join(r#"sh"#);
6161
| ~~~~~~~
62-
help: if this is intentional, try using `Path::new` instead
62+
help: if this is intentional, consider using `Path::new`
6363
|
6464
LL | PathBuf::from(r#"/sh"#);
6565
| ~~~~~~~~~~~~~~~~~~~~~~~

tests/ui/manual_ok_or.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ error: called `map_or(Err(_), Ok)` on an `Option` value
1717
--> $DIR/manual_ok_or.rs:14:5
1818
|
1919
LL | foo.map_or(Err("error"), Ok);
20-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `ok_or` instead: `foo.ok_or("error")`
20+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `ok_or`: `foo.ok_or("error")`
2121
|
2222
= note: `-D clippy::option-map-or-err-ok` implied by `-D warnings`
2323
= help: to override `-D warnings` add `#[allow(clippy::option_map_or_err_ok)]`

tests/ui/manual_saturating_arithmetic.stderr

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: manual saturating arithmetic
22
--> $DIR/manual_saturating_arithmetic.rs:6:13
33
|
44
LL | let _ = 1u32.checked_add(1).unwrap_or(u32::max_value());
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_add`: `1u32.saturating_add(1)`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `1u32.saturating_add(1)`
66
|
77
= note: `-D clippy::manual-saturating-arithmetic` implied by `-D warnings`
88
= help: to override `-D warnings` add `#[allow(clippy::manual_saturating_arithmetic)]`
@@ -11,13 +11,13 @@ error: manual saturating arithmetic
1111
--> $DIR/manual_saturating_arithmetic.rs:7:13
1212
|
1313
LL | let _ = 1u32.checked_add(1).unwrap_or(u32::MAX);
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_add`: `1u32.saturating_add(1)`
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `1u32.saturating_add(1)`
1515

1616
error: manual saturating arithmetic
1717
--> $DIR/manual_saturating_arithmetic.rs:8:13
1818
|
1919
LL | let _ = 1u8.checked_add(1).unwrap_or(255);
20-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_add`: `1u8.saturating_add(1)`
20+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `1u8.saturating_add(1)`
2121

2222
error: manual saturating arithmetic
2323
--> $DIR/manual_saturating_arithmetic.rs:9:13
@@ -26,49 +26,49 @@ LL | let _ = 1u128
2626
| _____________^
2727
LL | | .checked_add(1)
2828
LL | | .unwrap_or(340_282_366_920_938_463_463_374_607_431_768_211_455);
29-
| |_______________________________________________________________________^ help: try using `saturating_add`: `1u128.saturating_add(1)`
29+
| |_______________________________________________________________________^ help: consider using `saturating_add`: `1u128.saturating_add(1)`
3030

3131
error: manual saturating arithmetic
3232
--> $DIR/manual_saturating_arithmetic.rs:14:13
3333
|
3434
LL | let _ = 1u32.checked_mul(1).unwrap_or(u32::MAX);
35-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_mul`: `1u32.saturating_mul(1)`
35+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_mul`: `1u32.saturating_mul(1)`
3636

3737
error: manual saturating arithmetic
3838
--> $DIR/manual_saturating_arithmetic.rs:16:13
3939
|
4040
LL | let _ = 1u32.checked_sub(1).unwrap_or(u32::min_value());
41-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_sub`: `1u32.saturating_sub(1)`
41+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_sub`: `1u32.saturating_sub(1)`
4242

4343
error: manual saturating arithmetic
4444
--> $DIR/manual_saturating_arithmetic.rs:17:13
4545
|
4646
LL | let _ = 1u32.checked_sub(1).unwrap_or(u32::MIN);
47-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_sub`: `1u32.saturating_sub(1)`
47+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_sub`: `1u32.saturating_sub(1)`
4848

4949
error: manual saturating arithmetic
5050
--> $DIR/manual_saturating_arithmetic.rs:18:13
5151
|
5252
LL | let _ = 1u8.checked_sub(1).unwrap_or(0);
53-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_sub`: `1u8.saturating_sub(1)`
53+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_sub`: `1u8.saturating_sub(1)`
5454

5555
error: manual saturating arithmetic
5656
--> $DIR/manual_saturating_arithmetic.rs:22:13
5757
|
5858
LL | let _ = 1i32.checked_add(1).unwrap_or(i32::max_value());
59-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_add`: `1i32.saturating_add(1)`
59+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `1i32.saturating_add(1)`
6060

6161
error: manual saturating arithmetic
6262
--> $DIR/manual_saturating_arithmetic.rs:23:13
6363
|
6464
LL | let _ = 1i32.checked_add(1).unwrap_or(i32::MAX);
65-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_add`: `1i32.saturating_add(1)`
65+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `1i32.saturating_add(1)`
6666

6767
error: manual saturating arithmetic
6868
--> $DIR/manual_saturating_arithmetic.rs:24:13
6969
|
7070
LL | let _ = 1i8.checked_add(1).unwrap_or(127);
71-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_add`: `1i8.saturating_add(1)`
71+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `1i8.saturating_add(1)`
7272

7373
error: manual saturating arithmetic
7474
--> $DIR/manual_saturating_arithmetic.rs:25:13
@@ -77,25 +77,25 @@ LL | let _ = 1i128
7777
| _____________^
7878
LL | | .checked_add(1)
7979
LL | | .unwrap_or(170_141_183_460_469_231_731_687_303_715_884_105_727);
80-
| |_______________________________________________________________________^ help: try using `saturating_add`: `1i128.saturating_add(1)`
80+
| |_______________________________________________________________________^ help: consider using `saturating_add`: `1i128.saturating_add(1)`
8181

8282
error: manual saturating arithmetic
8383
--> $DIR/manual_saturating_arithmetic.rs:28:13
8484
|
8585
LL | let _ = 1i32.checked_add(-1).unwrap_or(i32::min_value());
86-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_add`: `1i32.saturating_add(-1)`
86+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `1i32.saturating_add(-1)`
8787

8888
error: manual saturating arithmetic
8989
--> $DIR/manual_saturating_arithmetic.rs:29:13
9090
|
9191
LL | let _ = 1i32.checked_add(-1).unwrap_or(i32::MIN);
92-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_add`: `1i32.saturating_add(-1)`
92+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `1i32.saturating_add(-1)`
9393

9494
error: manual saturating arithmetic
9595
--> $DIR/manual_saturating_arithmetic.rs:30:13
9696
|
9797
LL | let _ = 1i8.checked_add(-1).unwrap_or(-128);
98-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_add`: `1i8.saturating_add(-1)`
98+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `1i8.saturating_add(-1)`
9999

100100
error: manual saturating arithmetic
101101
--> $DIR/manual_saturating_arithmetic.rs:31:13
@@ -104,25 +104,25 @@ LL | let _ = 1i128
104104
| _____________^
105105
LL | | .checked_add(-1)
106106
LL | | .unwrap_or(-170_141_183_460_469_231_731_687_303_715_884_105_728);
107-
| |________________________________________________________________________^ help: try using `saturating_add`: `1i128.saturating_add(-1)`
107+
| |________________________________________________________________________^ help: consider using `saturating_add`: `1i128.saturating_add(-1)`
108108

109109
error: manual saturating arithmetic
110110
--> $DIR/manual_saturating_arithmetic.rs:38:13
111111
|
112112
LL | let _ = 1i32.checked_sub(1).unwrap_or(i32::min_value());
113-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_sub`: `1i32.saturating_sub(1)`
113+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_sub`: `1i32.saturating_sub(1)`
114114

115115
error: manual saturating arithmetic
116116
--> $DIR/manual_saturating_arithmetic.rs:39:13
117117
|
118118
LL | let _ = 1i32.checked_sub(1).unwrap_or(i32::MIN);
119-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_sub`: `1i32.saturating_sub(1)`
119+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_sub`: `1i32.saturating_sub(1)`
120120

121121
error: manual saturating arithmetic
122122
--> $DIR/manual_saturating_arithmetic.rs:40:13
123123
|
124124
LL | let _ = 1i8.checked_sub(1).unwrap_or(-128);
125-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_sub`: `1i8.saturating_sub(1)`
125+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_sub`: `1i8.saturating_sub(1)`
126126

127127
error: manual saturating arithmetic
128128
--> $DIR/manual_saturating_arithmetic.rs:41:13
@@ -131,25 +131,25 @@ LL | let _ = 1i128
131131
| _____________^
132132
LL | | .checked_sub(1)
133133
LL | | .unwrap_or(-170_141_183_460_469_231_731_687_303_715_884_105_728);
134-
| |________________________________________________________________________^ help: try using `saturating_sub`: `1i128.saturating_sub(1)`
134+
| |________________________________________________________________________^ help: consider using `saturating_sub`: `1i128.saturating_sub(1)`
135135

136136
error: manual saturating arithmetic
137137
--> $DIR/manual_saturating_arithmetic.rs:44:13
138138
|
139139
LL | let _ = 1i32.checked_sub(-1).unwrap_or(i32::max_value());
140-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_sub`: `1i32.saturating_sub(-1)`
140+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_sub`: `1i32.saturating_sub(-1)`
141141

142142
error: manual saturating arithmetic
143143
--> $DIR/manual_saturating_arithmetic.rs:45:13
144144
|
145145
LL | let _ = 1i32.checked_sub(-1).unwrap_or(i32::MAX);
146-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_sub`: `1i32.saturating_sub(-1)`
146+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_sub`: `1i32.saturating_sub(-1)`
147147

148148
error: manual saturating arithmetic
149149
--> $DIR/manual_saturating_arithmetic.rs:46:13
150150
|
151151
LL | let _ = 1i8.checked_sub(-1).unwrap_or(127);
152-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `saturating_sub`: `1i8.saturating_sub(-1)`
152+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_sub`: `1i8.saturating_sub(-1)`
153153

154154
error: manual saturating arithmetic
155155
--> $DIR/manual_saturating_arithmetic.rs:47:13
@@ -158,7 +158,7 @@ LL | let _ = 1i128
158158
| _____________^
159159
LL | | .checked_sub(-1)
160160
LL | | .unwrap_or(170_141_183_460_469_231_731_687_303_715_884_105_727);
161-
| |_______________________________________________________________________^ help: try using `saturating_sub`: `1i128.saturating_sub(-1)`
161+
| |_______________________________________________________________________^ help: consider using `saturating_sub`: `1i128.saturating_sub(-1)`
162162

163163
error: aborting due to 24 previous errors
164164

tests/ui/option_as_ref_deref.stderr

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: called `.as_ref().map(Deref::deref)` on an `Option` value
22
--> $DIR/option_as_ref_deref.rs:11:13
33
|
44
LL | let _ = opt.clone().as_ref().map(Deref::deref).map(str::len);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.clone().as_deref()`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `opt.clone().as_deref()`
66
|
77
= note: `-D clippy::option-as-ref-deref` implied by `-D warnings`
88
= help: to override `-D warnings` add `#[allow(clippy::option_as_ref_deref)]`
@@ -15,103 +15,103 @@ LL | let _ = opt.clone()
1515
LL | | .as_ref().map(
1616
LL | | Deref::deref
1717
LL | | )
18-
| |_________^ help: try using as_deref instead: `opt.clone().as_deref()`
18+
| |_________^ help: consider using as_deref: `opt.clone().as_deref()`
1919

2020
error: called `.as_mut().map(DerefMut::deref_mut)` on an `Option` value
2121
--> $DIR/option_as_ref_deref.rs:20:13
2222
|
2323
LL | let _ = opt.as_mut().map(DerefMut::deref_mut);
24-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`
24+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref_mut: `opt.as_deref_mut()`
2525

2626
error: called `.as_ref().map(String::as_str)` on an `Option` value
2727
--> $DIR/option_as_ref_deref.rs:22:13
2828
|
2929
LL | let _ = opt.as_ref().map(String::as_str);
30-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
30+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `opt.as_deref()`
3131

3232
error: called `.as_ref().map(|x| x.as_str())` on an `Option` value
3333
--> $DIR/option_as_ref_deref.rs:23:13
3434
|
3535
LL | let _ = opt.as_ref().map(|x| x.as_str());
36-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
36+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `opt.as_deref()`
3737

3838
error: called `.as_mut().map(String::as_mut_str)` on an `Option` value
3939
--> $DIR/option_as_ref_deref.rs:24:13
4040
|
4141
LL | let _ = opt.as_mut().map(String::as_mut_str);
42-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`
42+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref_mut: `opt.as_deref_mut()`
4343

4444
error: called `.as_mut().map(|x| x.as_mut_str())` on an `Option` value
4545
--> $DIR/option_as_ref_deref.rs:25:13
4646
|
4747
LL | let _ = opt.as_mut().map(|x| x.as_mut_str());
48-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`
48+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref_mut: `opt.as_deref_mut()`
4949

5050
error: called `.as_ref().map(CString::as_c_str)` on an `Option` value
5151
--> $DIR/option_as_ref_deref.rs:26:13
5252
|
5353
LL | let _ = Some(CString::new(vec![]).unwrap()).as_ref().map(CString::as_c_str);
54-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `Some(CString::new(vec![]).unwrap()).as_deref()`
54+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `Some(CString::new(vec![]).unwrap()).as_deref()`
5555

5656
error: called `.as_ref().map(OsString::as_os_str)` on an `Option` value
5757
--> $DIR/option_as_ref_deref.rs:27:13
5858
|
5959
LL | let _ = Some(OsString::new()).as_ref().map(OsString::as_os_str);
60-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `Some(OsString::new()).as_deref()`
60+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `Some(OsString::new()).as_deref()`
6161

6262
error: called `.as_ref().map(PathBuf::as_path)` on an `Option` value
6363
--> $DIR/option_as_ref_deref.rs:28:13
6464
|
6565
LL | let _ = Some(PathBuf::new()).as_ref().map(PathBuf::as_path);
66-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `Some(PathBuf::new()).as_deref()`
66+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `Some(PathBuf::new()).as_deref()`
6767

6868
error: called `.as_ref().map(Vec::as_slice)` on an `Option` value
6969
--> $DIR/option_as_ref_deref.rs:29:13
7070
|
7171
LL | let _ = Some(Vec::<()>::new()).as_ref().map(Vec::as_slice);
72-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `Some(Vec::<()>::new()).as_deref()`
72+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `Some(Vec::<()>::new()).as_deref()`
7373

7474
error: called `.as_mut().map(Vec::as_mut_slice)` on an `Option` value
7575
--> $DIR/option_as_ref_deref.rs:30:13
7676
|
7777
LL | let _ = Some(Vec::<()>::new()).as_mut().map(Vec::as_mut_slice);
78-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `Some(Vec::<()>::new()).as_deref_mut()`
78+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref_mut: `Some(Vec::<()>::new()).as_deref_mut()`
7979

8080
error: called `.as_ref().map(|x| x.deref())` on an `Option` value
8181
--> $DIR/option_as_ref_deref.rs:32:13
8282
|
8383
LL | let _ = opt.as_ref().map(|x| x.deref());
84-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
84+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `opt.as_deref()`
8585

8686
error: called `.as_mut().map(|x| x.deref_mut())` on an `Option` value
8787
--> $DIR/option_as_ref_deref.rs:33:13
8888
|
8989
LL | let _ = opt.clone().as_mut().map(|x| x.deref_mut()).map(|x| x.len());
90-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.clone().as_deref_mut()`
90+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref_mut: `opt.clone().as_deref_mut()`
9191

9292
error: called `.as_ref().map(|x| &**x)` on an `Option` value
9393
--> $DIR/option_as_ref_deref.rs:40:13
9494
|
9595
LL | let _ = opt.as_ref().map(|x| &**x);
96-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
96+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `opt.as_deref()`
9797

9898
error: called `.as_mut().map(|x| &mut **x)` on an `Option` value
9999
--> $DIR/option_as_ref_deref.rs:41:13
100100
|
101101
LL | let _ = opt.as_mut().map(|x| &mut **x);
102-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`
102+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref_mut: `opt.as_deref_mut()`
103103

104104
error: called `.as_ref().map(std::ops::Deref::deref)` on an `Option` value
105105
--> $DIR/option_as_ref_deref.rs:44:13
106106
|
107107
LL | let _ = opt.as_ref().map(std::ops::Deref::deref);
108-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
108+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `opt.as_deref()`
109109

110110
error: called `.as_ref().map(String::as_str)` on an `Option` value
111111
--> $DIR/option_as_ref_deref.rs:56:13
112112
|
113113
LL | let _ = opt.as_ref().map(String::as_str);
114-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
114+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `opt.as_deref()`
115115

116116
error: aborting due to 18 previous errors
117117

0 commit comments

Comments
 (0)