Rollup merge of #45486 - oli-obk:patch-9, r=kennytm

Update docs for Diagnostic::span_suggestion(s)
This commit is contained in:
Guillaume Gomez 2017-10-25 09:48:11 +02:00 committed by GitHub
commit a95d97a46b

View file

@ -229,6 +229,7 @@ impl Diagnostic {
/// "try adding parentheses: `(tup.0).1`" /// "try adding parentheses: `(tup.0).1`"
/// ///
/// The message /// The message
///
/// * should not end in any punctuation (a `:` is added automatically) /// * should not end in any punctuation (a `:` is added automatically)
/// * should not be a question /// * should not be a question
/// * should not contain any parts like "the following", "as shown" /// * should not contain any parts like "the following", "as shown"
@ -248,6 +249,7 @@ impl Diagnostic {
self self
} }
/// Prints out a message with multiple suggested edits of the code.
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 {
substitution_parts: vec![Substitution { substitution_parts: vec![Substitution {