]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/inductive-overflow/supertrait.rs
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.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 }