Skip to content

Commit 93f3db2

Browse files
committed
Expose rustc_lint::decorate_builtin_lint for use in rustdoc
1 parent e33fe61 commit 93f3db2

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
@@ -126,6 +126,7 @@ use unused::*;
126126
#[rustfmt::skip]
127127
pub use builtin::{MissingDoc, SoftLints};
128128
pub use context::{CheckLintNameResult, EarlyContext, LateContext, LintContext, LintStore};
129+
pub use early::diagnostics::decorate_builtin_lint;
129130
pub use early::{EarlyCheckNode, check_ast_node};
130131
pub use late::{check_crate, late_lint_mod, unerased_lint_store};
131132
pub use levels::LintLevelsBuilder;

0 commit comments

Comments
 (0)