pub struct Location {
pub unit: UnitId,
pub span: Span,
pub in_source: bool,
}Expand description
A place in the source.
§Examples
use hir_lang::{Span, UnitId};
use resolve_lang::Location;
let l = Location { unit: UnitId::new(1), span: Span::new(4, 7), in_source: true };
assert_eq!(l.span.len(), 3);Fields§
§unit: UnitIdThe unit.
span: SpanThe span. For a name that came out of a macro or template expansion, this is the outermost expansion’s call site.
in_source: boolWhether the name was written in the source (its origin is not an expansion). Only such names are rename edits.
Trait Implementations§
impl Copy for Location
impl Eq for Location
Source§impl Ord for Location
impl Ord for Location
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
Source§impl PartialOrd for Location
impl PartialOrd for Location
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl Freeze for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnsafeUnpin 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