diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2022-11-18 17:48:19 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-18 17:48:19 -0500 |
| commit | a065e97bdc599406f4cea8dad90cc5f215a4e61a (patch) | |
| tree | a11481c8622f656f611dba3fcf851dfd5caccd85 | |
| parent | 24ee5991959d36a2fd858e4760ca19a12912a5b9 (diff) | |
| parent | 19b63bc791dee7329922f809f5468483b0d72bc6 (diff) | |
| download | rust-a065e97bdc599406f4cea8dad90cc5f215a4e61a.tar.gz rust-a065e97bdc599406f4cea8dad90cc5f215a4e61a.zip | |
Rollup merge of #104498 - pierwill:stash-diag-docs, r=compiler-errors
Edit docs for `rustc_errors::Handler::stash_diagnostic` Clarify that the diagnostic can be retrieved with `steal_diagnostic`. r? ```@compiler-errors```
| -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)) |
