Skip to content

Commit 9277766

Browse files
committed
Add a scheme for moving away from extern "rust-intrinsic" entirely
1 parent e45b4d3 commit 9277766

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/intrinsics/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,17 @@ fn codegen_regular_intrinsic_call<'tcx>(
12551255

12561256
// Unimplemented intrinsics must have a fallback body. The fallback body is obtained
12571257
// by converting the `InstanceDef::Intrinsic` to an `InstanceDef::Item`.
1258-
_ => return Err(Instance::new(instance.def_id(), instance.args)),
1258+
_ => {
1259+
let intrinsic = fx.tcx.intrinsic(instance.def_id()).unwrap();
1260+
if intrinsic.must_be_overridden {
1261+
span_bug!(
1262+
source_info.span,
1263+
"intrinsic {} must be overridden by codegen_cranelift, but isn't",
1264+
intrinsic.name,
1265+
);
1266+
}
1267+
return Err(Instance::new(instance.def_id(), instance.args));
1268+
}
12591269
}
12601270

12611271
let ret_block = fx.get_block(destination.unwrap());

0 commit comments

Comments
 (0)