Skip to content

Commit 230e396

Browse files
committed
Fix compiler docs
1 parent de0fda9 commit 230e396

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

+9
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ macro_rules! forward {
4545
pub fn $n:ident(&self, $($name:ident: $ty:ty),* $(,)?) -> &Self
4646
) => {
4747
$(#[$attrs])*
48+
// we always document with --document-private-items
49+
#[cfg_attr(not(bootstrap), allow(rustdoc::private_intra_doc_links))]
50+
#[cfg_attr(bootstrap, allow(private_intra_doc_links))]
4851
#[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
4952
pub fn $n(&self, $($name: $ty),*) -> &Self {
5053
self.diagnostic.$n($($name),*);
@@ -59,6 +62,9 @@ macro_rules! forward {
5962
) => {
6063
$(#[$attrs])*
6164
#[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
65+
// we always document with --document-private-items
66+
#[cfg_attr(not(bootstrap), allow(rustdoc::private_intra_doc_links))]
67+
#[cfg_attr(bootstrap, allow(private_intra_doc_links))]
6268
pub fn $n(&mut self, $($name: $ty),*) -> &mut Self {
6369
self.0.diagnostic.$n($($name),*);
6470
self
@@ -76,6 +82,9 @@ macro_rules! forward {
7682
) => {
7783
$(#[$attrs])*
7884
#[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
85+
// we always document with --document-private-items
86+
#[cfg_attr(not(bootstrap), allow(rustdoc::private_intra_doc_links))]
87+
#[cfg_attr(bootstrap, allow(private_intra_doc_links))]
7988
pub fn $n<$($generic: $bound),*>(&mut self, $($name: $ty),*) -> &mut Self {
8089
self.0.diagnostic.$n($($name),*);
8190
self

compiler/rustc_save_analysis/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ impl<'tcx> SaveContext<'tcx> {
772772
/// returns `None` if the node is not macro-generated or the span is malformed,
773773
/// else uses the expansion callsite and callee to return some MacroRef.
774774
///
775-
/// FIXME: [`dump_visitor::process_macro_use`] should actually dump this data
775+
/// FIXME: [`DumpVisitor::process_macro_use`] should actually dump this data
776776
#[allow(dead_code)]
777777
fn get_macro_use_data(&self, span: Span) -> Option<MacroRef> {
778778
if !generated_code(span) {

0 commit comments

Comments
 (0)