Skip to content

Commit e3d2831

Browse files
committed
Auto merge of rust-lang#118534 - RalfJung:extern-type-size-of-val, r=WaffleLapkin
codegen: panic when trying to compute size/align of extern type The alignment is also computed when accessing a field of extern type at non-zero offset, so we also panic in that case. Previously `size_of_val` worked because the code path there assumed that "thin pointer" means "sized". But that's not true any more with extern types. The returned size and align are just blatantly wrong, so it seems better to panic than returning wrong results. We use a non-unwinding panic since code probably does not expect size_of_val to panic.
2 parents b5c0dd6 + aa3dc4c commit e3d2831

File tree

2 files changed

+0
-60
lines changed

2 files changed

+0
-60
lines changed

build_system/tests.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
7575
"example/arbitrary_self_types_pointers_and_wrappers.rs",
7676
&[],
7777
),
78-
TestCase::build_bin_and_run(
79-
"aot.issue_91827_extern_types",
80-
"example/issue-91827-extern-types.rs",
81-
&[],
82-
),
8378
TestCase::build_lib("build.alloc_system", "example/alloc_system.rs", "lib"),
8479
TestCase::build_bin_and_run("aot.alloc_example", "example/alloc_example.rs", &[]),
8580
TestCase::jit_bin("jit.std_example", "example/std_example.rs", ""),

example/issue-91827-extern-types.rs

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)