add test for issue 36007
This commit is contained in:
parent
0da281b606
commit
f4ac137f3c
20
src/test/ui/coercion/issue-36007.rs
Normal file
20
src/test/ui/coercion/issue-36007.rs
Normal file
@ -0,0 +1,20 @@
|
||||
// check-pass
|
||||
#![feature(coerce_unsized, unsize)]
|
||||
|
||||
use std::marker::Unsize;
|
||||
use std::ops::CoerceUnsized;
|
||||
|
||||
struct Foo<T: ?Sized>(Box<T>);
|
||||
|
||||
impl<T> CoerceUnsized<Foo<dyn Baz>> for Foo<T> where T: Unsize<dyn Baz> {}
|
||||
|
||||
struct Bar;
|
||||
|
||||
trait Baz {}
|
||||
|
||||
impl Baz for Bar {}
|
||||
|
||||
fn main() {
|
||||
let foo = Foo(Box::new(Bar));
|
||||
let foobar: Foo<Bar> = foo;
|
||||
}
|
Loading…
Reference in New Issue
Block a user