Skip to content

Commit

Permalink
add test for issue 36007
Browse files Browse the repository at this point in the history
  • Loading branch information
Rageking8 committed Oct 27, 2022
1 parent 0da281b commit f4ac137
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/ui/coercion/issue-36007.rs
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit f4ac137

Please sign in to comment.