Skip to content

Commit 3df3290

Browse files
committed
Expose rustc_lint::decorate_builtin_lint for use in rustdoc
1 parent 94f83d7 commit 3df3290

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

compiler/rustc_lint/src/early.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use tracing::debug;
1818
use crate::context::{EarlyContext, LintContext, LintStore};
1919
use crate::passes::{EarlyLintPass, EarlyLintPassObject};
2020

21-
mod diagnostics;
21+
pub(super) mod diagnostics;
2222

2323
macro_rules! lint_callback { ($cx:expr, $f:ident, $($args:expr),*) => ({
2424
$cx.pass.$f(&$cx.context, $($args),*);
@@ -40,7 +40,7 @@ impl<'ecx, 'tcx, T: EarlyLintPass> EarlyContextAndPass<'ecx, 'tcx, T> {
4040
for early_lint in self.context.buffered.take(id) {
4141
let BufferedEarlyLint { span, node_id: _, lint_id, diagnostic } = early_lint;
4242
self.context.opt_span_lint(lint_id.lint, span, |diag| {
43-
diagnostics::decorate_lint(self.context.sess(), self.tcx, diagnostic, diag);
43+
diagnostics::decorate_builtin_lint(self.context.sess(), self.tcx, diagnostic, diag);
4444
});
4545
}
4646
}

compiler/rustc_lint/src/early/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::lints::{self, ElidedNamedLifetime};
1818

1919
mod check_cfg;
2020

21-
pub(super) fn decorate_lint(
21+
pub fn decorate_builtin_lint(
2222
sess: &Session,
2323
tcx: Option<TyCtxt<'_>>,
2424
diagnostic: BuiltinLintDiag,

compiler/rustc_lint/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ use unused::*;
127127
#[rustfmt::skip]
128128
pub use builtin::{MissingDoc, SoftLints};
129129
pub use context::{CheckLintNameResult, EarlyContext, LateContext, LintContext, LintStore};
130+
pub use early::diagnostics::decorate_builtin_lint;
130131
pub use early::{EarlyCheckNode, check_ast_node};
131132
pub use late::{check_crate, late_lint_mod, unerased_lint_store};
132133
pub use levels::LintLevelsBuilder;

0 commit comments

Comments
 (0)