2020-11-24 15:44:04 -08: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 05:28:18 -05:00
|
|
|
// to be synthesized.
|
|
|
|
|
2020-11-22 19:54:31 -08:00
|
|
|
#![feature(auto_traits)]
|
2020-01-09 05:56:38 -05:00
|
|
|
#![feature(negative_impls)]
|
2016-01-16 05:28:18 -05:00
|
|
|
|
2017-12-03 10:56:53 -02:00
|
|
|
auto trait Magic: Copy {} //~ ERROR E0568
|
2016-01-16 05:28:18 -05:00
|
|
|
|
|
|
|
fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
struct NoClone;
|
|
|
|
|
|
|
|
fn main() {
|
2017-12-03 20:07:50 -02:00
|
|
|
let (a, b) = copy(NoClone); //~ ERROR
|
2016-01-16 05:28:18 -05:00
|
|
|
println!("{:?} {:?}", a, b);
|
|
|
|
}
|