about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-09-22 09:56:38 +0200
committerGitHub <noreply@github.com>2018-09-22 09:56:38 +0200
commit394d687121edbef644c158e6dcfacdb0f88c9618 (patch)
tree8229bd58d3ec47e3653b75a8fe59a64c4e531c98
parent1eee532eff23b6f0363d615013dd0d39d0cc06ae (diff)
parent7f9a259d3f05ad49bc7ebec462e6f134da6bb3ed (diff)
Rollup merge of #54412 - jcpst:replace_span_suggestion, r=estebank
add applicability to span_suggestion call

Found another `span_suggestion` call. Issue #50723

r? @estebank
-rw-r--r--src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
index dfed41cb1de..67e4394c9aa 100644
--- a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
+++ b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
@@ -22,6 +22,7 @@ use std::collections::VecDeque;
 use std::fmt;
 use syntax::symbol::keywords;
 use syntax_pos::Span;
+use syntax::errors::Applicability;
 
 mod region_name;
 mod var_name;
@@ -540,7 +541,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
                             RegionName::Named(name) => format!("{}", name),
                             RegionName::Synthesized(_) => "'_".to_string(),
                         };
-                        diag.span_suggestion(
+                        diag.span_suggestion_with_applicability(
                             span,
                             &format!(
                                 "to allow this impl Trait to capture borrowed data with lifetime \
@@ -548,6 +549,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
                                 fr_name, suggestable_fr_name,
                             ),
                             format!("{} + {}", snippet, suggestable_fr_name),
+                            Applicability::MachineApplicable,
                         );
                     }
                 }