Spans represent a region of code, used for error reporting. Positions in spans
are absolute positions from the beginning of the source_map, not positions
SourceFiles. Methods on the
SourceMap can be used to relate spans back
to the original source.
You must be careful if the span crosses more than one file - you will not be
able to use many of the functions on spans in source_map and you cannot assume
that the length of the
span = hi - lo; there may be space in the
range between files.
SpanData is public because
Span uses a thread-local interner and can't be
sent to other threads, but some pieces of performance infra run in a separate thread.
Span is generally preferred.
Information about where the macro came from, if this piece of code was created by a macro expansion.
pub fn with_ctxt(&self, ctxt: SyntaxContext) -> Span[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where1.3.0[src]
impl PartialOrd<SpanData> for SpanData[src]
fn partial_cmp(&self, other: &SpanData) -> Option<Ordering>[src]
impl StructuralEq for SpanData[src]
impl StructuralPartialEq for SpanData[src]
Auto Trait Implementations
impl RefUnwindSafe for SpanData
impl UnwindSafe for SpanData
type Owned = T
The resulting type after obtaining ownership.
pub fn clone_into(&self, target: &mut T)[src]
type Error = Infallible
The type returned in the event of a conversion error.