]> git.proxmox.com Git - rustc.git/blob - tests/ui/issues/issue-50781.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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 }