summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/inductive-overflow/supertrait-auto-trait.rs
blob: 5fea47a1be87daf50ce2ac7119d2a6c3284bd767 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Auto-trait-based version of #29859, supertrait version. Test that using
// a simple auto trait `..` impl alone still doesn't allow arbitrary bounds
// to be synthesized.

#![feature(auto_traits)]
#![feature(negative_impls)]

auto trait Magic: Copy {} //~ ERROR E0568

fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }

#[derive(Debug)]
struct NoClone;

fn main() {
    let (a, b) = copy(NoClone); //~ ERROR
    println!("{:?} {:?}", a, b);
}