2020-11-24 17:44:04 -06:00
|
|
|
// Auto-trait-based version of #29859, supertrait version. Test that using
|
|
|
|
// a simple auto trait `..` impl alone still doesn't allow arbitrary bounds
|
2016-01-16 04:28:18 -06:00
|
|
|
// to be synthesized.
|
|
|
|
|
2020-11-22 21:54:31 -06:00
|
|
|
#![feature(auto_traits)]
|
2020-01-09 04:56:38 -06:00
|
|
|
#![feature(negative_impls)]
|
2016-01-16 04:28:18 -06:00
|
|
|
|
2017-12-03 06:56:53 -06:00
|
|
|
auto trait Magic: Copy {} //~ ERROR E0568
|
2016-01-16 04:28:18 -06:00
|
|
|
|
|
|
|
fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
struct NoClone;
|
|
|
|
|
|
|
|
fn main() {
|
2017-12-03 16:07:50 -06:00
|
|
|
let (a, b) = copy(NoClone); //~ ERROR
|
2016-01-16 04:28:18 -06:00
|
|
|
println!("{:?} {:?}", a, b);
|
|
|
|
}
|