[−][src]Struct syntax::diagnostics::plugin::DiagnosticBuilder
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Used for emitting structured error messages and other diagnostic information.
Fields
handler: &'a Handler
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
diagnostic: Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
allow_suggestions: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Methods
impl<'a> DiagnosticBuilder<'a>
[src]
impl<'a> DiagnosticBuilder<'a>
pub fn emit(&mut self)
[src]
pub fn emit(&mut self)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Emit the diagnostic.
pub fn buffer(self, buffered_diagnostics: &mut Vec<Diagnostic>)
[src]
pub fn buffer(self, buffered_diagnostics: &mut Vec<Diagnostic>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Buffers the diagnostic for later emission.
pub fn sub<S>(
&mut self,
level: Level,
message: &str,
span: Option<S>
) -> &mut DiagnosticBuilder<'a> where
S: Into<MultiSpan>,
[src]
pub fn sub<S>(
&mut self,
level: Level,
message: &str,
span: Option<S>
) -> &mut DiagnosticBuilder<'a> where
S: Into<MultiSpan>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Convenience function for internal use, clients should use one of the span_* methods instead.
pub fn delay_as_bug(&mut self)
[src]
pub fn delay_as_bug(&mut self)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Delay emission of this diagnostic as a bug.
This can be useful in contexts where an error indicates a bug but typically this only happens when other compilation errors have already happened. In those cases this can be used to defer emission of this diagnostic as a bug in the compiler only if no other errors have been emitted.
In the meantime, though, callsites are required to deal with the "bug" locally in whichever way makes the most sense.
pub fn span_label<T>(
&mut self,
span: Span,
label: T
) -> &mut DiagnosticBuilder<'a> where
T: Into<String>,
[src]
pub fn span_label<T>(
&mut self,
span: Span,
label: T
) -> &mut DiagnosticBuilder<'a> where
T: Into<String>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Add a span/label to be included in the resulting snippet.
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,
then the snippet will just include that Span
, which is
called the primary span.
pub fn note_expected_found(
&mut self,
label: &Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString
) -> &mut DiagnosticBuilder<'a>
[src]
pub fn note_expected_found(
&mut self,
label: &Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString
) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn note_expected_found_extra(
&mut self,
label: &Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString,
expected_extra: &Display,
found_extra: &Display
) -> &mut DiagnosticBuilder<'a>
[src]
pub fn note_expected_found_extra(
&mut self,
label: &Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString,
expected_extra: &Display,
found_extra: &Display
) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn note(&mut self, msg: &str) -> &mut DiagnosticBuilder<'a>
[src]
pub fn note(&mut self, msg: &str) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_note<S>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a> where
S: Into<MultiSpan>,
[src]
pub fn span_note<S>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a> where
S: Into<MultiSpan>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn warn(&mut self, msg: &str) -> &mut DiagnosticBuilder<'a>
[src]
pub fn warn(&mut self, msg: &str) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_warn<S>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a> where
S: Into<MultiSpan>,
[src]
pub fn span_warn<S>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a> where
S: Into<MultiSpan>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn help(&mut self, msg: &str) -> &mut DiagnosticBuilder<'a>
[src]
pub fn help(&mut self, msg: &str) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_help<S>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a> where
S: Into<MultiSpan>,
[src]
pub fn span_help<S>(&mut self, sp: S, msg: &str) -> &mut DiagnosticBuilder<'a> where
S: Into<MultiSpan>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_suggestion_short(
&mut self,
sp: Span,
msg: &str,
suggestion: String
) -> &mut DiagnosticBuilder<'a>
[src]
pub fn span_suggestion_short(
&mut self,
sp: Span,
msg: &str,
suggestion: String
) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn multipart_suggestion(
&mut self,
msg: &str,
suggestion: Vec<(Span, String)>
) -> &mut DiagnosticBuilder<'a>
[src]
pub fn multipart_suggestion(
&mut self,
msg: &str,
suggestion: Vec<(Span, String)>
) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_suggestion(
&mut self,
sp: Span,
msg: &str,
suggestion: String
) -> &mut DiagnosticBuilder<'a>
[src]
pub fn span_suggestion(
&mut self,
sp: Span,
msg: &str,
suggestion: String
) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_suggestions(
&mut self,
sp: Span,
msg: &str,
suggestions: Vec<String>
) -> &mut DiagnosticBuilder<'a>
[src]
pub fn span_suggestions(
&mut self,
sp: Span,
msg: &str,
suggestions: Vec<String>
) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_suggestion_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestion: String,
applicability: Applicability
) -> &mut DiagnosticBuilder<'a>
[src]
pub fn span_suggestion_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestion: String,
applicability: Applicability
) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_suggestions_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestions: Vec<String>,
applicability: Applicability
) -> &mut DiagnosticBuilder<'a>
[src]
pub fn span_suggestions_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestions: Vec<String>,
applicability: Applicability
) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_suggestion_short_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestion: String,
applicability: Applicability
) -> &mut DiagnosticBuilder<'a>
[src]
pub fn span_suggestion_short_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestion: String,
applicability: Applicability
) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn set_span<S>(&mut self, sp: S) -> &mut DiagnosticBuilder<'a> where
S: Into<MultiSpan>,
[src]
pub fn set_span<S>(&mut self, sp: S) -> &mut DiagnosticBuilder<'a> where
S: Into<MultiSpan>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn code(&mut self, s: DiagnosticId) -> &mut DiagnosticBuilder<'a>
[src]
pub fn code(&mut self, s: DiagnosticId) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn allow_suggestions(&mut self, allow: bool) -> &mut DiagnosticBuilder<'a>
[src]
pub fn allow_suggestions(&mut self, allow: bool) -> &mut DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn new(
handler: &'a Handler,
level: Level,
message: &str
) -> DiagnosticBuilder<'a>
[src]
pub fn new(
handler: &'a Handler,
level: Level,
message: &str
) -> DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Convenience function for internal use, clients should use one of the struct_* methods on Handler.
pub fn new_with_code(
handler: &'a Handler,
level: Level,
code: Option<DiagnosticId>,
message: &str
) -> DiagnosticBuilder<'a>
[src]
pub fn new_with_code(
handler: &'a Handler,
level: Level,
code: Option<DiagnosticId>,
message: &str
) -> DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Convenience function for internal use, clients should use one of the struct_* methods on Handler.
pub fn new_diagnostic(
handler: &'a Handler,
diagnostic: Diagnostic
) -> DiagnosticBuilder<'a>
[src]
pub fn new_diagnostic(
handler: &'a Handler,
diagnostic: Diagnostic
) -> DiagnosticBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Creates a new DiagnosticBuilder
with an already constructed
diagnostic.
Methods from Deref<Target = Diagnostic>
pub fn is_error(&self) -> bool
[src]
pub fn is_error(&self) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn cancel(&mut self)
[src]
pub fn cancel(&mut self)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Cancel the diagnostic (a structured diagnostic must either be emitted or canceled or it will panic when dropped).
pub fn cancelled(&self) -> bool
[src]
pub fn cancelled(&self) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_label<T>(&mut self, span: Span, label: T) -> &mut Diagnostic where
T: Into<String>,
[src]
pub fn span_label<T>(&mut self, span: Span, label: T) -> &mut Diagnostic where
T: Into<String>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Add a span/label to be included in the resulting snippet.
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,
then the snippet will just include that Span
, which is
called the primary span.
pub fn note_expected_found(
&mut self,
label: &Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString
) -> &mut Diagnostic
[src]
pub fn note_expected_found(
&mut self,
label: &Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString
) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn note_expected_found_extra(
&mut self,
label: &Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString,
expected_extra: &Display,
found_extra: &Display
) -> &mut Diagnostic
[src]
pub fn note_expected_found_extra(
&mut self,
label: &Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString,
expected_extra: &Display,
found_extra: &Display
) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn note_trait_signature(
&mut self,
name: String,
signature: String
) -> &mut Diagnostic
[src]
pub fn note_trait_signature(
&mut self,
name: String,
signature: String
) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn note(&mut self, msg: &str) -> &mut Diagnostic
[src]
pub fn note(&mut self, msg: &str) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn highlighted_note(&mut self, msg: Vec<(String, Style)>) -> &mut Diagnostic
[src]
pub fn highlighted_note(&mut self, msg: Vec<(String, Style)>) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_note<S>(&mut self, sp: S, msg: &str) -> &mut Diagnostic where
S: Into<MultiSpan>,
[src]
pub fn span_note<S>(&mut self, sp: S, msg: &str) -> &mut Diagnostic where
S: Into<MultiSpan>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn warn(&mut self, msg: &str) -> &mut Diagnostic
[src]
pub fn warn(&mut self, msg: &str) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_warn<S>(&mut self, sp: S, msg: &str) -> &mut Diagnostic where
S: Into<MultiSpan>,
[src]
pub fn span_warn<S>(&mut self, sp: S, msg: &str) -> &mut Diagnostic where
S: Into<MultiSpan>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn help(&mut self, msg: &str) -> &mut Diagnostic
[src]
pub fn help(&mut self, msg: &str) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_help<S>(&mut self, sp: S, msg: &str) -> &mut Diagnostic where
S: Into<MultiSpan>,
[src]
pub fn span_help<S>(&mut self, sp: S, msg: &str) -> &mut Diagnostic where
S: Into<MultiSpan>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_suggestion_short(
&mut self,
sp: Span,
msg: &str,
suggestion: String
) -> &mut Diagnostic
[src]
pub fn span_suggestion_short(
&mut self,
sp: Span,
msg: &str,
suggestion: String
) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Prints out a message with a suggested edit of the code. If the suggestion is presented inline it will only show the text message and not the text.
See CodeSuggestion
for more information.
pub fn span_suggestion(
&mut self,
sp: Span,
msg: &str,
suggestion: String
) -> &mut Diagnostic
[src]
pub fn span_suggestion(
&mut self,
sp: Span,
msg: &str,
suggestion: String
) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Prints out a message with a suggested edit of the code.
In case of short messages and a simple suggestion, rustc displays it as a label like
"try adding parentheses: (tup.0).1
"
The message
- should not end in any punctuation (a
:
is added automatically) - should not be a question
- should not contain any parts like "the following", "as shown"
- may look like "to do xyz, use" or "to do xyz, use abc"
- may contain a name of a function, variable or type, but not whole expressions
See CodeSuggestion
for more information.
pub fn multipart_suggestion(
&mut self,
msg: &str,
suggestion: Vec<(Span, String)>
) -> &mut Diagnostic
[src]
pub fn multipart_suggestion(
&mut self,
msg: &str,
suggestion: Vec<(Span, String)>
) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_suggestions(
&mut self,
sp: Span,
msg: &str,
suggestions: Vec<String>
) -> &mut Diagnostic
[src]
pub fn span_suggestions(
&mut self,
sp: Span,
msg: &str,
suggestions: Vec<String>
) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Prints out a message with multiple suggested edits of the code.
pub fn span_suggestion_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestion: String,
applicability: Applicability
) -> &mut Diagnostic
[src]
pub fn span_suggestion_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestion: String,
applicability: Applicability
) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
This is a suggestion that may contain mistakes or fillers and should be read and understood by a human.
pub fn span_suggestions_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestions: Vec<String>,
applicability: Applicability
) -> &mut Diagnostic
[src]
pub fn span_suggestions_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestions: Vec<String>,
applicability: Applicability
) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn span_suggestion_short_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestion: String,
applicability: Applicability
) -> &mut Diagnostic
[src]
pub fn span_suggestion_short_with_applicability(
&mut self,
sp: Span,
msg: &str,
suggestion: String,
applicability: Applicability
) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn set_span<S>(&mut self, sp: S) -> &mut Diagnostic where
S: Into<MultiSpan>,
[src]
pub fn set_span<S>(&mut self, sp: S) -> &mut Diagnostic where
S: Into<MultiSpan>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn code(&mut self, s: DiagnosticId) -> &mut Diagnostic
[src]
pub fn code(&mut self, s: DiagnosticId) -> &mut Diagnostic
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn get_code(&self) -> Option<DiagnosticId>
[src]
pub fn get_code(&self) -> Option<DiagnosticId>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn message(&self) -> String
[src]
pub fn message(&self) -> String
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn styled_message(&self) -> &Vec<(String, Style)>
[src]
pub fn styled_message(&self) -> &Vec<(String, Style)>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn copy_details_not_message(&mut self, from: &Diagnostic)
[src]
pub fn copy_details_not_message(&mut self, from: &Diagnostic)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Used by a lint. Copies over all details but the "main message".
pub fn sub(
&mut self,
level: Level,
message: &str,
span: MultiSpan,
render_span: Option<MultiSpan>
)
[src]
pub fn sub(
&mut self,
level: Level,
message: &str,
span: MultiSpan,
render_span: Option<MultiSpan>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Convenience function for internal use, clients should use one of the public methods above.
Trait Implementations
impl<'a> Debug for DiagnosticBuilder<'a>
[src]
impl<'a> Debug for DiagnosticBuilder<'a>
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<'a> Deref for DiagnosticBuilder<'a>
[src]
impl<'a> Deref for DiagnosticBuilder<'a>
type Target = Diagnostic
The resulting type after dereferencing.
fn deref(&self) -> &Diagnostic
[src]
fn deref(&self) -> &Diagnostic
Dereferences the value.
impl<'a> Drop for DiagnosticBuilder<'a>
[src]
impl<'a> Drop for DiagnosticBuilder<'a>
Destructor bomb - a DiagnosticBuilder
must be either emitted or canceled
or we emit a bug.
impl<'a> Clone for DiagnosticBuilder<'a>
[src]
impl<'a> Clone for DiagnosticBuilder<'a>
fn clone(&self) -> DiagnosticBuilder<'a>
[src]
fn clone(&self) -> DiagnosticBuilder<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a> DerefMut for DiagnosticBuilder<'a>
[src]
impl<'a> DerefMut for DiagnosticBuilder<'a>
fn deref_mut(&mut self) -> &mut Diagnostic
[src]
fn deref_mut(&mut self) -> &mut Diagnostic
Mutably dereferences the value.
Auto Trait Implementations
impl<'a> !Send for DiagnosticBuilder<'a>
impl<'a> !Send for DiagnosticBuilder<'a>
impl<'a> !Sync for DiagnosticBuilder<'a>
impl<'a> !Sync for DiagnosticBuilder<'a>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T
[src]
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<E> SpecializationError for E
[src]
impl<E> SpecializationError for E
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
[src]
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S
is the encoder/decoder state type, T
is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
impl<T> Erased for T
[src]
impl<T> Erased for T
impl<T> Send for T where
T: ?Sized,
[src]
impl<T> Send for T where
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
impl<T> Sync for T where
T: ?Sized,
impl<T> Erased for T
impl<T> Erased for T