mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
Add comment about how we find the right span in non_fmt_panic.
This commit is contained in:
@@ -71,6 +71,9 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc
|
||||
|
||||
// Find the span of the argument to `panic!()`, before expansion in the
|
||||
// case of `panic!(some_macro!())`.
|
||||
// We don't use source_callsite(), because this `panic!(..)` might itself
|
||||
// be expanded from another macro, in which case we want to stop at that
|
||||
// expansion.
|
||||
let mut arg_span = arg.span;
|
||||
let mut arg_macro = None;
|
||||
while !span.contains(arg_span) {
|
||||
|
||||
Reference in New Issue
Block a user