]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/inductive-overflow/two-traits.rs
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu
[rust.git] / tests / ui / traits / inductive-overflow / two-traits.rs
1 // Regression test for #29859, initial version. This example allowed
2 // arbitrary trait bounds to be synthesized.
3
4 // Trait that you want all types to implement.
5 use std::marker::{Sync as Trait};
6
7 pub trait Magic {
8     type X: Trait;
9 }
10 impl<T: Magic> Magic for T {
11     type X = Self;
12     //~^ ERROR E0277
13 }
14
15 fn check<T: Trait>() {}
16
17 fn wizard<T: Magic>() { check::<<T as Magic>::X>(); }
18
19 fn main() {
20     wizard::<*mut ()>(); //~ ERROR E0275
21     // check::<*mut ()>();
22 }