]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-58734.rs
Rollup merge of #84083 - ltratt:threadid_doc_tweak, r=dtolnay
[rust.git] / src / test / ui / issues / issue-58734.rs
1 trait Trait {
2     fn exists(self) -> ();
3
4     fn not_object_safe() -> Self;
5 }
6
7 impl Trait for () {
8     fn exists(self) -> () {
9     }
10
11     fn not_object_safe() -> Self {
12         ()
13     }
14 }
15
16 fn main() {
17     // object-safe or not, this call is OK
18     Trait::exists(());
19     // no object safety error
20     Trait::nonexistent(());
21     //~^ ERROR no function or associated item named `nonexistent` found
22     //~| WARN trait objects without an explicit `dyn` are deprecated
23     //~| WARN this is accepted in the current edition
24 }