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

struct AstValidator<'a> {
    session: &'a Session,
    extern_mod: Option<&'a Item>,
    in_trait_impl: bool,
    has_proc_macro_decls: bool,
    outer_impl_trait: Option<Span>,
    bound_context: Option<BoundContext>,
    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?

has_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>.

bound_context: Option<BoundContext>

Keeps track of the BoundContext as we recurse.

This is used to forbid ?const Trait bounds in, e.g., impl Iterator<Item = Box<dyn ?const Trait>.

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.

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.

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 be different between compiler versions and platforms. 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