Skip to content

Commit 1f3f65b

Browse files
authored
Rollup merge of #110872 - Jules-Bertholet:err-67981, r=wesleywiser
Nicer ICE for #67981 Provides a slightly nicer ICE for #67981, documenting the problem. A proper fix will be necessary before `#![feature(unsized_fn_params)]` can be stabilized. The problem is that the design of the `"rust-call"` ABI is fundamentally not compatible with `unsized_fn_params`. `"rust-call"` functions need to collect their arguments into a tuple, but if the arguments are not `Sized`, said tuple is potentially not even a valid type—and if it is, it requires `alloca` to create. `@rustbot` label +A-abi +A-codegen +F-unboxed_closures +F-unsized_fn_params
2 parents ce1662a + 5b6e747 commit 1f3f65b

File tree

1 file changed

+11
-1
lines changed
  • compiler/rustc_codegen_ssa/src/mir

1 file changed

+11
-1
lines changed

Diff for: compiler/rustc_codegen_ssa/src/mir/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,17 @@ fn arg_local_refs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
304304
bug!("spread argument isn't a tuple?!");
305305
};
306306

307-
let place = PlaceRef::alloca(bx, bx.layout_of(arg_ty));
307+
let layout = bx.layout_of(arg_ty);
308+
309+
// FIXME: support unsized params in "rust-call" ABI
310+
if layout.is_unsized() {
311+
span_bug!(
312+
arg_decl.source_info.span,
313+
"\"rust-call\" ABI does not support unsized params",
314+
);
315+
}
316+
317+
let place = PlaceRef::alloca(bx, layout);
308318
for i in 0..tupled_arg_tys.len() {
309319
let arg = &fx.fn_abi.args[idx];
310320
idx += 1;

0 commit comments

Comments
 (0)