@@ -31,7 +31,7 @@ use rustc_ast::{self as ast, *};
3131use rustc_ast_pretty:: pprust:: { self , expr_to_string} ;
3232use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
3333use rustc_data_structures:: stack:: ensure_sufficient_stack;
34- use rustc_errors:: { Applicability , Diagnostic , DiagnosticStyledString , MultiSpan } ;
34+ use rustc_errors:: { fluent , Applicability , Diagnostic , DiagnosticStyledString , MultiSpan } ;
3535use rustc_feature:: { deprecated_attributes, AttributeGate , BuiltinAttribute , GateIssue , Stability } ;
3636use rustc_hir as hir;
3737use rustc_hir:: def:: { DefKind , Res } ;
@@ -99,13 +99,12 @@ impl EarlyLintPass for WhileTrue {
9999 if let ast:: ExprKind :: Lit ( ref lit) = pierce_parens ( cond) . kind {
100100 if let ast:: LitKind :: Bool ( true ) = lit. kind {
101101 if !lit. span . from_expansion ( ) {
102- let msg = "denote infinite loops with `loop { ... }`" ;
103102 let condition_span = e. span . with_hi ( cond. span . hi ( ) ) ;
104103 cx. struct_span_lint ( WHILE_TRUE , condition_span, |lint| {
105- lint. build ( msg )
104+ lint. build ( fluent :: lint :: builtin_while_true )
106105 . span_suggestion_short (
107106 condition_span,
108- "use `loop`" ,
107+ fluent :: lint :: suggestion ,
109108 format ! (
110109 "{}loop" ,
111110 label. map_or_else( String :: new, |label| format!(
0 commit comments