Skip to content

Commit d9f6d35

Browse files
authored
Rollup merge of rust-lang#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`
2 parents 9e9c74d + 4edbaef commit d9f6d35

File tree

1 file changed

+3
-2
lines changed
  • compiler/rustc_errors/src

1 file changed

+3
-2
lines changed

compiler/rustc_errors/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -644,13 +644,14 @@ impl Handler {
644644
inner.stashed_diagnostics = Default::default();
645645
}
646646

647-
/// Stash a given diagnostic with the given `Span` and `StashKey` as the key for later stealing.
647+
/// Stash a given diagnostic with the given `Span` and [`StashKey`] as the key.
648+
/// Retrieve a stashed diagnostic with [`steal_diagnostic`].
648649
pub fn stash_diagnostic(&self, span: Span, key: StashKey, diag: Diagnostic) {
649650
let mut inner = self.inner.borrow_mut();
650651
inner.stash((span, key), diag);
651652
}
652653

653-
/// Steal a previously stashed diagnostic with the given `Span` and `StashKey` as the key.
654+
/// Steal a previously stashed diagnostic with the given `Span` and [`StashKey`] as the key.
654655
pub fn steal_diagnostic(&self, span: Span, key: StashKey) -> Option<DiagnosticBuilder<'_, ()>> {
655656
let mut inner = self.inner.borrow_mut();
656657
inner.steal((span, key)).map(|diag| DiagnosticBuilder::new_diagnostic(self, diag))

0 commit comments

Comments
 (0)