@@ -31,7 +31,7 @@ use rustc_ast::{self as ast, *};
31
31
use rustc_ast_pretty:: pprust:: { self , expr_to_string} ;
32
32
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
33
33
use rustc_data_structures:: stack:: ensure_sufficient_stack;
34
- use rustc_errors:: { Applicability , Diagnostic , DiagnosticStyledString , MultiSpan } ;
34
+ use rustc_errors:: { fluent , Applicability , Diagnostic , DiagnosticStyledString , MultiSpan } ;
35
35
use rustc_feature:: { deprecated_attributes, AttributeGate , BuiltinAttribute , GateIssue , Stability } ;
36
36
use rustc_hir as hir;
37
37
use rustc_hir:: def:: { DefKind , Res } ;
@@ -99,13 +99,12 @@ impl EarlyLintPass for WhileTrue {
99
99
if let ast:: ExprKind :: Lit ( ref lit) = pierce_parens ( cond) . kind {
100
100
if let ast:: LitKind :: Bool ( true ) = lit. kind {
101
101
if !lit. span . from_expansion ( ) {
102
- let msg = "denote infinite loops with `loop { ... }`" ;
103
102
let condition_span = e. span . with_hi ( cond. span . hi ( ) ) ;
104
103
cx. struct_span_lint ( WHILE_TRUE , condition_span, |lint| {
105
- lint. build ( msg )
104
+ lint. build ( fluent :: lint :: builtin_while_true )
106
105
. span_suggestion_short (
107
106
condition_span,
108
- "use `loop`" ,
107
+ fluent :: lint :: suggestion ,
109
108
format ! (
110
109
"{}loop" ,
111
110
label. map_or_else( String :: new, |label| format!(
0 commit comments