pub struct SourceSpan {
pub start: usize,
pub end: usize,
pub source: Option<String>,
}Expand description
Lightweight span into a source program — a byte range [start, end) plus an
optional filename or logical label.
This type deliberately does not depend on any particular parser — it is a minimal, self-contained substitute that can be produced by any upstream frontend. The compiler never dereferences the span; it is only propagated for diagnostic printing.
Fields§
§start: usizeByte offset of the first character (inclusive).
end: usizeByte offset one past the last character (exclusive).
source: Option<String>Logical source label (e.g. a file path or "<stdin>"); optional.
Implementations§
Source§impl SourceSpan
impl SourceSpan
Trait Implementations§
Source§impl Clone for SourceSpan
impl Clone for SourceSpan
Source§fn clone(&self) -> SourceSpan
fn clone(&self) -> SourceSpan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceSpan
impl Debug for SourceSpan
Source§impl Display for SourceSpan
impl Display for SourceSpan
Source§impl Hash for SourceSpan
impl Hash for SourceSpan
Source§impl PartialEq for SourceSpan
impl PartialEq for SourceSpan
impl Eq for SourceSpan
impl StructuralPartialEq for SourceSpan
Auto Trait Implementations§
impl Freeze for SourceSpan
impl RefUnwindSafe for SourceSpan
impl Send for SourceSpan
impl Sync for SourceSpan
impl Unpin for SourceSpan
impl UnsafeUnpin for SourceSpan
impl UnwindSafe for SourceSpan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.