try apply rustc_pass_by_value to Span

This commit is contained in:
lcnr 2022-01-27 08:17:13 +01:00
parent e6808381e5
commit 2684dfe583
8 changed files with 32 additions and 23 deletions

View file

@ -28,7 +28,7 @@ impl CoverageStatement {
let stmt = &mir_body[bb].statements[stmt_index];
format!(
"{}: @{}[{}]: {:?}",
source_range_no_file(tcx, &span),
source_range_no_file(tcx, span),
bb.index(),
stmt_index,
stmt
@ -38,7 +38,7 @@ impl CoverageStatement {
let term = mir_body[bb].terminator();
format!(
"{}: @{}.{}: {:?}",
source_range_no_file(tcx, &span),
source_range_no_file(tcx, span),
bb.index(),
term_type(&term.kind),
term.kind
@ -155,7 +155,7 @@ impl CoverageSpan {
pub fn format<'tcx>(&self, tcx: TyCtxt<'tcx>, mir_body: &mir::Body<'tcx>) -> String {
format!(
"{}\n {}",
source_range_no_file(tcx, &self.span),
source_range_no_file(tcx, self.span),
self.format_coverage_statements(tcx, mir_body).replace('\n', "\n "),
)
}