]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-50781.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-50781.rs
CommitLineData
8faf50e0 1#![deny(where_clauses_object_safety)]
94b46f34 2
8faf50e0 3trait Trait {}
94b46f34 4
8faf50e0
XL
5trait 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
10impl X for () {
11 fn foo(&self) {}
12}
94b46f34 13
8faf50e0 14impl Trait for dyn X {}
94b46f34 15
8faf50e0
XL
16pub fn main() {
17 // Check that this does not segfault.
dc9dc135 18 <dyn X as X>::foo(&());
94b46f34 19}