diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2022-01-18 16:38:06 -0800 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2022-01-18 16:38:06 -0800 |
| commit | 7c4eca06871f83257f9f503c3a91a8946026133a (patch) | |
| tree | 56c854c44e1c5b3add0e8289f72c15b0cd9641b2 /compiler | |
| parent | 7507fb6306d540a6f07f6f325d25925311b037a2 (diff) | |
| download | rust-7c4eca06871f83257f9f503c3a91a8946026133a.tar.gz rust-7c4eca06871f83257f9f503c3a91a8946026133a.zip | |
Make suggestions verbose
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_typeck/src/check/op.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/rustc_typeck/src/check/op.rs b/compiler/rustc_typeck/src/check/op.rs index 82da66c09e4..81662b752b7 100644 --- a/compiler/rustc_typeck/src/check/op.rs +++ b/compiler/rustc_typeck/src/check/op.rs @@ -570,14 +570,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { err.span_label(op.span, "`+` cannot be used to concatenate two `&str` strings"); err.note(str_concat_note); if let hir::ExprKind::AddrOf(_, _, lhs_inner_expr) = lhs_expr.kind { - err.span_suggestion( + err.span_suggestion_verbose( lhs_expr.span.until(lhs_inner_expr.span), rm_borrow_msg, "".to_owned(), Applicability::MachineApplicable ); } else { - err.span_suggestion( + err.span_suggestion_verbose( lhs_expr.span.shrink_to_hi(), to_owned_msg, ".to_owned()".to_owned(), @@ -608,7 +608,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { lhs_sugg, (rhs_expr.span.shrink_to_lo(), "&".to_owned()), ]; - err.multipart_suggestion(sugg_msg, suggestions, Applicability::MachineApplicable); + err.multipart_suggestion_verbose( + sugg_msg, + suggestions, + Applicability::MachineApplicable, + ); } IsAssign::Yes => { err.note(str_concat_note); |
