[−][src]Function rustc_mir::borrow_check::diagnostics::mutability_errors::annotate_struct_field

pub(in borrow_check::diagnostics::mutability_errors) fn annotate_struct_field<'tcx>(
    tcx: TyCtxt<'tcx>,
    ty: Ty<'tcx>,
    field: &Field
) -> Option<(Span, String)>

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