[−][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: FnSelfUseKind<'tcx>PatUse(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(in borrow_check) fn args_or_use(
self
) -> Span[src]
self
) -> Span
pub(in borrow_check) fn var_or_use(
self
) -> Span[src]
self
) -> Span
pub(in borrow_check) fn generator_kind(
self
) -> Option<GeneratorKind>[src]
self
) -> Option<GeneratorKind>
pub(in borrow_check) fn args_span_label(
self,
err: &mut DiagnosticBuilder<'_>,
message: impl Into<String>
)[src]
self,
err: &mut DiagnosticBuilder<'_>,
message: impl Into<String>
)
pub(in borrow_check) fn var_span_label(
self,
err: &mut DiagnosticBuilder<'_>,
message: impl Into<String>
)[src]
self,
err: &mut DiagnosticBuilder<'_>,
message: impl Into<String>
)
pub(in borrow_check) fn for_closure(
&self
) -> bool[src]
&self
) -> bool
Returns false if this place is not used in a closure.
pub(in borrow_check) fn for_generator(
&self
) -> bool[src]
&self
) -> bool
Returns false if this place is not used in a generator.
pub(in borrow_check) fn describe(
&self
) -> String[src]
&self
) -> String
Describe the span associated with a use of a place.
pub(in borrow_check) 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<'tcx> Clone for UseSpans<'tcx>[src]
impl<'tcx> Copy for UseSpans<'tcx>[src]
impl<'tcx> Debug for UseSpans<'tcx>[src]
impl<'tcx> Eq for UseSpans<'tcx>[src]
impl<'tcx> PartialEq<UseSpans<'tcx>> for UseSpans<'tcx>[src]
pub fn eq(&self, other: &UseSpans<'tcx>) -> bool[src]
pub fn ne(&self, other: &UseSpans<'tcx>) -> bool[src]
impl<'tcx> StructuralEq for UseSpans<'tcx>[src]
impl<'tcx> StructuralPartialEq for UseSpans<'tcx>[src]
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for UseSpans<'tcx>
impl<'tcx> !Send for UseSpans<'tcx>
impl<'tcx> !Sync for UseSpans<'tcx>
impl<'tcx> Unpin for UseSpans<'tcx>
impl<'tcx> !UnwindSafe for UseSpans<'tcx>
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,
pub 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.
pub fn to_owned(&self) -> T[src]
pub 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.
pub 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.