Skip to content

Commit

Permalink
Add an ability to convert between Span and visit::Location
Browse files Browse the repository at this point in the history
  • Loading branch information
artemagvanian committed Aug 16, 2024
1 parent 569d7e3 commit 8bc120a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/stable_mir/src/mir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,12 @@ impl Location {
}
}

impl From<Span> for Location {
fn from(span: Span) -> Self {
Location(span)
}
}

/// Reference to a place used to represent a partial projection.
pub struct PlaceRef<'a> {
pub local: Local,
Expand Down

0 comments on commit 8bc120a

Please sign in to comment.