Enum rustc_borrowck::diagnostics::FnSelfUseKind
source · [−]pub(crate) enum FnSelfUseKind<'tcx> {
Normal {
self_arg: Ident,
implicit_into_iter: bool,
is_option_or_result: bool,
},
FnOnceCall,
Operator {
self_arg: Ident,
},
DerefCoercion {
deref_target: Span,
deref_target_ty: Ty<'tcx>,
},
}Variants
Normal
Fields
self_arg: Identimplicit_into_iter: boolis_option_or_result: boolWhether the self type of the method call has an .as_ref() method.
Used for better diagnostics.
A normal method call of the form receiver.foo(a, b, c)
FnOnceCall
A call to FnOnce::call_once, desugared from my_closure(a, b, c)
Operator
Fields
self_arg: IdentA call to an operator trait, desuraged from operator syntax (e.g. a << b)
DerefCoercion
Fields
deref_target: SpanThe Span of the Target associated type
in the Deref impl we are using.
deref_target_ty: Ty<'tcx>The type T::Deref we are dereferencing to
Trait Implementations
sourceimpl<'tcx> Clone for FnSelfUseKind<'tcx>
impl<'tcx> Clone for FnSelfUseKind<'tcx>
sourcefn clone(&self) -> FnSelfUseKind<'tcx>
fn clone(&self) -> FnSelfUseKind<'tcx>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<'tcx> Debug for FnSelfUseKind<'tcx>
impl<'tcx> Debug for FnSelfUseKind<'tcx>
sourceimpl<'tcx> PartialEq<FnSelfUseKind<'tcx>> for FnSelfUseKind<'tcx>
impl<'tcx> PartialEq<FnSelfUseKind<'tcx>> for FnSelfUseKind<'tcx>
sourcefn eq(&self, other: &FnSelfUseKind<'tcx>) -> bool
fn eq(&self, other: &FnSelfUseKind<'tcx>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &FnSelfUseKind<'tcx>) -> bool
fn ne(&self, other: &FnSelfUseKind<'tcx>) -> bool
This method tests for !=.
impl<'tcx> Copy for FnSelfUseKind<'tcx>
impl<'tcx> Eq for FnSelfUseKind<'tcx>
impl<'tcx> StructuralEq for FnSelfUseKind<'tcx>
impl<'tcx> StructuralPartialEq for FnSelfUseKind<'tcx>
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for FnSelfUseKind<'tcx>
impl<'tcx> !Send for FnSelfUseKind<'tcx>
impl<'tcx> !Sync for FnSelfUseKind<'tcx>
impl<'tcx> Unpin for FnSelfUseKind<'tcx>
impl<'tcx> !UnwindSafe for FnSelfUseKind<'tcx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
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: 24 bytes
Size for each variant:
Normal: 15 bytesFnOnceCall: 0 bytesOperator: 15 bytesDerefCoercion: 23 bytes