about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorVitaly _Vi Shukela <vi0oss@gmail.com>2018-09-15 14:58:25 +0300
committerVitaly _Vi Shukela <vi0oss@gmail.com>2018-09-16 21:43:06 +0300
commit959fc6116a9cc4835e798a6355e43a845b9f173b (patch)
treed5bd92ebc72b5c2d7f19fba77390b8cda5d4c432 /src/librustc_errors
parent4b05128114a45fafb459fc6538f1255c84ec52cf (diff)
downloadrust-959fc6116a9cc4835e798a6355e43a845b9f173b.tar.gz
rust-959fc6116a9cc4835e798a6355e43a845b9f173b.zip
Deprecate *_suggestion* that are without explicit applicability
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/diagnostic.rs4
-rw-r--r--src/librustc_errors/diagnostic_builder.rs11
2 files changed, 15 insertions, 0 deletions
diff --git a/src/librustc_errors/diagnostic.rs b/src/librustc_errors/diagnostic.rs
index aebfce0bf2d..6102d18ba62 100644
--- a/src/librustc_errors/diagnostic.rs
+++ b/src/librustc_errors/diagnostic.rs
@@ -232,6 +232,7 @@ impl Diagnostic {
     /// inline it will only show the text message and not the text.
     ///
     /// See `CodeSuggestion` for more information.
+    #[deprecated(note = "Use `span_suggestion_short_with_applicability`")]
     pub fn span_suggestion_short(&mut self, sp: Span, msg: &str, suggestion: String) -> &mut Self {
         self.suggestions.push(CodeSuggestion {
             substitutions: vec![Substitution {
@@ -263,6 +264,7 @@ impl Diagnostic {
     /// * may contain a name of a function, variable or type, but not whole expressions
     ///
     /// See `CodeSuggestion` for more information.
+    #[deprecated(note = "Use `span_suggestion_with_applicability`")]
     pub fn span_suggestion(&mut self, sp: Span, msg: &str, suggestion: String) -> &mut Self {
         self.suggestions.push(CodeSuggestion {
             substitutions: vec![Substitution {
@@ -298,6 +300,7 @@ impl Diagnostic {
         self
     }
 
+    #[deprecated(note = "Use `multipart_suggestion_with_applicability`")]
     pub fn multipart_suggestion(
         &mut self,
         msg: &str,
@@ -311,6 +314,7 @@ impl Diagnostic {
     }
 
     /// Prints out a message with multiple suggested edits of the code.
+    #[deprecated(note = "Use `span_suggestions_with_applicability`")]
     pub fn span_suggestions(&mut self, sp: Span, msg: &str, suggestions: Vec<String>) -> &mut Self {
         self.suggestions.push(CodeSuggestion {
             substitutions: suggestions.into_iter().map(|snippet| Substitution {
diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs
index 79acf468916..4287b37ac54 100644
--- a/src/librustc_errors/diagnostic_builder.rs
+++ b/src/librustc_errors/diagnostic_builder.rs
@@ -41,6 +41,7 @@ macro_rules! forward {
     // Forward pattern for &self -> &Self
     (pub fn $n:ident(&self, $($name:ident: $ty:ty),*) -> &Self) => {
         pub fn $n(&self, $($name: $ty),*) -> &Self {
+            #[allow(deprecated)]
             self.diagnostic.$n($($name),*);
             self
         }
@@ -49,6 +50,7 @@ macro_rules! forward {
     // Forward pattern for &mut self -> &mut Self
     (pub fn $n:ident(&mut self, $($name:ident: $ty:ty),*) -> &mut Self) => {
         pub fn $n(&mut self, $($name: $ty),*) -> &mut Self {
+            #[allow(deprecated)]
             self.diagnostic.$n($($name),*);
             self
         }
@@ -58,6 +60,7 @@ macro_rules! forward {
     // type parameter. No obvious way to make this more generic.
     (pub fn $n:ident<S: Into<MultiSpan>>(&mut self, $($name:ident: $ty:ty),*) -> &mut Self) => {
         pub fn $n<S: Into<MultiSpan>>(&mut self, $($name: $ty),*) -> &mut Self {
+            #[allow(deprecated)]
             self.diagnostic.$n($($name),*);
             self
         }
@@ -167,21 +170,29 @@ impl<'a> DiagnosticBuilder<'a> {
                                                   sp: S,
                                                   msg: &str)
                                                   -> &mut Self);
+
+    #[deprecated(note = "Use `span_suggestion_short_with_applicability`")]
     forward!(pub fn span_suggestion_short(&mut self,
                                           sp: Span,
                                           msg: &str,
                                           suggestion: String)
                                           -> &mut Self);
+
+    #[deprecated(note = "Use `multipart_suggestion_with_applicability`")]
     forward!(pub fn multipart_suggestion(
         &mut self,
         msg: &str,
         suggestion: Vec<(Span, String)>
     ) -> &mut Self);
+
+    #[deprecated(note = "Use `span_suggestion_with_applicability`")]
     forward!(pub fn span_suggestion(&mut self,
                                     sp: Span,
                                     msg: &str,
                                     suggestion: String)
                                     -> &mut Self);
+
+    #[deprecated(note = "Use `span_suggestions_with_applicability`")]
     forward!(pub fn span_suggestions(&mut self,
                                      sp: Span,
                                      msg: &str,