@@ -9,7 +9,7 @@ use rustc_span::edition::Edition;
99use rustc_span:: { hygiene, sym, symbol:: kw, symbol:: SymbolStr , InnerSpan , Span , Symbol } ;
1010
1111declare_lint ! {
12- /// The `non_fmt_panic ` lint detects `panic!(..)` invocations where the first
12+ /// The `non_fmt_panics ` lint detects `panic!(..)` invocations where the first
1313 /// argument is not a formatting string.
1414 ///
1515 /// ### Example
@@ -29,7 +29,7 @@ declare_lint! {
2929 /// an `i32` as message.
3030 ///
3131 /// Rust 2021 always interprets the first argument as format string.
32- NON_FMT_PANIC ,
32+ NON_FMT_PANICS ,
3333 Warn ,
3434 "detect single-argument panic!() invocations in which the argument is not a format string" ,
3535 @future_incompatible = FutureIncompatibleInfo {
@@ -39,7 +39,7 @@ declare_lint! {
3939 report_in_external_macro
4040}
4141
42- declare_lint_pass ! ( NonPanicFmt => [ NON_FMT_PANIC ] ) ;
42+ declare_lint_pass ! ( NonPanicFmt => [ NON_FMT_PANICS ] ) ;
4343
4444impl < ' tcx > LateLintPass < ' tcx > for NonPanicFmt {
4545 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx hir:: Expr < ' tcx > ) {
@@ -91,7 +91,7 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc
9191 arg_span = expn. call_site ;
9292 }
9393
94- cx. struct_span_lint ( NON_FMT_PANIC , arg_span, |lint| {
94+ cx. struct_span_lint ( NON_FMT_PANICS , arg_span, |lint| {
9595 let mut l = lint. build ( "panic message is not a string literal" ) ;
9696 l. note ( "this usage of panic!() is deprecated; it will be a hard error in Rust 2021" ) ;
9797 l. note ( "for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>" ) ;
@@ -174,7 +174,7 @@ fn check_panic_str<'tcx>(
174174 [ ] => vec ! [ fmt_span] ,
175175 v => v. iter ( ) . map ( |span| fmt_span. from_inner ( * span) ) . collect ( ) ,
176176 } ;
177- cx. struct_span_lint ( NON_FMT_PANIC , arg_spans, |lint| {
177+ cx. struct_span_lint ( NON_FMT_PANICS , arg_spans, |lint| {
178178 let mut l = lint. build ( match n_arguments {
179179 1 => "panic message contains an unused formatting placeholder" ,
180180 _ => "panic message contains unused formatting placeholders" ,
@@ -208,7 +208,7 @@ fn check_panic_str<'tcx>(
208208 Some ( v) if v. len ( ) == 1 => "panic message contains a brace" ,
209209 _ => "panic message contains braces" ,
210210 } ;
211- cx. struct_span_lint ( NON_FMT_PANIC , brace_spans. unwrap_or_else ( || vec ! [ span] ) , |lint| {
211+ cx. struct_span_lint ( NON_FMT_PANICS , brace_spans. unwrap_or_else ( || vec ! [ span] ) , |lint| {
212212 let mut l = lint. build ( msg) ;
213213 l. note ( "this message is not used as a format string, but will be in Rust 2021" ) ;
214214 if span. contains ( arg. span ) {
0 commit comments