charon_lib::transform::check_generics

Struct CheckGenericsVisitor

source
struct CheckGenericsVisitor<'a> {
    ctx: &'a TransformCtx,
    val_fmt_ctx: FmtCtx<'a>,
    phase: &'static str,
    span: Span,
    visit_stack: Vec<&'static str>,
}

Fields§

§ctx: &'a TransformCtx§val_fmt_ctx: FmtCtx<'a>§phase: &'static str§span: Span§visit_stack: Vec<&'static str>

Remember the names of the types visited up to here.

Implementations§

source§

impl CheckGenericsVisitor<'_>

source

fn error(&self, message: impl Display)

source

fn zip_assert_match<I, A, B, FmtA, FmtB>( &self, a: &Vector<I, A>, b: &Vector<I, B>, a_fmt: &FmtA, b_fmt: &FmtB, kind: &str, check_inner: impl Fn(&A, &B), )
where I: Idx, A: for<'a> FmtWithCtx<FmtA>, B: for<'a> FmtWithCtx<FmtB>,

source

fn assert_clause_matches( &self, params_fmt: &FmtCtx<'_>, tclause: &TraitClause, tref: &TraitRef, )

source

fn assert_matches( &self, params_fmt: &FmtCtx<'_>, params: &GenericParams, args: &GenericArgs, )

Trait Implementations§

source§

impl VisitAst for CheckGenericsVisitor<'_>

source§

fn visit<'a, T: AstVisitable>(&'a mut self, x: &T) -> ControlFlow<Self::Break>

Visit a visitable type. This calls the appropriate method of this trait on x (visit_$ty if it exists, visit_inner if not).
source§

fn visit_binder<T: AstVisitable>( &mut self, binder: &Binder<T>, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn visit_region_binder<T: AstVisitable>( &mut self, binder: &RegionBinder<T>, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn visit_aggregate_kind( &mut self, agg: &AggregateKind, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_generic_args(&mut self, args: &GenericArgs)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn enter_trait_impl(&mut self, timpl: &TraitImpl)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn visit_ullbc_statement(&mut self, st: &Statement) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn visit_llbc_statement(&mut self, st: &Statement) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn visit_by_val<T: AstVisitable>(self, x: &T) -> ControlFlow<Self::Break, Self>

Convenience alias for method chaining.
source§

fn visit_by_val_infallible<T: AstVisitable>(self, x: &T) -> Self
where Self: Visitor<Break = Infallible> + Sized,

Convenience when the visitor does not return early.
source§

fn visit_inner<T>(&mut self, x: &T) -> ControlFlow<Self::Break>
where T: for<'s> Drive<'s, AstVisitableWrapper<Self>>,

Visit the contents of x. This calls self.visit() on each field of T. This is available for any type whose contents are all #trait_name.
source§

fn visit_de_bruijn_id(&mut self, x: &DeBruijnId) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_de_bruijn_id(&mut self, x: &DeBruijnId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_de_bruijn_id(&mut self, x: &DeBruijnId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_ty(&mut self, x: &Ty) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_ty(&mut self, x: &Ty)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_ty(&mut self, x: &Ty)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_region(&mut self, x: &Region) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_region(&mut self, x: &Region)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_region(&mut self, x: &Region)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_const_generic(&mut self, x: &ConstGeneric) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_const_generic(&mut self, x: &ConstGeneric)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_const_generic(&mut self, x: &ConstGeneric)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_trait_ref(&mut self, x: &TraitRef) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_trait_ref(&mut self, x: &TraitRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_trait_ref(&mut self, x: &TraitRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_fun_decl_ref(&mut self, x: &FunDeclRef) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_fun_decl_ref(&mut self, x: &FunDeclRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_fun_decl_ref(&mut self, x: &FunDeclRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_global_decl_ref( &mut self, x: &GlobalDeclRef, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_global_decl_ref(&mut self, x: &GlobalDeclRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_global_decl_ref(&mut self, x: &GlobalDeclRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_trait_decl_ref(&mut self, x: &TraitDeclRef) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_trait_decl_ref(&mut self, x: &TraitDeclRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_trait_decl_ref(&mut self, x: &TraitDeclRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_trait_impl_ref(&mut self, x: &TraitImplRef) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_trait_impl_ref(&mut self, x: &TraitImplRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_trait_impl_ref(&mut self, x: &TraitImplRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_generic_args(&mut self, x: &GenericArgs) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn exit_generic_args(&mut self, x: &GenericArgs)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_generic_params( &mut self, x: &GenericParams, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_generic_params(&mut self, x: &GenericParams)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_generic_params(&mut self, x: &GenericParams)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_de_bruijn_var<T: AstVisitable + Idx>( &mut self, x: &DeBruijnVar<T>, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_de_bruijn_var<T: AstVisitable + Idx>(&mut self, x: &DeBruijnVar<T>)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_de_bruijn_var<T: AstVisitable + Idx>(&mut self, x: &DeBruijnVar<T>)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn enter_region_binder<T: AstVisitable>(&mut self, x: &RegionBinder<T>)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_region_binder<T: AstVisitable>(&mut self, x: &RegionBinder<T>)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn enter_binder<T: AstVisitable>(&mut self, x: &Binder<T>)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_binder<T: AstVisitable>(&mut self, x: &Binder<T>)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn enter_llbc_statement(&mut self, x: &Statement)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_llbc_statement(&mut self, x: &Statement)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn enter_ullbc_statement(&mut self, x: &Statement)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_ullbc_statement(&mut self, x: &Statement)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn enter_aggregate_kind(&mut self, x: &AggregateKind)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_aggregate_kind(&mut self, x: &AggregateKind)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_fn_ptr(&mut self, x: &FnPtr) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_fn_ptr(&mut self, x: &FnPtr)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_fn_ptr(&mut self, x: &FnPtr)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_item_kind(&mut self, x: &ItemKind) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_item_kind(&mut self, x: &ItemKind)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_item_kind(&mut self, x: &ItemKind)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_item_meta(&mut self, x: &ItemMeta) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_item_meta(&mut self, x: &ItemMeta)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_item_meta(&mut self, x: &ItemMeta)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_span(&mut self, x: &Span) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_span(&mut self, x: &Span)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_span(&mut self, x: &Span)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_fun_decl_id(&mut self, x: &FunDeclId) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_fun_decl_id(&mut self, x: &FunDeclId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_fun_decl_id(&mut self, x: &FunDeclId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_global_decl_id(&mut self, x: &GlobalDeclId) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_global_decl_id(&mut self, x: &GlobalDeclId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_global_decl_id(&mut self, x: &GlobalDeclId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_type_decl_id(&mut self, x: &TypeDeclId) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_type_decl_id(&mut self, x: &TypeDeclId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_type_decl_id(&mut self, x: &TypeDeclId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_trait_decl_id(&mut self, x: &TraitDeclId) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_trait_decl_id(&mut self, x: &TraitDeclId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_trait_decl_id(&mut self, x: &TraitDeclId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_trait_impl_id(&mut self, x: &TraitImplId) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_trait_impl_id(&mut self, x: &TraitImplId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_trait_impl_id(&mut self, x: &TraitImplId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_fun_decl(&mut self, x: &FunDecl) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_fun_decl(&mut self, x: &FunDecl)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_fun_decl(&mut self, x: &FunDecl)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_global_decl(&mut self, x: &GlobalDecl) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_global_decl(&mut self, x: &GlobalDecl)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_global_decl(&mut self, x: &GlobalDecl)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_type_decl(&mut self, x: &TypeDecl) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_type_decl(&mut self, x: &TypeDecl)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_type_decl(&mut self, x: &TypeDecl)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_trait_decl(&mut self, x: &TraitDecl) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn enter_trait_decl(&mut self, x: &TraitDecl)

Called when starting to visit a $ty (unless visit_$ty is overriden).
source§

fn exit_trait_decl(&mut self, x: &TraitDecl)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

fn visit_trait_impl(&mut self, x: &TraitImpl) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $ty. When overriding this method, call self.visit_inner(x) to keep recursively visiting the type, or don’t call it if the contents of x should not be visited. Read more
source§

fn exit_trait_impl(&mut self, x: &TraitImpl)

Called when finished visiting a $ty (unless visit_$ty is overriden).
source§

impl<'a> Visitor for CheckGenericsVisitor<'a>

source§

type Break = Infallible

The type used for early-return, if the visitor supports it. Use an empty type like std::convert::Infallible if the visitor does not short-circuit.

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
§

impl<I, T> ExtractContext<I, ()> for T

§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. 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<I> RecreateContext<I> for I

§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. 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