1 #![feature(specialization)] //~ WARN the feature `specialization` is incomplete
3 // Check a number of scenarios in which one impl tries to override another,
4 // without correctly using `default`.
6 // Test 1: one layer of specialization, multiple methods, missing `default`
20 fn foo(&self) {} //~ ERROR E0520
23 fn bar(&self) {} //~ ERROR E0520
26 // Test 2: one layer of specialization, missing `default` on associated type
37 type T = (); //~ ERROR E0520
40 // Test 3a: multiple layers of specialization, missing interior `default`
47 default fn baz(&self) {}
50 impl<T: Clone> Baz for T {
55 fn baz(&self) {} //~ ERROR E0520
58 // Test 3b: multiple layers of specialization, missing interior `default`,
59 // redundant `default` in bottom layer.
65 impl<T> Redundant for T {
66 default fn redundant(&self) {}
69 impl<T: Clone> Redundant for T {
70 fn redundant(&self) {}
73 impl Redundant for i32 {
74 default fn redundant(&self) {} //~ ERROR E0520