]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/inductive-overflow/supertrait-auto-trait.rs
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu
[rust.git] / tests / ui / traits / inductive-overflow / supertrait-auto-trait.rs
1 // Auto-trait-based version of #29859, supertrait version. Test that using
2 // a simple auto trait `..` impl alone still doesn't allow arbitrary bounds
3 // to be synthesized.
4
5 #![feature(auto_traits)]
6 #![feature(negative_impls)]
7
8 auto trait Magic: Copy {} //~ ERROR E0568
9
10 fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
11
12 #[derive(Debug)]
13 struct NoClone;
14
15 fn main() {
16     let (a, b) = copy(NoClone); //~ ERROR
17     println!("{:?} {:?}", a, b);
18 }