struct AstValidator<'a> {
    session: &'a Session,
    extern_mod: Option<&'a Item>,
    in_trait_impl: bool,
    in_const_trait_impl: bool,
    has_proc_macro_decls: bool,
    outer_impl_trait: Option<Span>,
    disallow_tilde_const: Option<DisallowTildeConstContext<'a>>,
    is_impl_trait_banned: bool,
    is_assoc_ty_bound_banned: bool,
    forbidden_let_reason: Option<ForbiddenLetReason>,
    lint_buffer: &'a mut LintBuffer,
}

Fields§

§session: &'a Session§extern_mod: Option<&'a Item>

The span of the extern in an extern { ... } block, if any.

§in_trait_impl: bool

Are we inside a trait impl?

§in_const_trait_impl: bool§has_proc_macro_decls: bool§outer_impl_trait: Option<Span>

Used to ban nested impl Trait, e.g., impl Into<impl Debug>. Nested impl Trait is allowed in associated type position, e.g., impl Iterator<Item = impl Debug>.

§disallow_tilde_const: Option<DisallowTildeConstContext<'a>>§is_impl_trait_banned: bool

Used to ban impl Trait in path projections like <impl Iterator>::Item or Foo::Bar<impl Trait>

§is_assoc_ty_bound_banned: bool

Used to ban associated type bounds (i.e., Type<AssocType: Bounds>) in certain positions.

§forbidden_let_reason: Option<ForbiddenLetReason>§lint_buffer: &'a mut LintBuffer

Implementations§

Emits an error banning the let expression provided in the given location.

Emits fatal error if function declaration has more than u16::MAX arguments Error is fatal to prevent errors during typechecking

If sp ends with a semicolon, returns it as a Span Otherwise, returns sp.shrink_to_hi()

An fn in extern { ... } cannot have a body { ... }.

An fn in extern { ... } cannot have qualifiers, e.g. async fn.

An item in extern { ... } cannot use non-ascii identifier.

Reject C-variadic type unless the function is foreign, or free and unsafe extern "C" semantically.

Enforce generic args coming before constraints in <...> of a path segment.

Trait Implementations§

This method is a hack to workaround unstable of stmt_expr_attributes. It can be removed once that feature is stabilized. Read more
source§

fn visit_expr_post(&mut self, _ex: &'ast Expr)

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 104 bytes