]> git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/inductive-overflow/two-traits.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / 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 }