]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-33387.rs
2 #![feature(rustc_attrs)]
7 fn get(&self) -> [u8; 2];
10 impl Foo
for [u8; 2] {
11 fn get(&self) -> [u8; 2] {
16 struct Bar
<T
: ?Sized
>(T
);
18 fn unsize_fat_ptr
<'a
>(x
: &'a Bar
<dyn Foo
+ Send
+ 'a
>) -> &'a Bar
<dyn Foo
+ 'a
> {
22 fn unsize_nested_fat_ptr(x
: Arc
<dyn Foo
+ Send
>) -> Arc
<dyn Foo
> {
27 let x
: Box
<Bar
<dyn Foo
+ Send
>> = Box
::new(Bar([1,2]));
28 assert_eq
!(unsize_fat_ptr(&*x
).0.get(), [1, 2]);
30 let x
: Arc
<dyn Foo
+ Send
> = Arc
::new([3, 4]);
31 assert_eq
!(unsize_nested_fat_ptr(x
).get(), [3, 4]);