Skip to content

Commit 10336cf

Browse files
Kixironeddyb
andauthored
Update src/test/ui/unsized/issue-97732.rs
Co-authored-by: Eduard-Mihai Burtescu <[email protected]>
1 parent 857453d commit 10336cf

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/test/ui/unsized/issue-97732.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ impl<S: ?Sized, T: ?Sized> CoerceUnsized<BoxWithZstTail<T>> for BoxWithZstTail<S
1515
}
1616

1717
pub fn noop_dyn_upcast_with_zst_tail(
18-
b: BoxWithZstTail<dyn Send + Sync>,
19-
) -> BoxWithZstTail<dyn Send> {
18+
b: BoxWithZstTail<dyn ToString + Send>,
19+
) -> BoxWithZstTail<dyn ToString> {
2020
b
2121
}
2222

23-
fn main() {}
23+
fn main() {
24+
let original = "foo";
25+
let boxed = BoxWithZstTail(Box::new(original) as Box<dyn ToString + Send>, ());
26+
let noop_upcasted = noop_dyn_upcast_with_zst_tail(boxed);
27+
assert_eq!(original, noop_upcasted.0.to_string());
28+
}

0 commit comments

Comments
 (0)