]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/trait-upcasting/cyclic-trait-resolution.rs
1666b7ba292b2d0d1bfc7a515be33d6b36b7a9e0
[rust.git] / src / test / ui / traits / trait-upcasting / cyclic-trait-resolution.rs
1 trait A: B + A {}
2 //~^ ERROR cycle detected when computing the supertraits of `A` [E0391]
3
4 trait B {}
5
6 impl A for () {}
7
8 impl B for () {}
9
10 fn main() {
11     let a: Box<dyn A> = Box::new(());
12     let _b: Box<dyn B> = a;
13 }