Skip to content

Commit 19b406d

Browse files
authored
Rollup merge of rust-lang#103631 - Rageking8:Add-test-for-issue-36007, r=compiler-errors
Add test for issue 36007 Fixes rust-lang#36007 r? ``@compiler-errors``
2 parents ab0d9df + f4ac137 commit 19b406d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/test/ui/coercion/issue-36007.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
}

0 commit comments

Comments
 (0)