]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-50781.rs
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-50781.rs
1 #![deny(where_clauses_object_safety)]
2
3 trait Trait {}
4
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 }
9
10 impl X for () {
11     fn foo(&self) {}
12 }
13
14 impl Trait for dyn X {}
15
16 pub fn main() {
17     // Check that this does not segfault.
18     <dyn X as X>::foo(&());
19 }