about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoseph Post <joe@jcpst.com>2018-09-20 20:06:03 -0500
committerJoseph Post <joe@jcpst.com>2018-09-20 21:16:33 -0500
commit7f9a259d3f05ad49bc7ebec462e6f134da6bb3ed (patch)
treeeb476b56e0e42074a1719a56afe92f0a9df77510
parent3bc2ca7e4f8507f82a4c357ee19300166bcd8099 (diff)
downloadrust-7f9a259d3f05ad49bc7ebec462e6f134da6bb3ed.tar.gz
rust-7f9a259d3f05ad49bc7ebec462e6f134da6bb3ed.zip
add applicability to span suggestion call
-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,
                         );
                     }
                 }