diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-03 21:29:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-03 21:29:43 +0100 |
| commit | 019d28151d5ceabd2214ca7f03c37e105f45028c (patch) | |
| tree | d0dee9d926f9e33a0cd7bac37eb4764834b88d2b /compiler/rustc_errors/src | |
| parent | b9c87b41d3d8c4c930748997f17f4dfcad5c35d0 (diff) | |
| parent | b6a4f03306fb2d1965e5d71e5a6f99641a0655ee (diff) | |
| download | rust-019d28151d5ceabd2214ca7f03c37e105f45028c.tar.gz rust-019d28151d5ceabd2214ca7f03c37e105f45028c.zip | |
Rollup merge of #120573 - nnethercote:rm-BorrowckErrors-tainted_by_errors, r=oli-obk
Remove `BorrowckErrors::tainted_by_errors` This PR removes one of the `tainted_by_errors` occurrences, replacing it with direct use of `ErrorGuaranteed`. r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic_builder.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs index 8bfb1816486..faff7f0b526 100644 --- a/compiler/rustc_errors/src/diagnostic_builder.rs +++ b/compiler/rustc_errors/src/diagnostic_builder.rs @@ -255,13 +255,8 @@ impl<'a, G: EmissionGuarantee> DiagnosticBuilder<'a, G> { /// Stashes diagnostic for possible later improvement in a different, /// later stage of the compiler. The diagnostic can be accessed with /// the provided `span` and `key` through [`DiagCtxt::steal_diagnostic()`]. - pub fn stash(self, span: Span, key: StashKey) { - self.dcx.stash_diagnostic(span, key, self.into_diagnostic()); - } - - /// Converts the builder to a `Diagnostic` for later emission. - pub fn into_diagnostic(mut self) -> Diagnostic { - self.take_diag() + pub fn stash(mut self, span: Span, key: StashKey) { + self.dcx.stash_diagnostic(span, key, self.take_diag()); } /// Delay emission of this diagnostic as a bug. |
