struct DerefDelegate<'a, 'tcx> {
    cx: &'a LateContext<'tcx>,
    closure_span: Span,
    closure_arg_is_type_annotated_double_ref: bool,
    next_pos: BytePos,
    suggestion_start: String,
    applicability: Applicability,
}
Expand description

Visitor struct used for tracking down dereferencing and borrowing of closure’s args

Fields§

§cx: &'a LateContext<'tcx>

The late context of the lint

§closure_span: Span

The span of the input closure to adapt

§closure_arg_is_type_annotated_double_ref: bool

Indicates if the arg of the closure is a type annotated double reference

§next_pos: BytePos

last position of the span to gradually build the suggestion

§suggestion_start: String

starting part of the gradually built suggestion

§applicability: Applicability

confidence on the built suggestion

Implementations§

build final suggestion:

  • create the ending part of suggestion
  • concatenate starting and ending parts
  • potentially remove needless borrowing

indicates whether the function from parent_expr takes its args by double reference

Trait Implementations§

The value found at place is moved, depending on mode. Where diag_expr_id is the id used for diagnostics for place. Read more
The value found at place is being borrowed with kind bk. diag_expr_id is the id used for diagnostics (see consume for more details). Read more
The path at assignee_place is being assigned to. diag_expr_id is the id used for diagnostics (see consume for more details). Read more
The place should be a fake read because of specified cause.
The value found at place is being copied. diag_expr_id is the id used for diagnostics (see consume for more details). Read more
The path at binding_place is a binding that is being initialized. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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