pub trait Location: Clone {
// Required methods
fn nowhere() -> Self;
fn between(start: &Self, end: &Self) -> Self;
}Expand description
Trait to implement for types representing a source code location
Required Methods§
Sourcefn nowhere() -> Self
fn nowhere() -> Self
Create a Location which does not correspond to a source code location.
Depending on how the lbirary is used in a compiler, this can either be a placeholder
value, in which case encountering a nowhere when reporting an error
is probably an error, or if source locations can be missing it should be an actual
marker.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.