diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index 7c2d5ba094f..072f94661e4 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -1214,7 +1214,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { db.span_label( let_span, format!("consider changing this to `{}`", - snippet.replace("ref ", "ref mut ")) + snippet.replacen("ref ", "ref mut ", 1)) ); } }