diff options
| author | pierwill <pierwill@users.noreply.github.com> | 2022-11-16 12:21:15 -0600 |
|---|---|---|
| committer | pierwill <pierwill@users.noreply.github.com> | 2022-11-17 15:45:46 -0600 |
| commit | 19b63bc791dee7329922f809f5468483b0d72bc6 (patch) | |
| tree | 972197a717fff248cb9aed411ec31073c745ab39 /compiler/rustc_errors/src | |
| parent | 63c748ee23ab7b6706655146f5b7c7f579811803 (diff) | |
| download | rust-19b63bc791dee7329922f809f5468483b0d72bc6.tar.gz rust-19b63bc791dee7329922f809f5468483b0d72bc6.zip | |
Edit docs for `rustc_errors::Handler::stash_diagnostic`
Clarify that the diagnostic can be retrieved with `steal_diagnostic`.
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 170d4341ae7..ae88fcade63 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -644,13 +644,14 @@ impl Handler { inner.stashed_diagnostics = Default::default(); } - /// Stash a given diagnostic with the given `Span` and `StashKey` as the key for later stealing. + /// Stash a given diagnostic with the given `Span` and [`StashKey`] as the key. + /// Retrieve a stashed diagnostic with `steal_diagnostic`. pub fn stash_diagnostic(&self, span: Span, key: StashKey, diag: Diagnostic) { let mut inner = self.inner.borrow_mut(); inner.stash((span, key), diag); } - /// Steal a previously stashed diagnostic with the given `Span` and `StashKey` as the key. + /// Steal a previously stashed diagnostic with the given `Span` and [`StashKey`] as the key. pub fn steal_diagnostic(&self, span: Span, key: StashKey) -> Option<DiagnosticBuilder<'_, ()>> { let mut inner = self.inner.borrow_mut(); inner.steal((span, key)).map(|diag| DiagnosticBuilder::new_diagnostic(self, diag)) |
