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