@@ -19,10 +19,9 @@ declare_lint! {
1919 ///
2020 /// ### Explanation
2121 ///
22- /// `panic!("{}")` panics with the message `"{}"`, as a `panic!()` invocation
23- /// with a single argument does not use `format_args!()`.
24- /// A future edition of Rust will interpret this string as format string,
25- /// which would break this.
22+ /// In Rust 2018 and earlier, `panic!("{}")` panics with the message `"{}"`,
23+ /// as a `panic!()` invocation with a single argument does not use `format_args!()`.
24+ /// Rust 2021 interprets this string as format string, which breaks this.
2625 PANIC_FMT ,
2726 Warn ,
2827 "detect braces in single-argument panic!() invocations" ,
@@ -50,8 +49,8 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc
5049 if let ast:: LitKind :: Str ( sym, _) = lit. node {
5150 let mut expn = f. span . ctxt ( ) . outer_expn_data ( ) ;
5251 if let Some ( id) = expn. macro_def_id {
53- if cx. tcx . is_diagnostic_item ( sym:: std_panic_macro , id)
54- || cx. tcx . is_diagnostic_item ( sym:: core_panic_macro , id)
52+ if cx. tcx . is_diagnostic_item ( sym:: std_panic_2015_macro , id)
53+ || cx. tcx . is_diagnostic_item ( sym:: core_panic_2015_macro , id)
5554 {
5655 let fmt = sym. as_str ( ) ;
5756 if !fmt. contains ( & [ '{' , '}' ] [ ..] ) {
0 commit comments