Remove all checks of IntrinsicDef::must_be_overridden except for the actual overrides in codegen

This commit is contained in:
Oli Scherer
2024-03-12 16:04:52 +00:00
parent e91084180e
commit a8f71cf289
7 changed files with 11 additions and 32 deletions

View File

@@ -1013,8 +1013,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
if let Some(source_scope) = scope {
self.source_scope = source_scope;
}
self.expr_into_dest(Place::return_place(), block, expr_id)
if self.tcx.intrinsic(self.def_id).is_some_and(|i| i.must_be_overridden) {
let source_info = self.source_info(rustc_span::DUMMY_SP);
self.cfg.terminate(block, source_info, TerminatorKind::Unreachable);
self.cfg.start_new_block().unit()
} else {
self.expr_into_dest(Place::return_place(), block, expr_id)
}
}
fn set_correct_source_scope_for_arg(