rust/tests/ui/traits/trait-upcasting/cyclic-trait-resolution.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
224 B
Rust
Raw Normal View History

2019-11-04 20:18:39 -06:00
trait A: B + A {}
2023-07-12 21:59:01 -05:00
//~^ ERROR cycle detected when computing the super predicates of `A` [E0391]
2019-11-04 20:18:39 -06:00
trait B {}
impl A for () {}
impl B for () {}
fn main() {
let a: Box<dyn A> = Box::new(());
let _b: Box<dyn B> = a;
}