pub enum Span {
Compiler(Span),
Fallback(Span),
}Expand description
A compiler or fallback source span.
Variants§
Implementations§
Source§impl Span
impl Span
pub fn call_site() -> Self
pub fn mixed_site() -> Self
pub fn def_site() -> Self
pub fn start(&self) -> Location
pub fn end(&self) -> Location
pub fn byte_range(&self) -> Range<usize> ⓘ
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, i: usize) -> bool
pub fn is_subset(&self, other: &Self) -> bool
pub fn join(&self, other: Self) -> Self
Trait Implementations§
impl Copy for Span
impl Eq for Span
Source§impl MultiSpan for Span
Available on nightly only.
impl MultiSpan for Span
Available on
nightly only.Source§fn into_spans(self) -> Vec<Span>
fn into_spans(self) -> Vec<Span>
🔬This is a nightly-only experimental API. (
proc_macro_diagnostic)Converts
self into a Vec<Span>.Source§impl Ord for Span
impl Ord for Span
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Auto Trait Implementations§
impl !Send for Span
impl !Sync for Span
impl Freeze for Span
impl RefUnwindSafe for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
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