Function rustc_borrowck::diagnostics::mutability_errors::annotate_struct_field[][src]

fn annotate_struct_field<'tcx>(
    tcx: TyCtxt<'tcx>,
    ty: Ty<'tcx>,
    field: &Field
) -> Option<(Span, String)>
Expand description

Adds a suggestion to a struct definition given a field access to a local. This function expects the local to be a reference to a struct in order to produce a suggestion.

LL |     s: &'a String
   |        ---------- use `&'a mut String` here to make mutable