Provide conversion of stable span to internal span
This will allow users to use rustc span messages to display user friendly messages.
This commit is contained in:
parent
d5afea51dc
commit
591b41abb8
@ -11,8 +11,8 @@ use stable_mir::mir::alloc::AllocId;
|
|||||||
use stable_mir::mir::mono::{Instance, MonoItem, StaticDef};
|
use stable_mir::mir::mono::{Instance, MonoItem, StaticDef};
|
||||||
use stable_mir::ty::{
|
use stable_mir::ty::{
|
||||||
AdtDef, Binder, BoundRegionKind, BoundTyKind, BoundVariableKind, ClosureKind, Const,
|
AdtDef, Binder, BoundRegionKind, BoundTyKind, BoundVariableKind, ClosureKind, Const,
|
||||||
ExistentialTraitRef, FloatTy, GenericArgKind, GenericArgs, IntTy, Region, RigidTy, TraitRef,
|
ExistentialTraitRef, FloatTy, GenericArgKind, GenericArgs, IntTy, Region, RigidTy, Span,
|
||||||
Ty, UintTy,
|
TraitRef, Ty, UintTy,
|
||||||
};
|
};
|
||||||
use stable_mir::{CrateItem, DefId};
|
use stable_mir::{CrateItem, DefId};
|
||||||
|
|
||||||
@ -279,6 +279,14 @@ impl<'tcx> RustcInternal<'tcx> for AdtDef {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'tcx> RustcInternal<'tcx> for Span {
|
||||||
|
type T = rustc_span::Span;
|
||||||
|
|
||||||
|
fn internal(&self, tables: &mut Tables<'tcx>) -> Self::T {
|
||||||
|
tables[*self]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'tcx, T> RustcInternal<'tcx> for &T
|
impl<'tcx, T> RustcInternal<'tcx> for &T
|
||||||
where
|
where
|
||||||
T: RustcInternal<'tcx>,
|
T: RustcInternal<'tcx>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user