diff options
| author | Chase Wilson <buckshot1233@gmail.com> | 2022-06-06 10:19:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-06 10:19:33 -0500 |
| commit | 10336cf1624ada36e8ba64e851d4df3f2976da81 (patch) | |
| tree | 70140dee4f315bf2c89faa38c0e70e458fd75f65 /src | |
| parent | 857453d36c5b396d2009e08b38b672695c5cddba (diff) | |
| download | rust-10336cf1624ada36e8ba64e851d4df3f2976da81.tar.gz rust-10336cf1624ada36e8ba64e851d4df3f2976da81.zip | |
Update src/test/ui/unsized/issue-97732.rs
Co-authored-by: Eduard-Mihai Burtescu <edy.burt@gmail.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/unsized/issue-97732.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/test/ui/unsized/issue-97732.rs b/src/test/ui/unsized/issue-97732.rs index 172f0724d42..72f76503396 100644 --- a/src/test/ui/unsized/issue-97732.rs +++ b/src/test/ui/unsized/issue-97732.rs @@ -15,9 +15,14 @@ impl<S: ?Sized, T: ?Sized> CoerceUnsized<BoxWithZstTail<T>> for BoxWithZstTail<S } pub fn noop_dyn_upcast_with_zst_tail( - b: BoxWithZstTail<dyn Send + Sync>, -) -> BoxWithZstTail<dyn Send> { + b: BoxWithZstTail<dyn ToString + Send>, +) -> BoxWithZstTail<dyn ToString> { b } -fn main() {} +fn main() { + let original = "foo"; + let boxed = BoxWithZstTail(Box::new(original) as Box<dyn ToString + Send>, ()); + let noop_upcasted = noop_dyn_upcast_with_zst_tail(boxed); + assert_eq!(original, noop_upcasted.0.to_string()); +} |
