File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
rustc_error_messages/locales/en-US Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -283,3 +283,6 @@ lint-unused-delim = unnecessary {$delim} around {$item}
283283 .suggestion = remove these { $delim }
284284
285285lint-unused-import-braces = braces around { $node } is unnecessary
286+
287+ lint-unused-allocation = unnecessary allocation, use `&` instead
288+ lint-unused-allocation-mut = unnecessary allocation, use `&mut` instead
Original file line number Diff line number Diff line change @@ -1169,15 +1169,13 @@ impl<'tcx> LateLintPass<'tcx> for UnusedAllocation {
11691169 for adj in cx. typeck_results ( ) . expr_adjustments ( e) {
11701170 if let adjustment:: Adjust :: Borrow ( adjustment:: AutoBorrow :: Ref ( _, m) ) = adj. kind {
11711171 cx. struct_span_lint ( UNUSED_ALLOCATION , e. span , |lint| {
1172- let msg = match m {
1173- adjustment:: AutoBorrowMutability :: Not => {
1174- "unnecessary allocation, use `&` instead"
1175- }
1172+ lint. build ( match m {
1173+ adjustment:: AutoBorrowMutability :: Not => fluent:: lint:: unused_allocation,
11761174 adjustment:: AutoBorrowMutability :: Mut { .. } => {
1177- "unnecessary allocation, use `&mut` instead"
1175+ fluent :: lint :: unused_allocation_mut
11781176 }
1179- } ;
1180- lint . build ( msg ) . emit ( ) ;
1177+ } )
1178+ . emit ( ) ;
11811179 } ) ;
11821180 }
11831181 }
You can’t perform that action at this time.
0 commit comments