pub struct Label {
pub span: Span,
pub file: Option<FileId>,
pub message: String,
}Expand description
A span with something to say about it.
The file is None for the ordinary case, which is a label about the file
the diagnostic was filed against, and that is most of them: 23 of the 31
places this compiler builds one can only ever have a span from their own
file in hand. Some is for the rest, where the thing worth pointing at is
somewhere else, and until it existed those producers had to choose between
drawing a caret over whatever happened to sit at those byte offsets in the
wrong file and saying nothing. They all chose to say nothing, which is the
right call and is still a label a reader does not get.
Fields§
§span: Span§file: Option<FileId>Where span is an offset into. None means the diagnostic’s own file.
message: StringImplementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Label
impl RefUnwindSafe for Label
impl Send for Label
impl Sync for Label
impl Unpin for Label
impl UnsafeUnpin for Label
impl UnwindSafe for Label
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