diff options
| author | Vitaly _Vi Shukela <vi0oss@gmail.com> | 2018-09-15 03:18:29 +0300 |
|---|---|---|
| committer | Vitaly _Vi Shukela <vi0oss@gmail.com> | 2018-09-16 21:42:46 +0300 |
| commit | b6fea3255c0954456b068db8d1cdb6af464dd651 (patch) | |
| tree | 91c30f2be1b21f795904575a622a658da25e5443 /src/librustc_borrowck | |
| parent | d3cba9b4b4959d63eaaf5ffd647e4a5fc6d43e17 (diff) | |
| download | rust-b6fea3255c0954456b068db8d1cdb6af464dd651.tar.gz rust-b6fea3255c0954456b068db8d1cdb6af464dd651.zip | |
Remove usages of span_suggestion without Applicability
Use Applicability::Unspecified for all of them instead.
Diffstat (limited to 'src/librustc_borrowck')
| -rw-r--r-- | src/librustc_borrowck/borrowck/mod.rs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index 828364734f4..0f07e1415bf 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -45,7 +45,7 @@ use rustc_data_structures::sync::Lrc; use std::hash::{Hash, Hasher}; use syntax::ast; use syntax_pos::{MultiSpan, Span}; -use errors::{Applicability, DiagnosticBuilder, DiagnosticId}; +use errors::{Applicability, DiagnosticBuilder, DiagnosticId, Applicability}; use rustc::hir; use rustc::hir::intravisit::{self, Visitor}; @@ -867,10 +867,12 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { }) = cmt.cat { db.note(fn_closure_msg); } else { - db.span_suggestion(sp, msg, suggestion); + db.span_suggestion_with_applicability( + sp, msg, suggestion, Applicability::Unspecified); } } else { - db.span_suggestion(sp, msg, suggestion); + db.span_suggestion_with_applicability( + sp, msg, suggestion, Applicability::Unspecified); } } _ => { @@ -1236,10 +1238,11 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { let let_span = self.tcx.hir.span(node_id); let suggestion = suggest_ref_mut(self.tcx, let_span); if let Some(replace_str) = suggestion { - db.span_suggestion( + db.span_suggestion_with_applicability( let_span, "use a mutable reference instead", replace_str, + Applicability::Unspecified, ); } } @@ -1292,11 +1295,12 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { )) = ty.map(|t| &t.node) { let borrow_expr_id = self.tcx.hir.get_parent_node(borrowed_node_id); - db.span_suggestion( + db.span_suggestion_with_applicability( self.tcx.hir.span(borrow_expr_id), "consider removing the `&mut`, as it is an \ immutable binding to a mutable reference", - snippet + snippet, + Applicability::Unspecified, ); } else { db.span_suggestion_with_applicability( @@ -1326,12 +1330,14 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { &cmt_path_or_string, capture_span, Origin::Ast) - .span_suggestion(err.span, + .span_suggestion_with_applicability(err.span, &format!("to force the closure to take ownership of {} \ (and any other referenced variables), \ use the `move` keyword", cmt_path_or_string), - suggestion) + suggestion, + Applicability::Unspecified, + ) .emit(); self.signal_error(); } |
