struct DiagnosticMetadata<'ast> {
Show 19 fields current_trait_assoc_items: Option<&'ast [P<AssocItem>]>, current_self_type: Option<Ty>, current_self_item: Option<NodeId>, current_item: Option<&'ast Item>, currently_processing_generics: bool, current_function: Option<(FnKind<'ast>, Span)>, unused_labels: FxHashMap<NodeId, Span>, current_type_ascription: Vec<Span>, current_block_could_be_bare_struct_literal: Option<Span>, current_let_binding: Option<(Span, Option<Span>, Option<Span>)>, in_if_condition: Option<&'ast Expr>, in_assignment: Option<&'ast Expr>, is_assign_rhs: bool, current_trait_object: Option<&'ast [GenericBound]>, current_where_predicate: Option<&'ast WherePredicate>, current_type_path: Option<&'ast Ty>, current_impl_items: Option<&'ast [P<AssocItem>]>, currently_processing_impl_trait: Option<(TraitRef, Ty)>, current_elision_failures: Vec<MissingLifetime>,
}

Fields§

§current_trait_assoc_items: Option<&'ast [P<AssocItem>]>

The current trait’s associated items’ ident, used for diagnostic suggestions.

§current_self_type: Option<Ty>

The current self type if inside an impl (used for better errors).

§current_self_item: Option<NodeId>

The current self item if inside an ADT (used for better errors).

§current_item: Option<&'ast Item>

The current trait (used to suggest).

§currently_processing_generics: bool

When processing generics and encountering a type not found, suggest introducing a type param.

§current_function: Option<(FnKind<'ast>, Span)>

The current enclosing (non-closure) function (used for better errors).

§unused_labels: FxHashMap<NodeId, Span>

A list of labels as of yet unused. Labels will be removed from this map when they are used (in a break or continue statement)

§current_type_ascription: Vec<Span>

Only used for better errors on fn(): fn().

§current_block_could_be_bare_struct_literal: Option<Span>

Only used for better errors on let x = { foo: bar };. In the case of a parse error with let x = { foo: bar, };, this isn’t needed, it’s only needed for cases where this parses as a correct type ascription.

§current_let_binding: Option<(Span, Option<Span>, Option<Span>)>

Only used for better errors on let <pat>: <expr, not type>;.

§in_if_condition: Option<&'ast Expr>

Used to detect possible if let written without let and to provide structured suggestion.

§in_assignment: Option<&'ast Expr>

Used to detect possible new binding written without let and to provide structured suggestion.

§is_assign_rhs: bool§current_trait_object: Option<&'ast [GenericBound]>

If we are currently in a trait object definition. Used to point at the bounds when encountering a struct or enum.

§current_where_predicate: Option<&'ast WherePredicate>

Given where <T as Bar>::Baz: String, suggest where T: Bar<Baz = String>.

§current_type_path: Option<&'ast Ty>§current_impl_items: Option<&'ast [P<AssocItem>]>

The current impl items (used to suggest).

§currently_processing_impl_trait: Option<(TraitRef, Ty)>

When processing impl trait

§current_elision_failures: Vec<MissingLifetime>

Accumulate the errors due to missed lifetime elision, and report them all at once for each function.

Trait Implementations§

Returns the “default value” for a type. Read more

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