Struct rustc_ast_passes::ast_validation::AstValidator[][src]

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>,
    is_tilde_const_allowed: bool,
    is_impl_trait_banned: bool,
    is_assoc_ty_bound_banned: bool,
    is_let_allowed: bool,
    lint_buffer: &'a mut LintBuffer,
}

Fields

session: &'a Sessionextern_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: boolhas_proc_macro_decls: boolouter_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>.

is_tilde_const_allowed: boolis_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.

is_let_allowed: bool

Used to allow let expressions in certain syntactic locations.

lint_buffer: &'a mut LintBuffer

Implementations

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

Matches '-' lit | lit (cf. parser::Parser::parse_literal_maybe_minus), or paths for ranges.

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

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-varadic 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

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

Performs the conversion.

Performs the conversion.

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: 48 bytes