Struct rustc_utils::source_map::spanner::Spanner
source · pub struct Spanner<'tcx> {
pub mir_span_tree: SpanTree<MirSpannedPlace<'tcx>>,
pub body_span: Span,
pub item_span: Span,
pub ret_span: Span,
/* private fields */
}
Expand description
Converts MIR locations to source spans using HIR information.
Fields§
§mir_span_tree: SpanTree<MirSpannedPlace<'tcx>>
§body_span: Span
§item_span: Span
§ret_span: Span
Implementations§
source§impl<'tcx> Spanner<'tcx>
impl<'tcx> Spanner<'tcx>
pub fn new(tcx: TyCtxt<'tcx>, body_id: BodyId, body: &Body<'tcx>) -> Self
pub fn location_to_spans( &self, location: LocationOrArg, body: &Body<'_>, _span_type: EnclosingHirSpans ) -> Vec<Span>
pub fn span_to_places<'this>( &'this self, span: Span ) -> Vec<&'this MirSpannedPlace<'tcx>>
Auto Trait Implementations§
impl<'tcx> !RefUnwindSafe for Spanner<'tcx>
impl<'tcx> !Send for Spanner<'tcx>
impl<'tcx> !Sync for Spanner<'tcx>
impl<'tcx> Unpin for Spanner<'tcx>
impl<'tcx> !UnwindSafe for Spanner<'tcx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more