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 =
273
273
.note = generators are lazy and do nothing unless resumed
274
274
275
275
lint-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 {
360
360
cx. struct_span_lint ( PATH_STATEMENTS , s. span , |lint| {
361
361
let ty = cx. typeck_results ( ) . expr_ty ( expr) ;
362
362
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 ) ;
364
364
if let Ok ( snippet) = cx. sess ( ) . source_map ( ) . span_to_snippet ( expr. span ) {
365
365
lint. span_suggestion (
366
366
s. span ,
367
- "use `drop` to clarify the intent" ,
367
+ fluent :: lint :: suggestion ,
368
368
format ! ( "drop({});" , snippet) ,
369
369
Applicability :: MachineApplicable ,
370
370
) ;
371
371
} else {
372
- lint. span_help ( s. span , "use `drop` to clarify the intent" ) ;
372
+ lint. span_help ( s. span , fluent :: lint :: suggestion ) ;
373
373
}
374
374
lint. emit ( ) ;
375
375
} else {
376
- lint. build ( "path statement with no effect" ) . emit ( ) ;
376
+ lint. build ( fluent :: lint :: path_statement_no_effect ) . emit ( ) ;
377
377
}
378
378
} ) ;
379
379
}
You can’t perform that action at this time.
0 commit comments