pub struct Note {
pub message: String,
pub range: Option<SourceRange>,
}Expand description
An extra remark attached to a Diagnostic.
A procedural macro has one span per diagnostic and no way to add a second
one, so a note that refers to another place — the #define a macro came
from, the first of two conflicting declarations — cannot point there. Its
range is rendered into the message instead, as at line 5 for the
macro’s own text or in include/foo.h:12 for an #included file; see
Diagnostics::render. Messages are therefore phrased to be completed by
that phrase (“macro ‘MAX’ defined”, not “macro ‘MAX’ defined here”).
Fields§
§message: StringThe text of the note.
range: Option<SourceRange>The place the note is about, if any.
Trait Implementations§
impl Eq for Note
impl StructuralPartialEq for Note
Auto Trait Implementations§
impl Freeze for Note
impl RefUnwindSafe for Note
impl Send for Note
impl Sync for Note
impl Unpin for Note
impl UnsafeUnpin for Note
impl UnwindSafe for Note
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