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: boolAre 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: boolUsed to ban impl Trait in path projections like <impl Iterator>::Item
or Foo::Bar<impl Trait>
is_assoc_ty_bound_banned: boolUsed to ban associated type bounds (i.e., Type<AssocType: Bounds>) in
certain positions.
is_let_allowed: boolUsed to allow let expressions in certain syntactic locations.
lint_buffer: &'a mut LintBufferImplementations
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_enum_def(
&mut self,
enum_definition: &'a EnumDef,
generics: &'a Generics,
item_id: NodeId,
_: Span
)
Auto Trait Implementations
impl<'a> !RefUnwindSafe for AstValidator<'a>
impl<'a> !Send for AstValidator<'a>
impl<'a> !Sync for AstValidator<'a>
impl<'a> Unpin for AstValidator<'a>
impl<'a> !UnwindSafe for AstValidator<'a>
Blanket Implementations
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