Enum rustc_mir::borrow_check::diagnostics::UseSpans [−][src]
pub(super) 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
Expand description
The access is caused by capturing a variable for a closure.
Show fields
Fields of ClosureUse
generator_kind: Option<GeneratorKind>Expand description
This is true if the captured variable was from a generator.
args_span: SpanExpand description
The span of the args of the closure, including the move keyword if
it’s present.
capture_kind_span: SpanExpand description
The span of the use resulting in capture kind
Check ty::CaptureInfo for more details
path_span: SpanExpand description
The span of the use resulting in the captured path
Check ty::CaptureInfo for more details
Expand description
The access is caused by using a variable as the receiver of a method that takes ‘self’
Show fields
Fields of FnSelfUse
var_span: SpanExpand description
The span of the variable being moved
fn_call_span: SpanExpand description
The span of the method call on the variable
fn_span: SpanExpand description
The definition span of the method being called
kind: FnSelfUseKind<'tcx>PatUse(Span)Expand description
This access is caused by a match or if let pattern.
OtherUse(Span)Expand description
This access has a single span associated to it: common case.
Implementations
impl UseSpans<'_>[src]
impl UseSpans<'_>[src]pub(super) fn args_or_use(self) -> Span[src]
pub(super) fn var_or_use_path_span(self) -> Span[src]
pub(super) fn var_or_use_path_span(self) -> Span[src]Returns the span of self, in the case of a ClosureUse returns the path_span
pub(super) fn var_or_use(self) -> Span[src]
pub(super) fn var_or_use(self) -> Span[src]Returns the span of self, in the case of a ClosureUse returns the capture_kind_span
pub(super) fn generator_kind(self) -> Option<GeneratorKind>[src]
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_path_only(
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>,
kind_desc: impl Into<String>
)[src]
self,
err: &mut DiagnosticBuilder<'_>,
message: impl Into<String>,
kind_desc: impl Into<String>
)
pub(super) fn for_closure(&self) -> bool[src]
pub(super) fn for_closure(&self) -> bool[src]Returns false if this place is not used in a closure.
pub(super) fn for_generator(&self) -> bool[src]
pub(super) fn for_generator(&self) -> bool[src]Returns false if this place is not used in a generator.
pub(super) fn or_else<F>(self, if_other: F) -> Self where
F: FnOnce() -> Self, [src]
F: FnOnce() -> Self,
Trait Implementations
impl<'tcx> Copy for UseSpans<'tcx>[src]
impl<'tcx> Eq for UseSpans<'tcx>[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> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> WithConstness for T[src]
impl<T> WithConstness for T[src]