Struct ExternSpecCollector

Source
pub(super) struct ExternSpecCollector<'a, 'sess, 'tcx> {
    inner: &'a mut SpecCollector<'sess, 'tcx>,
    block: &'tcx Block<'tcx>,
}

Fields§

§inner: &'a mut SpecCollector<'sess, 'tcx>§block: &'tcx Block<'tcx>

The block corresponding to the const _: () = { ... } annotated with flux::extern_spec

Implementations§

Source§

impl<'a, 'sess, 'tcx> ExternSpecCollector<'a, 'sess, 'tcx>

Source

pub(super) fn collect( inner: &'a mut SpecCollector<'sess, 'tcx>, body_id: BodyId, ) -> Result<(), ErrorGuaranteed>

Source

fn new( inner: &'a mut SpecCollector<'sess, 'tcx>, body_id: BodyId, ) -> Result<Self, ErrorGuaranteed>

Source

fn run(self) -> Result<(), ErrorGuaranteed>

Source

fn collect_extern_fn( &mut self, item: &Item<'_>, attrs: FluxAttrs, ) -> Result<(), ErrorGuaranteed>

Source

fn collect_extern_struct( &mut self, struct_id: OwnerId, variant: &VariantData<'_>, attrs: FluxAttrs, ) -> Result<(), ErrorGuaranteed>

Source

fn collect_extern_enum( &mut self, enum_id: OwnerId, enum_def: &EnumDef<'_>, attrs: FluxAttrs, ) -> Result<(), ErrorGuaranteed>

Source

fn collect_extern_impl( &mut self, impl_id: OwnerId, impl_: &Impl<'_>, attrs: FluxAttrs, ) -> Result<(), ErrorGuaranteed>

Source

fn collect_extern_impl_fn( &mut self, impl_of_trait: Option<DefId>, item: &ImplItemRef, attrs: FluxAttrs, ) -> Result<ExternImplItem, ErrorGuaranteed>

Source

fn collect_extern_trait( &mut self, trait_id: OwnerId, bounds: &GenericBounds<'_>, items: &[TraitItemRef], attrs: FluxAttrs, ) -> Result<(), ErrorGuaranteed>

Source

fn collect_extern_trait_fn( &mut self, extern_trait_id: DefId, item: &TraitItemRef, attrs: FluxAttrs, ) -> Result<(), ErrorGuaranteed>

Source

fn extract_extern_id_from_struct( &self, item: &Item<'_>, ) -> Result<DefId, ErrorGuaranteed>

Source

fn extract_extern_id_from_fn( &self, item: &Item<'_>, ) -> Result<DefId, ErrorGuaranteed>

Source

fn extract_extern_id_from_impl_fn( &self, impl_of_trait: Option<DefId>, item: &ImplItemRef, ) -> Result<ExternImplItem, ErrorGuaranteed>

Source

fn extract_extern_id_from_trait( &self, bounds: &GenericBounds<'_>, ) -> Result<DefId, ErrorGuaranteed>

Source

fn extract_extern_id_from_trait_fn( &self, trait_id: DefId, item: &TraitItemRef, ) -> Result<DefId, ErrorGuaranteed>

Source

fn extract_extern_id_from_impl( &self, impl_id: OwnerId, impl_: &Impl<'_>, ) -> Result<DefId, ErrorGuaranteed>

Source

fn extract_callee_from_body( &self, body_id: BodyId, ) -> Result<DefId, ErrorGuaranteed>

Source

fn item_at(&self, i: usize) -> Result<&'tcx Item<'tcx>, ErrorGuaranteed>

Returns the item inside the const block at position i starting from the end.

Source

fn insert_extern_id( &mut self, local_id: LocalDefId, extern_id: DefId, ) -> Result<(), ErrorGuaranteed>

Source

fn check_generics( &mut self, local_id: OwnerId, extern_id: DefId, ) -> Result<(), ErrorGuaranteed>

Source

fn malformed(&self) -> ErrorGuaranteed

Source

fn item_not_in_trait_impl( &self, local_id: OwnerId, extern_id: DefId, extern_impl_id: DefId, ) -> ErrorGuaranteed

Source

fn invalid_item_in_inherent_impl( &self, local_id: OwnerId, extern_id: DefId, ) -> ErrorGuaranteed

Source

fn invalid_impl_block(&self) -> ErrorGuaranteed

Source

fn cannot_resolve_trait_impl(&self) -> ErrorGuaranteed

Source

fn item_not_in_trait( &self, local_id: OwnerId, extern_id: DefId, extern_trait_id: DefId, ) -> ErrorGuaranteed

Source

fn emit<'b>(&'b self, err: impl Diagnostic<'b>) -> ErrorGuaranteed

Source

fn tcx(&self) -> TyCtxt<'tcx>

Auto Trait Implementations§

§

impl<'a, 'sess, 'tcx> Freeze for ExternSpecCollector<'a, 'sess, 'tcx>

§

impl<'a, 'sess, 'tcx> !RefUnwindSafe for ExternSpecCollector<'a, 'sess, 'tcx>

§

impl<'a, 'sess, 'tcx> !Send for ExternSpecCollector<'a, 'sess, 'tcx>

§

impl<'a, 'sess, 'tcx> !Sync for ExternSpecCollector<'a, 'sess, 'tcx>

§

impl<'a, 'sess, 'tcx> Unpin for ExternSpecCollector<'a, 'sess, 'tcx>

§

impl<'a, 'sess, 'tcx> !UnwindSafe for ExternSpecCollector<'a, 'sess, 'tcx>

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
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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