You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/ui/option_as_ref_deref.stderr
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -88,5 +88,17 @@ error: called `.as_mut().map(DerefMut::deref_mut)` (or with one of deref aliases
88
88
LL | let _ = opt.clone().as_mut().map(|x| x.deref_mut()).map(|x| x.len());
89
89
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.clone().as_deref_mut()`
90
90
91
-
error: aborting due to 14 previous errors
91
+
error: called `.as_ref().map(Deref::deref)` (or with one of deref aliases) on an Option value. This can be done more directly by calling `opt.as_deref()` instead
92
+
--> $DIR/option_as_ref_deref.rs:42:13
93
+
|
94
+
LL | let _ = opt.as_ref().map(|x| &**x);
95
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
96
+
97
+
error: called `.as_mut().map(DerefMut::deref_mut)` (or with one of deref aliases) on an Option value. This can be done more directly by calling `opt.as_deref_mut()` instead
98
+
--> $DIR/option_as_ref_deref.rs:43:13
99
+
|
100
+
LL | let _ = opt.as_mut().map(|x| &mut **x);
101
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`
0 commit comments