Skip to content

Commit

Permalink
DiagnosticBuilder docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Aug 12, 2019
1 parent 72f8043 commit fecf305
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustc_errors/diagnostic.rs
Expand Up @@ -120,6 +120,9 @@ impl Diagnostic {
}

/// Adds a span/label to be included in the resulting snippet.
/// This label will be shown together with the original span/label used when creating the
/// diagnostic, *not* a span added by one of the `span_*` methods.
///
/// This is pushed onto the `MultiSpan` that was created when the
/// diagnostic was first built. If you don't call this function at
/// all, and you just supplied a `Span` to create the diagnostic,
Expand Down Expand Up @@ -196,6 +199,7 @@ impl Diagnostic {
self
}

/// Prints the span with a note above it.
pub fn span_note<S: Into<MultiSpan>>(&mut self,
sp: S,
msg: &str)
Expand All @@ -209,6 +213,7 @@ impl Diagnostic {
self
}

/// Prints the span with a warn above it.
pub fn span_warn<S: Into<MultiSpan>>(&mut self,
sp: S,
msg: &str)
Expand All @@ -222,6 +227,7 @@ impl Diagnostic {
self
}

/// Prints the span with some help above it.
pub fn span_help<S: Into<MultiSpan>>(&mut self,
sp: S,
msg: &str)
Expand Down

0 comments on commit fecf305

Please sign in to comment.