File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
rustc_error_messages/locales/en-US Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -273,3 +273,8 @@ lint-unused-generator =
273273 .note = generators are lazy and do nothing unless resumed
274274
275275lint-unused-def = unused { $pre } `{ $def } `{ $post } that must be used
276+
277+ lint-path-statement-drop = path statement drops value
278+ .suggestion = use `drop` to clarify the intent
279+
280+ lint-path-statement-no-effect = path statement with no effect
Original file line number Diff line number Diff line change @@ -360,20 +360,20 @@ impl<'tcx> LateLintPass<'tcx> for PathStatements {
360360 cx. struct_span_lint ( PATH_STATEMENTS , s. span , |lint| {
361361 let ty = cx. typeck_results ( ) . expr_ty ( expr) ;
362362 if ty. needs_drop ( cx. tcx , cx. param_env ) {
363- let mut lint = lint. build ( "path statement drops value" ) ;
363+ let mut lint = lint. build ( fluent :: lint :: path_statement_drop ) ;
364364 if let Ok ( snippet) = cx. sess ( ) . source_map ( ) . span_to_snippet ( expr. span ) {
365365 lint. span_suggestion (
366366 s. span ,
367- "use `drop` to clarify the intent" ,
367+ fluent :: lint :: suggestion ,
368368 format ! ( "drop({});" , snippet) ,
369369 Applicability :: MachineApplicable ,
370370 ) ;
371371 } else {
372- lint. span_help ( s. span , "use `drop` to clarify the intent" ) ;
372+ lint. span_help ( s. span , fluent :: lint :: suggestion ) ;
373373 }
374374 lint. emit ( ) ;
375375 } else {
376- lint. build ( "path statement with no effect" ) . emit ( ) ;
376+ lint. build ( fluent :: lint :: path_statement_no_effect ) . emit ( ) ;
377377 }
378378 } ) ;
379379 }
You can’t perform that action at this time.
0 commit comments