pub struct SourceSpan {
pub file: SourceFileId,
pub span: Span<BytePos>,
}Expand description
A byte span paired with the file it was written in.
[NodeSpan] is enough for an error about the module a phase is currently
checking, because check_package supplies that one file id for the whole
diagnostic at render time (see PhaseError and SpanLabel). A span pulled
out of an Interface cannot rely on that: it was written in the exporting
module’s file, which is not necessarily the file being rendered, so the id has
to travel with the span instead of being attached later. This is that pair —
Interface::source_span is how one gets built.
Fields§
§file: SourceFileId§span: Span<BytePos>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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SourceSpan
Source§impl Debug for SourceSpan
impl Debug for SourceSpan
Source§impl PartialEq for SourceSpan
impl PartialEq 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