]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-22992-2.rs
Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24
[rust.git] / src / test / ui / issues / issue-22992-2.rs
1 // run-pass
2 struct A(B);
3 struct B;
4
5 use std::ops::Deref;
6
7 impl Deref for A {
8     type Target = B;
9     fn deref(&self) -> &B { &self.0 }
10 }
11
12 impl B {
13     fn foo(&self) {}
14 }
15
16 fn main() {
17     A(B).foo();
18 }