diff options
| author | Artem Agvanian <nartagva@amazon.com> | 2024-08-16 14:28:06 -0700 |
|---|---|---|
| committer | Artem Agvanian <nartagva@amazon.com> | 2024-08-16 14:28:06 -0700 |
| commit | 8bc120af8286caae68742f8d9943681c5691effb (patch) | |
| tree | f9b3e5363df66498a462c5ddeac55429d2d4f6eb | |
| parent | 569d7e3d1528a24e50f8e05fd8380e999989b944 (diff) | |
| download | rust-8bc120af8286caae68742f8d9943681c5691effb.tar.gz rust-8bc120af8286caae68742f8d9943681c5691effb.zip | |
Add an ability to convert between `Span` and `visit::Location`
| -rw-r--r-- | compiler/stable_mir/src/mir/visit.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/stable_mir/src/mir/visit.rs b/compiler/stable_mir/src/mir/visit.rs index 50d7bae21db..f391a0f444a 100644 --- a/compiler/stable_mir/src/mir/visit.rs +++ b/compiler/stable_mir/src/mir/visit.rs @@ -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, |
