Enum rustc_borrowck::diagnostics::UseSpans[][src]

pub(crate) enum UseSpans<'tcx> {
    ClosureUse {
        generator_kind: Option<GeneratorKind>,
        args_span: Span,
        capture_kind_span: Span,
        path_span: Span,
    },
    FnSelfUse {
        var_span: Span,
        fn_call_span: Span,
        fn_span: Span,
        kind: FnSelfUseKind<'tcx>,
    },
    PatUse(Span),
    OtherUse(Span),
}
Expand description

The span(s) associated to a use of a place.

Variants

ClosureUse

The access is caused by capturing a variable for a closure.

Fields of ClosureUse

generator_kind: Option<GeneratorKind>

This is true if the captured variable was from a generator.

args_span: Span

The span of the args of the closure, including the move keyword if it’s present.

capture_kind_span: Span

The span of the use resulting in capture kind Check ty::CaptureInfo for more details

path_span: Span

The span of the use resulting in the captured path Check ty::CaptureInfo for more details

FnSelfUse

The access is caused by using a variable as the receiver of a method that takes ‘self’

Fields of FnSelfUse

var_span: Span

The span of the variable being moved

fn_call_span: Span

The span of the method call on the variable

fn_span: Span

The definition span of the method being called

kind: FnSelfUseKind<'tcx>
PatUse(Span)

This access is caused by a match or if let pattern.

Tuple Fields of PatUse

0: Span
OtherUse(Span)

This access has a single span associated to it: common case.

Tuple Fields of OtherUse

0: Span

Implementations

Returns the span of self, in the case of a ClosureUse returns the path_span

Returns the span of self, in the case of a ClosureUse returns the capture_kind_span

Returns false if this place is not used in a closure.

Returns false if this place is not used in a generator.

Describe the span associated with a use of a place.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

Size for each variant: