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

@@ -633,12 +633,6 @@ fn optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> &Body<'_> {
}
fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> {
if tcx.intrinsic(did).is_some_and(|i| i.must_be_overridden) {
span_bug!(
tcx.def_span(did),
"this intrinsic must be overridden by the codegen backend, it has no meaningful body",
)
}
if tcx.is_constructor(did.to_def_id()) {
// There's no reason to run all of the MIR passes on constructors when
// we can just output the MIR we want directly. This also saves const