We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba2f14e commit 857453dCopy full SHA for 857453d
src/test/ui/unsized/issue-97732.rs
@@ -0,0 +1,23 @@
1
+// check-pass
2
+
3
+#![feature(coerce_unsized)]
4
5
+// Ensure that unsizing structs that contain ZSTs at non-zero offsets don't ICE
6
7
+use std::ops::CoerceUnsized;
8
9
+#[repr(C)]
10
+pub struct BoxWithZstTail<T: ?Sized>(Box<T>, ());
11
12
+impl<S: ?Sized, T: ?Sized> CoerceUnsized<BoxWithZstTail<T>> for BoxWithZstTail<S> where
13
+ Box<S>: CoerceUnsized<Box<T>>
14
+{
15
+}
16
17
+pub fn noop_dyn_upcast_with_zst_tail(
18
+ b: BoxWithZstTail<dyn Send + Sync>,
19
+) -> BoxWithZstTail<dyn Send> {
20
+ b
21
22
23
+fn main() {}
0 commit comments