[−][src]Enum rustc_mir::borrow_check::diagnostics::UseSpans
The span(s) associated to a use of a place.
Variants
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: SpanThe span of the args of the closure, including the move keyword if
it's present.
var_span: SpanThe span of the first use of the captured variable inside the closure.
The access is caused by using a variable as the receiver of a method that takes 'self'
Fields of FnSelfUse
var_span: SpanThe span of the variable being moved
fn_call_span: SpanThe span of the method call on the variable
fn_span: SpanThe definition span of the method being called
kind: FnSelfUseKindPatUse(Span)This access is caused by a match or if let pattern.
OtherUse(Span)This access has a single span associated to it: common case.
Implementations
impl UseSpans[src]
pub(super) fn args_or_use(
self
) -> Span[src]
self
) -> Span
pub(super) fn var_or_use(
self
) -> Span[src]
self
) -> Span
pub(super) fn generator_kind(
self
) -> Option<GeneratorKind>[src]
self
) -> Option<GeneratorKind>
pub(super) fn args_span_label(
self,
err: &mut DiagnosticBuilder<'_>,
message: impl Into<String>
)[src]
self,
err: &mut DiagnosticBuilder<'_>,
message: impl Into<String>
)
pub(super) fn var_span_label(
self,
err: &mut DiagnosticBuilder<'_>,
message: impl Into<String>
)[src]
self,
err: &mut DiagnosticBuilder<'_>,
message: impl Into<String>
)
pub(super) fn for_closure(
&self
) -> bool[src]
&self
) -> bool
Returns false if this place is not used in a closure.
pub(super) fn for_generator(
&self
) -> bool[src]
&self
) -> bool
Returns false if this place is not used in a generator.
pub(super) fn describe(
&self
) -> String[src]
&self
) -> String
Describe the span associated with a use of a place.
pub(super) fn or_else<F>(
self,
if_other: F
) -> Self where
F: FnOnce() -> Self, [src]
self,
if_other: F
) -> Self where
F: FnOnce() -> Self,
Trait Implementations
impl Clone for UseSpans[src]
impl Copy for UseSpans[src]
impl Debug for UseSpans[src]
impl Eq for UseSpans[src]
impl PartialEq<UseSpans> for UseSpans[src]
impl StructuralEq for UseSpans[src]
impl StructuralPartialEq for UseSpans[src]
Auto Trait Implementations
impl RefUnwindSafe for UseSpans
impl !Send for UseSpans
impl !Sync for UseSpans
impl Unpin for UseSpans
impl UnwindSafe for UseSpans
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.