Deprecate *_suggestion* that are without explicit applicability
This commit is contained in:
parent
4b05128114
commit
959fc6116a
@ -232,6 +232,7 @@ impl Diagnostic {
|
|||||||
/// inline it will only show the text message and not the text.
|
/// inline it will only show the text message and not the text.
|
||||||
///
|
///
|
||||||
/// See `CodeSuggestion` for more information.
|
/// 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 {
|
pub fn span_suggestion_short(&mut self, sp: Span, msg: &str, suggestion: String) -> &mut Self {
|
||||||
self.suggestions.push(CodeSuggestion {
|
self.suggestions.push(CodeSuggestion {
|
||||||
substitutions: vec![Substitution {
|
substitutions: vec![Substitution {
|
||||||
@ -263,6 +264,7 @@ impl Diagnostic {
|
|||||||
/// * may contain a name of a function, variable or type, but not whole expressions
|
/// * may contain a name of a function, variable or type, but not whole expressions
|
||||||
///
|
///
|
||||||
/// See `CodeSuggestion` for more information.
|
/// 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 {
|
pub fn span_suggestion(&mut self, sp: Span, msg: &str, suggestion: String) -> &mut Self {
|
||||||
self.suggestions.push(CodeSuggestion {
|
self.suggestions.push(CodeSuggestion {
|
||||||
substitutions: vec![Substitution {
|
substitutions: vec![Substitution {
|
||||||
@ -298,6 +300,7 @@ impl Diagnostic {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[deprecated(note = "Use `multipart_suggestion_with_applicability`")]
|
||||||
pub fn multipart_suggestion(
|
pub fn multipart_suggestion(
|
||||||
&mut self,
|
&mut self,
|
||||||
msg: &str,
|
msg: &str,
|
||||||
@ -311,6 +314,7 @@ impl Diagnostic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Prints out a message with multiple suggested edits of the code.
|
/// 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 {
|
pub fn span_suggestions(&mut self, sp: Span, msg: &str, suggestions: Vec<String>) -> &mut Self {
|
||||||
self.suggestions.push(CodeSuggestion {
|
self.suggestions.push(CodeSuggestion {
|
||||||
substitutions: suggestions.into_iter().map(|snippet| Substitution {
|
substitutions: suggestions.into_iter().map(|snippet| Substitution {
|
||||||
|
@ -41,6 +41,7 @@ macro_rules! forward {
|
|||||||
// Forward pattern for &self -> &Self
|
// Forward pattern for &self -> &Self
|
||||||
(pub fn $n:ident(&self, $($name:ident: $ty:ty),*) -> &Self) => {
|
(pub fn $n:ident(&self, $($name:ident: $ty:ty),*) -> &Self) => {
|
||||||
pub fn $n(&self, $($name: $ty),*) -> &Self {
|
pub fn $n(&self, $($name: $ty),*) -> &Self {
|
||||||
|
#[allow(deprecated)]
|
||||||
self.diagnostic.$n($($name),*);
|
self.diagnostic.$n($($name),*);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
@ -49,6 +50,7 @@ macro_rules! forward {
|
|||||||
// Forward pattern for &mut self -> &mut Self
|
// Forward pattern for &mut self -> &mut Self
|
||||||
(pub fn $n:ident(&mut self, $($name:ident: $ty:ty),*) -> &mut Self) => {
|
(pub fn $n:ident(&mut self, $($name:ident: $ty:ty),*) -> &mut Self) => {
|
||||||
pub fn $n(&mut self, $($name: $ty),*) -> &mut Self {
|
pub fn $n(&mut self, $($name: $ty),*) -> &mut Self {
|
||||||
|
#[allow(deprecated)]
|
||||||
self.diagnostic.$n($($name),*);
|
self.diagnostic.$n($($name),*);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
@ -58,6 +60,7 @@ macro_rules! forward {
|
|||||||
// type parameter. No obvious way to make this more generic.
|
// 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:ident<S: Into<MultiSpan>>(&mut self, $($name:ident: $ty:ty),*) -> &mut Self) => {
|
||||||
pub fn $n<S: Into<MultiSpan>>(&mut self, $($name: $ty),*) -> &mut Self {
|
pub fn $n<S: Into<MultiSpan>>(&mut self, $($name: $ty),*) -> &mut Self {
|
||||||
|
#[allow(deprecated)]
|
||||||
self.diagnostic.$n($($name),*);
|
self.diagnostic.$n($($name),*);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
@ -167,21 +170,29 @@ impl<'a> DiagnosticBuilder<'a> {
|
|||||||
sp: S,
|
sp: S,
|
||||||
msg: &str)
|
msg: &str)
|
||||||
-> &mut Self);
|
-> &mut Self);
|
||||||
|
|
||||||
|
#[deprecated(note = "Use `span_suggestion_short_with_applicability`")]
|
||||||
forward!(pub fn span_suggestion_short(&mut self,
|
forward!(pub fn span_suggestion_short(&mut self,
|
||||||
sp: Span,
|
sp: Span,
|
||||||
msg: &str,
|
msg: &str,
|
||||||
suggestion: String)
|
suggestion: String)
|
||||||
-> &mut Self);
|
-> &mut Self);
|
||||||
|
|
||||||
|
#[deprecated(note = "Use `multipart_suggestion_with_applicability`")]
|
||||||
forward!(pub fn multipart_suggestion(
|
forward!(pub fn multipart_suggestion(
|
||||||
&mut self,
|
&mut self,
|
||||||
msg: &str,
|
msg: &str,
|
||||||
suggestion: Vec<(Span, String)>
|
suggestion: Vec<(Span, String)>
|
||||||
) -> &mut Self);
|
) -> &mut Self);
|
||||||
|
|
||||||
|
#[deprecated(note = "Use `span_suggestion_with_applicability`")]
|
||||||
forward!(pub fn span_suggestion(&mut self,
|
forward!(pub fn span_suggestion(&mut self,
|
||||||
sp: Span,
|
sp: Span,
|
||||||
msg: &str,
|
msg: &str,
|
||||||
suggestion: String)
|
suggestion: String)
|
||||||
-> &mut Self);
|
-> &mut Self);
|
||||||
|
|
||||||
|
#[deprecated(note = "Use `span_suggestions_with_applicability`")]
|
||||||
forward!(pub fn span_suggestions(&mut self,
|
forward!(pub fn span_suggestions(&mut self,
|
||||||
sp: Span,
|
sp: Span,
|
||||||
msg: &str,
|
msg: &str,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user