Skip to content

Commit 8bc120a

Browse files
committed
Add an ability to convert between Span and visit::Location
1 parent 569d7e3 commit 8bc120a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/stable_mir/src/mir/visit.rs

+6
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,12 @@ impl Location {
465465
}
466466
}
467467

468+
impl From<Span> for Location {
469+
fn from(span: Span) -> Self {
470+
Location(span)
471+
}
472+
}
473+
468474
/// Reference to a place used to represent a partial projection.
469475
pub struct PlaceRef<'a> {
470476
pub local: Local,

0 commit comments

Comments
 (0)