]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coercion/issue-36007.rs
Auto merge of #103721 - RalfJung:miri, r=RalfJung
[rust.git] / src / test / ui / coercion / issue-36007.rs
1 // check-pass
2 #![feature(coerce_unsized, unsize)]
3
4 use std::marker::Unsize;
5 use std::ops::CoerceUnsized;
6
7 struct Foo<T: ?Sized>(Box<T>);
8
9 impl<T> CoerceUnsized<Foo<dyn Baz>> for Foo<T> where T: Unsize<dyn Baz> {}
10
11 struct Bar;
12
13 trait Baz {}
14
15 impl Baz for Bar {}
16
17 fn main() {
18     let foo = Foo(Box::new(Bar));
19     let foobar: Foo<Bar> = foo;
20 }