Skip to main content

SemanticLayer

Struct SemanticLayer 

Source
pub struct SemanticLayer { /* private fields */ }
Expand description

The resolve-time consumption path’s built-once layer: freshness, plus a (file, name_line, member) compatibility join index over every admitted occurrence, with identity translation applied lazily per lookup. Built by load.

Implementations§

Source§

impl SemanticLayer

Source

pub fn load(root: &Path) -> Option<SemanticLayer>

Reads this checkout’s admitted compiler-facts artifact and builds the layer. None when no artifact is admitted (the ordinary “no engine ever ran here” state) or its bytes do not parse as this module expects; both are fail-open, not errors – the whole run proceeds as a syntax-only build.

Source

pub fn is_fresh(&self) -> bool

Whether the whole artifact is fresh – consulted once per map run, not per reference.

Source

pub fn site_keys(&self) -> impl Iterator<Item = &(String, usize, String)>

Every distinct (file, name_line, member) compatibility key this layer indexes – discovered.rs’s own iteration surface, walked once per admitted artifact rather than once per extractor reference.

Source

pub fn lookup( &self, index: &DefIndex, file: &str, line: usize, member: &str, caller_arg_count: Option<usize>, ) -> LookupOutcome

Looks up the compatibility join key (file, name_line, member). Freshness is checked first (a stale artifact never confirms anything, regardless of what any individual site says). More than one matching site is not automatically an ambiguity: caller_arg_count, the reference’s own argument count when the call syntax carries one (None for a property read, which never disambiguates), is compared against each candidate’s target_overload_signature – the exact identity carried alongside this compatibility key, not folded into it. When exactly one candidate’s own arity matches, that candidate alone is resolved, the same way a single hit would be; two same-line overloads of one member survive as distinct facts through this path rather than collapsing together. Only when arity cannot narrow the set to one (no caller arg count, no signature, more than one survivor, or a genuine tie) do disagreeing targets collapse to an ambiguous outcome rather than picking one arbitrarily – the key is a compatibility join, not the fact’s own identity, so more than one unresolved hit at it is a real ambiguity this consumer introduces, not one the compiler itself reported.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.