blob: c2edb4286585d99a16936c97880749b3a8e1e1f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//@ run-pass
struct A(B);
struct B;
use std::ops::Deref;
impl Deref for A {
type Target = B;
fn deref(&self) -> &B { &self.0 }
}
impl B {
fn foo(&self) {}
}
fn main() {
A(B).foo();
}
|