rust/tests/ui/traits/trait-upcasting/cyclic-trait-resolution.rs
2023-07-18 09:27:35 -04:00

14 lines
224 B
Rust

trait A: B + A {}
//~^ ERROR cycle detected when computing the super predicates of `A` [E0391]
trait B {}
impl A for () {}
impl B for () {}
fn main() {
let a: Box<dyn A> = Box::new(());
let _b: Box<dyn B> = a;
}