Skip to content

Commit 011e972

Browse files
committed
Tweak misc checking 1
1 parent 27c98b8 commit 011e972

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/librustc_interface/passes.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,13 +783,24 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
783783
sess.time("looking_for_derive_registrar", || proc_macro_decls::find(tcx));
784784
},
785785
{
786+
tcx.get_lang_items(LOCAL_CRATE);
787+
788+
let _timer = tcx.sess.timer("misc_module_passes");
786789
par_for_each(&tcx.hir().krate().modules, |(&module, _)| {
787790
let local_def_id = tcx.hir().local_def_id(module);
788791
tcx.ensure().check_mod_loops(local_def_id);
789792
tcx.ensure().check_mod_attrs(local_def_id);
790-
tcx.ensure().check_mod_unstable_api_usage(local_def_id);
791793
tcx.ensure().check_mod_const_bodies(local_def_id);
792794
});
795+
},
796+
{
797+
tcx.stability_index(LOCAL_CRATE);
798+
799+
let _timer = tcx.sess.timer("check_unstable_api_usage");
800+
par_for_each(&tcx.hir().krate().modules, |(&module, _)| {
801+
let local_def_id = tcx.hir().local_def_id(module);
802+
tcx.ensure().check_mod_unstable_api_usage(local_def_id);
803+
});
793804
}
794805
);
795806
});

src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ const fn error(_: fn()) {}
77
#[rustc_allow_const_fn_ptr]
88
//~^ ERROR internal implementation detail
99
const fn compiles(_: fn()) {}
10+
//~^ ERROR rustc_promotable and rustc_allow_const_fn_ptr attributes must be paired
1011

1112
fn main() {}

src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ LL | #[rustc_allow_const_fn_ptr]
77
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
88
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
99

10-
error: aborting due to previous error
10+
error[E0717]: rustc_promotable and rustc_allow_const_fn_ptr attributes must be paired with either a rustc_const_unstable or a rustc_const_stable attribute
11+
--> $DIR/allow_const_fn_ptr_feature_gate.rs:9:1
12+
|
13+
LL | const fn compiles(_: fn()) {}
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
16+
error: aborting due to 2 previous errors
1117

1218
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)