Struct cairo_lang_lowering::objects::Location
source · pub struct Location {
pub stable_location: StableLocation,
pub notes: Vec<DiagnosticNote>,
}
Expand description
The Location struct represents the source location of a lowered object. It is used to store the most relevant source location for a lowering object.
Fields§
§stable_location: StableLocation
The stable location of the object.
notes: Vec<DiagnosticNote>
Additional notes about the origin of the object, for example if the object was auto-generated by the compiler. New notes are appended to the end of the vector.
Implementations§
source§impl Location
impl Location
pub fn new(stable_location: StableLocation) -> Self
sourcepub fn with_note(self, note: DiagnosticNote) -> Self
pub fn with_note(self, note: DiagnosticNote) -> Self
Creates a new Location with the given note as the last note.
sourcepub fn maybe_with_note(self, note: Option<DiagnosticNote>) -> Self
pub fn maybe_with_note(self, note: Option<DiagnosticNote>) -> Self
Creates a new Location with the given note as the last note.
sourcepub fn add_note_with_location(
self,
db: &dyn LoweringGroup,
text: &str,
location: LocationId
) -> Self
pub fn add_note_with_location( self, db: &dyn LoweringGroup, text: &str, location: LocationId ) -> Self
Creates a new Location with the a note from the given text and location.
Trait Implementations§
source§impl PartialEq<Location> for Location
impl PartialEq<Location> for Location
impl Eq for Location
impl StructuralEq for Location
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.