@@ -19,10 +19,9 @@ declare_lint! {
19
19
///
20
20
/// ### Explanation
21
21
///
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.
26
25
PANIC_FMT ,
27
26
Warn ,
28
27
"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
50
49
if let ast:: LitKind :: Str ( sym, _) = lit. node {
51
50
let mut expn = f. span . ctxt ( ) . outer_expn_data ( ) ;
52
51
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)
55
54
{
56
55
let fmt = sym. as_str ( ) ;
57
56
if !fmt. contains ( & [ '{' , '}' ] [ ..] ) {
0 commit comments