Skip to content

Commit df05e10

Browse files
committed
Accept LocalDefId as key for lint_mod query
1 parent 283de4f commit df05e10

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/librustc_lint/lib.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mod unused;
5656

5757
use rustc_ast::ast;
5858
use rustc_hir as hir;
59-
use rustc_hir::def_id::DefId;
59+
use rustc_hir::def_id::LocalDefId;
6060
use rustc_middle::ty::query::Providers;
6161
use rustc_middle::ty::TyCtxt;
6262
use rustc_session::lint::builtin::{
@@ -90,12 +90,8 @@ pub fn provide(providers: &mut Providers<'_>) {
9090
*providers = Providers { lint_mod, ..*providers };
9191
}
9292

93-
fn lint_mod(tcx: TyCtxt<'_>, module_def_id: DefId) {
94-
late::late_lint_mod(
95-
tcx,
96-
module_def_id.expect_local(),
97-
BuiltinCombinedModuleLateLintPass::new(),
98-
);
93+
fn lint_mod(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
94+
late::late_lint_mod(tcx, module_def_id, BuiltinCombinedModuleLateLintPass::new());
9995
}
10096

10197
macro_rules! pre_expansion_lint_passes {

src/librustc_middle/query/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ rustc_queries! {
403403
}
404404

405405
Other {
406-
query lint_mod(key: DefId) -> () {
407-
desc { |tcx| "linting {}", describe_as_module(key, tcx) }
406+
query lint_mod(key: LocalDefId) -> () {
407+
desc { |tcx| "linting {}", describe_as_module(key.to_def_id(), tcx) }
408408
}
409409

410410
/// Checks the attributes in the module.

0 commit comments

Comments
 (0)