Added test for #97732

This commit is contained in:
Chase Wilson 2022-06-04 13:33:56 -05:00
parent ba2f14e065
commit 857453d36c
No known key found for this signature in database
GPG Key ID: 65D05E5367092801

View File

@ -0,0 +1,23 @@
// check-pass
#![feature(coerce_unsized)]
// Ensure that unsizing structs that contain ZSTs at non-zero offsets don't ICE
use std::ops::CoerceUnsized;
#[repr(C)]
pub struct BoxWithZstTail<T: ?Sized>(Box<T>, ());
impl<S: ?Sized, T: ?Sized> CoerceUnsized<BoxWithZstTail<T>> for BoxWithZstTail<S> where
Box<S>: CoerceUnsized<Box<T>>
{
}
pub fn noop_dyn_upcast_with_zst_tail(
b: BoxWithZstTail<dyn Send + Sync>,
) -> BoxWithZstTail<dyn Send> {
b
}
fn main() {}