1
Fork 0

Revert "Rollup merge of #133418 - Zalathar:spans, r=jieyouxu"

This reverts commit adf9b5fcd1, reversing
changes made to af1ca153d4.

Reverting due to <https://github.com/rust-lang/rust/issues/133606>.
This commit is contained in:
Zalathar 2024-11-29 14:52:41 +11:00
parent d53f0b1d8e
commit 9461f4296f
13 changed files with 284 additions and 250 deletions

View file

@ -155,6 +155,22 @@ impl Debug for CoverageKind {
}
}
#[derive(Clone, TyEncodable, TyDecodable, Hash, HashStable, PartialEq, Eq, PartialOrd, Ord)]
#[derive(TypeFoldable, TypeVisitable)]
pub struct SourceRegion {
pub start_line: u32,
pub start_col: u32,
pub end_line: u32,
pub end_col: u32,
}
impl Debug for SourceRegion {
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
let &Self { start_line, start_col, end_line, end_col } = self;
write!(fmt, "{start_line}:{start_col} - {end_line}:{end_col}")
}
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, HashStable)]
#[derive(TyEncodable, TyDecodable, TypeFoldable, TypeVisitable)]
pub enum Op {
@ -216,7 +232,7 @@ impl MappingKind {
#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)]
pub struct Mapping {
pub kind: MappingKind,
pub span: Span,
pub source_region: SourceRegion,
}
/// Stores per-function coverage information attached to a `mir::Body`,

View file

@ -603,8 +603,8 @@ fn write_function_coverage_info(
for (id, expression) in expressions.iter_enumerated() {
writeln!(w, "{INDENT}coverage {id:?} => {expression:?};")?;
}
for coverage::Mapping { kind, span } in mappings {
writeln!(w, "{INDENT}coverage {kind:?} => {span:?};")?;
for coverage::Mapping { kind, source_region } in mappings {
writeln!(w, "{INDENT}coverage {kind:?} => {source_region:?};")?;
}
writeln!(w)?;