@@ -20,7 +20,7 @@ use rustc_middle::mir::{FakeReadCause, Mutability};
2020use rustc_middle:: ty;
2121use rustc_span:: source_map:: { BytePos , CharPos , Pos , Span , SyntaxContext } ;
2222use std:: borrow:: Cow ;
23- use std:: fmt:: { Display , Write as _} ;
23+ use std:: fmt:: { self , Display , Write as _} ;
2424use std:: ops:: { Add , Neg , Not , Sub } ;
2525
2626/// A helper type to build suggestion correctly handling parentheses.
@@ -932,7 +932,7 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> {
932932 if cmt. place . projections . is_empty ( ) {
933933 // handle item without any projection, that needs an explicit borrowing
934934 // i.e.: suggest `&x` instead of `x`
935- let _ = write ! ( self . suggestion_start, "{start_snip}&{ident_str}" ) ;
935+ let _: fmt :: Result = write ! ( self . suggestion_start, "{start_snip}&{ident_str}" ) ;
936936 } else {
937937 // cases where a parent `Call` or `MethodCall` is using the item
938938 // i.e.: suggest `.contains(&x)` for `.find(|x| [1, 2, 3].contains(x)).is_none()`
@@ -947,7 +947,7 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> {
947947 // given expression is the self argument and will be handled completely by the compiler
948948 // i.e.: `|x| x.is_something()`
949949 ExprKind :: MethodCall ( _, self_expr, ..) if self_expr. hir_id == cmt. hir_id => {
950- let _ = write ! ( self . suggestion_start, "{start_snip}{ident_str_with_proj}" ) ;
950+ let _: fmt :: Result = write ! ( self . suggestion_start, "{start_snip}{ident_str_with_proj}" ) ;
951951 self . next_pos = span. hi ( ) ;
952952 return ;
953953 } ,
@@ -1055,7 +1055,7 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> {
10551055 }
10561056 }
10571057
1058- let _ = write ! ( self . suggestion_start, "{start_snip}{replacement_str}" ) ;
1058+ let _: fmt :: Result = write ! ( self . suggestion_start, "{start_snip}{replacement_str}" ) ;
10591059 }
10601060 self . next_pos = span. hi ( ) ;
10611061 }
0 commit comments