Introduce the (WIP) THIR unsafety checker

This commit is contained in:
LeSeulArtichaut 2021-03-14 20:10:22 +01:00
parent d956122f7e
commit 29780f43e2
6 changed files with 343 additions and 1 deletions

View file

@ -884,7 +884,11 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
sess.time("MIR_effect_checking", || {
for def_id in tcx.body_owners() {
mir::transform::check_unsafety::check_unsafety(tcx, def_id);
if tcx.sess.opts.debugging_opts.thir_unsafeck {
tcx.ensure().thir_check_unsafety(def_id);
} else {
mir::transform::check_unsafety::check_unsafety(tcx, def_id);
}
if tcx.hir().body_const_context(def_id).is_some() {
tcx.ensure()

View file

@ -735,6 +735,7 @@ fn test_debugging_options_tracking_hash() {
tracked!(symbol_mangling_version, Some(SymbolManglingVersion::V0));
tracked!(teach, true);
tracked!(thinlto, Some(true));
tracked!(thir_unsafeck, true);
tracked!(tune_cpu, Some(String::from("abc")));
tracked!(tls_model, Some(TlsModel::GeneralDynamic));
tracked!(trap_unreachable, Some(false));