diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-10-18 23:25:57 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2020-10-18 23:25:57 +0200 |
| commit | b8a8b681b8ca37771a0116d7cc7c3e4e7c749e0e (patch) | |
| tree | 3dc0d3009c79d02e51178f6164afe10b88c4a5fc | |
| parent | ded269fa102df8716a540741ee7da6ce40e9738c (diff) | |
| download | rust-b8a8b681b8ca37771a0116d7cc7c3e4e7c749e0e.tar.gz rust-b8a8b681b8ca37771a0116d7cc7c3e4e7c749e0e.zip | |
Formatting.
| -rw-r--r-- | compiler/rustc_lint/src/panic_fmt.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_lint/src/panic_fmt.rs b/compiler/rustc_lint/src/panic_fmt.rs index 6879244721b..a615d57dfa7 100644 --- a/compiler/rustc_lint/src/panic_fmt.rs +++ b/compiler/rustc_lint/src/panic_fmt.rs @@ -53,7 +53,7 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc let looks_like_placeholder = match (open, close) { (Some(_), Some(_)) => true, (Some(_), None) | (None, Some(_)) => false, - (None, None) => return // OK, no braces. + (None, None) => return, // OK, no braces. }; let expn = f.span.ctxt().outer_expn_data(); if let Some(id) = expn.macro_def_id { @@ -64,9 +64,10 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc // Unwrap another level of macro expansion if this // panic!() was expanded from assert!(). let parent = expn.call_site.ctxt().outer_expn_data(); - if parent.macro_def_id.map_or(false, |id| { - cx.tcx.is_diagnostic_item(sym::assert_macro, id) - }) { + if parent + .macro_def_id + .map_or(false, |id| cx.tcx.is_diagnostic_item(sym::assert_macro, id)) + { parent } else { expn |
