Add a unit test for preserving disk-based diagnostics

This commit is contained in:
Max Brunsfeld 2021-12-22 13:22:12 -08:00
parent 1544da887e
commit 0faf5308ac
3 changed files with 110 additions and 3 deletions

View file

@ -2057,12 +2057,18 @@ pub trait FromAnchor {
impl FromAnchor for Point {
fn from_anchor(anchor: &Anchor, snapshot: &BufferSnapshot) -> Self {
anchor.to_point(snapshot)
snapshot.summary_for_anchor(anchor)
}
}
impl FromAnchor for PointUtf16 {
fn from_anchor(anchor: &Anchor, snapshot: &BufferSnapshot) -> Self {
snapshot.summary_for_anchor(anchor)
}
}
impl FromAnchor for usize {
fn from_anchor(anchor: &Anchor, snapshot: &BufferSnapshot) -> Self {
anchor.to_offset(snapshot)
snapshot.summary_for_anchor(anchor)
}
}