Rollup merge of #94242 - compiler-errors:fat-uninhabitable-pointer, r=michaelwoerister

properly handle fat pointers to uninhabitable types

Calculate the pointee metadata size by using `tcx.struct_tail_erasing_lifetimes` instead of duplicating the logic in `fat_pointer_kind`. Open to alternatively suggestions on how to fix this.

Fixes #94149

r? ````@michaelwoerister```` since you touched this code last, I think!
This commit is contained in:
Dylan DPC 2022-02-24 21:42:15 +01:00 committed by GitHub
commit 6b03a46f27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 18 deletions

View file

@ -449,7 +449,10 @@ fn pointer_or_reference_metadata<'ll, 'tcx>(
// This is a thin pointer. Create a regular pointer type and give it the correct name.
debug_assert_eq!(
(thin_pointer_size, thin_pointer_align),
cx.size_and_align_of(ptr_type)
cx.size_and_align_of(ptr_type),
"ptr_type={}, pointee_type={}",
ptr_type,
pointee_type,
);
unsafe {