@@ -1775,8 +1775,8 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
17751775 } ;
17761776
17771777 if let Some ( ( start, end, join) ) = endpoints {
1778- let msg = "`...` range patterns are deprecated" ;
1779- let suggestion = "use `..=` for an inclusive range" ;
1778+ let msg = fluent :: lint :: builtin_ellipsis_inclusive_range_patterns ;
1779+ let suggestion = fluent :: lint :: suggestion ;
17801780 if parenthesise {
17811781 self . node_id = Some ( pat. id ) ;
17821782 let end = expr_to_string ( & end) ;
@@ -1785,8 +1785,11 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
17851785 None => format ! ( "&(..={})" , end) ,
17861786 } ;
17871787 if join. edition ( ) >= Edition :: Edition2021 {
1788- let mut err =
1789- rustc_errors:: struct_span_err!( cx. sess( ) , pat. span, E0783 , "{}" , msg, ) ;
1788+ let mut err = cx. sess ( ) . struct_span_err_with_code (
1789+ pat. span ,
1790+ msg,
1791+ rustc_errors:: error_code!( E0783 ) ,
1792+ ) ;
17901793 err. span_suggestion (
17911794 pat. span ,
17921795 suggestion,
@@ -1809,8 +1812,11 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
18091812 } else {
18101813 let replace = "..=" ;
18111814 if join. edition ( ) >= Edition :: Edition2021 {
1812- let mut err =
1813- rustc_errors:: struct_span_err!( cx. sess( ) , pat. span, E0783 , "{}" , msg, ) ;
1815+ let mut err = cx. sess ( ) . struct_span_err_with_code (
1816+ pat. span ,
1817+ msg,
1818+ rustc_errors:: error_code!( E0783 ) ,
1819+ ) ;
18141820 err. span_suggestion_short (
18151821 join,
18161822 suggestion,
0 commit comments