]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-58734.rs
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[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 for type `dyn Trait`
22 }