From 200452eec105a40778d7d39582d19d8f32529a44 Mon Sep 17 00:00:00 2001 From: Yang Keao Date: Wed, 20 Jan 2021 18:11:23 +0800 Subject: [PATCH] do unstable api check after typeck Signed-off-by: Yang Keao --- compiler/rustc_interface/src/passes.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index ead2512d3b2a5..4d57566ec83cd 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -828,7 +828,6 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> { tcx.ensure().check_mod_loops(local_def_id); tcx.ensure().check_mod_attrs(local_def_id); tcx.ensure().check_mod_naked_functions(local_def_id); - tcx.ensure().check_mod_unstable_api_usage(local_def_id); tcx.ensure().check_mod_const_bodies(local_def_id); }); } @@ -840,6 +839,12 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> { sess.time("misc_checking_2", || { parallel!( + { + par_iter(&tcx.hir().krate().modules).for_each(|(&module, _)| { + let local_def_id = tcx.hir().local_def_id(module); + tcx.ensure().check_mod_unstable_api_usage(local_def_id); + }); + }, { sess.time("match_checking", || { tcx.par_body_owners(|def_id| {