]> git.proxmox.com Git - rustc.git/blob - tests/ui/traits/inductive-overflow/supertrait.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / traits / inductive-overflow / supertrait.rs
1 // Regression test for #29859, supertrait version. This example
2 // allowed arbitrary trait bounds to be synthesized.
3
4 trait Magic: Copy {}
5 impl<T: Magic> Magic for T {}
6
7 fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
8
9 #[derive(Debug)]
10 struct NoClone;
11
12 fn main() {
13 let (a, b) = copy(NoClone); //~ ERROR E0275
14 println!("{:?} {:?}", a, b);
15 }