Skip to content

Commit 22e1798

Browse files
committed
ignore potential_query_instability in rustdoc
1 parent 00e5abe commit 22e1798

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

compiler/rustc_lint/src/internal.rs

+15
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,21 @@ declare_lint_pass!(QueryStability => [POTENTIAL_QUERY_INSTABILITY]);
5959

6060
impl LateLintPass<'_> for QueryStability {
6161
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
62+
// FIXME(rustdoc): This lint uses typecheck results, causing rustdoc to
63+
// error if there are resolution failures.
64+
//
65+
// As internal lints are currently always run if there are `unstable_options`,
66+
// they are added to the lint store of rustdoc. Internal lints are also
67+
// not used via the `lint_mod` query. Crate lints run outside of a query
68+
// so rustdoc currently doesn't disable them.
69+
//
70+
// Instead of relying on this, either change crate lints to a query disabled by
71+
// rustdoc, only run internal lints if the user is explicitly opting in
72+
// or figure out a different way to avoid running lints for rustdoc.
73+
if cx.tcx.sess.opts.actually_rustdoc {
74+
return;
75+
}
76+
6277
let (def_id, span) = match expr.kind {
6378
ExprKind::Path(ref path) if let Some(def_id) = cx.qpath_res(path, expr.hir_id).opt_def_id() => {
6479
(def_id, expr.span)

0 commit comments

Comments
 (0)