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,
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?
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: 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.
lint_buffer: &'a mut LintBufferImplementations
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_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 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