Skip to content

Commit

Permalink
Auto merge of rust-lang#118534 - RalfJung:extern-type-size-of-val, r=…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
bors committed Dec 13, 2023
2 parents b5c0dd6 + aa3dc4c commit e3d2831
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
5 changes: 0 additions & 5 deletions build_system/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
"example/arbitrary_self_types_pointers_and_wrappers.rs",
&[],
),
TestCase::build_bin_and_run(
"aot.issue_91827_extern_types",
"example/issue-91827-extern-types.rs",
&[],
),
TestCase::build_lib("build.alloc_system", "example/alloc_system.rs", "lib"),
TestCase::build_bin_and_run("aot.alloc_example", "example/alloc_example.rs", &[]),
TestCase::jit_bin("jit.std_example", "example/std_example.rs", ""),
Expand Down
55 changes: 0 additions & 55 deletions example/issue-91827-extern-types.rs

This file was deleted.

0 comments on commit e3d2831

Please sign in to comment.