Struct rustc_resolve::late::DiagnosticMetadata[−][src]

struct DiagnosticMetadata<'ast> {
    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_let_binding: Option<(Span, Option<Span>, Option<Span>)>,
    in_if_condition: Option<&'ast Expr>,
    current_trait_object: Option<&'ast [GenericBound]>,
    current_where_predicate: Option<&'ast WherePredicate>,
}

Fields

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

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

current_self_type: Option<Ty>
Expand description

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

current_self_item: Option<NodeId>
Expand description

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

current_item: Option<&'ast Item>
Expand description

The current trait (used to suggest).

currently_processing_generics: bool
Expand description

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

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

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

unused_labels: FxHashMap<NodeId, Span>
Expand description

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>
Expand description

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

current_let_binding: Option<(Span, Option<Span>, Option<Span>)>
Expand description

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

in_if_condition: Option<&'ast Expr>
Expand description

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

current_trait_object: Option<&'ast [GenericBound]>
Expand description

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>
Expand description

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

Trait Implementations

impl<'ast> Default for DiagnosticMetadata<'ast>[src]

fn default() -> DiagnosticMetadata<'ast>[src]

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

Auto Trait Implementations

impl<'ast> !RefUnwindSafe for DiagnosticMetadata<'ast>

impl<'ast> !Send for DiagnosticMetadata<'ast>

impl<'ast> !Sync for DiagnosticMetadata<'ast>

impl<'ast> Unpin for DiagnosticMetadata<'ast>

impl<'ast> !UnwindSafe for DiagnosticMetadata<'ast>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.