Skip to main content

SpecFuncs

Struct SpecFuncs 

Source
pub struct SpecFuncs {
    funcs: FxIndexMap<FluxId<DefIndex>, SpecFunc>,
}
Expand description

All the spec functions of a crate sorted topologically, i.e., every function comes after all the functions (in the same crate) it calls.

Functions are identified by their index within the crate. Use GlobalEnv::spec_funcs to get the spec functions of the crate a FluxDefId belongs to.

Fields§

§funcs: FxIndexMap<FluxId<DefIndex>, SpecFunc>

Implementations§

Source§

impl SpecFuncs

Source

pub fn new( funcs: Vec<(FluxLocalDefId, SpecFunc)>, ) -> Result<Self, Vec<FluxLocalDefId>>

Sorts the spec functions of the local crate topologically. Returns Err(cycle) if there’s a cycle in the functions.

Source

pub fn get(&self, id: FluxId<DefIndex>) -> &SpecFunc

Source

pub fn rank(&self, id: FluxId<DefIndex>) -> usize

The position of the function in the topological order. A function can only call functions in the same crate with a lower rank.

Trait Implementations§

Source§

impl<'tcx, __D: TyDecoder<'tcx>> Decodable<__D> for SpecFuncs

Source§

fn decode(__decoder: &mut __D) -> Self

Source§

impl Default for SpecFuncs

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'tcx, __E: TyEncoder<'tcx>> Encodable<__E> for SpecFuncs

Source§

fn encode(&self, __encoder: &mut __E)

Auto Trait Implementations§

§

impl DynSend for SpecFuncs

§

impl DynSync for SpecFuncs

§

impl Freeze for SpecFuncs

§

impl RefUnwindSafe for SpecFuncs

§

impl Send for SpecFuncs

§

impl Sync for SpecFuncs

§

impl Unpin for SpecFuncs

§

impl UnsafeUnpin for SpecFuncs

§

impl UnwindSafe for SpecFuncs

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
§

impl<K> IntoQueryKey<K> for K

§

fn into_query_key(self) -> K

Argument conversion from Self to K. This should always be a very cheap conversion, e.g. [LocalDefId::to_def_id].
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more