Skip to content

Commit 8c07291

Browse files
committed
Tweak misc checking 1
1 parent c621cd6 commit 8c07291

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
@@ -786,13 +786,24 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
786786
sess.time("looking_for_derive_registrar", || proc_macro_decls::find(tcx));
787787
},
788788
{
789+
tcx.get_lang_items(LOCAL_CRATE);
790+
791+
let _timer = tcx.sess.timer("misc_module_passes");
789792
par_for_each(&tcx.hir().krate().modules, |(&module, _)| {
790793
let local_def_id = tcx.hir().local_def_id(module);
791794
tcx.ensure().check_mod_loops(local_def_id);
792795
tcx.ensure().check_mod_attrs(local_def_id);
793-
tcx.ensure().check_mod_unstable_api_usage(local_def_id);
794796
tcx.ensure().check_mod_const_bodies(local_def_id);
795797
});
798+
},
799+
{
800+
tcx.stability_index(LOCAL_CRATE);
801+
802+
let _timer = tcx.sess.timer("check_unstable_api_usage");
803+
par_for_each(&tcx.hir().krate().modules, |(&module, _)| {
804+
let local_def_id = tcx.hir().local_def_id(module);
805+
tcx.ensure().check_mod_unstable_api_usage(local_def_id);
806+
});
796807
}
797808
);
798809
});

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)