]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | #![deny(where_clauses_object_safety)] |
94b46f34 | 2 | |
8faf50e0 | 3 | trait Trait {} |
94b46f34 | 4 | |
8faf50e0 XL |
5 | trait X { |
6 | fn foo(&self) where Self: Trait; //~ ERROR the trait `X` cannot be made into an object | |
7 | //~^ WARN this was previously accepted by the compiler but is being phased out | |
8 | } | |
94b46f34 | 9 | |
8faf50e0 XL |
10 | impl X for () { |
11 | fn foo(&self) {} | |
12 | } | |
94b46f34 | 13 | |
8faf50e0 | 14 | impl Trait for dyn X {} |
94b46f34 | 15 | |
8faf50e0 XL |
16 | pub fn main() { |
17 | // Check that this does not segfault. | |
dc9dc135 | 18 | <dyn X as X>::foo(&()); |
94b46f34 | 19 | } |