mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
21 lines
381 B
Rust
21 lines
381 B
Rust
struct Article {
|
|
proof_reader: ProofReader,
|
|
}
|
|
|
|
struct ProofReader {
|
|
name: String,
|
|
}
|
|
|
|
pub trait HaveRelationship<To> {
|
|
fn get_relation(&self) -> To;
|
|
}
|
|
|
|
impl HaveRelationship<&ProofReader> for Article {
|
|
fn get_relation(&self) -> &ProofReader {
|
|
//~^ ERROR `impl` item signature doesn't match `trait` item signature
|
|
&self.proof_reader
|
|
}
|
|
}
|
|
|
|
fn main() {}
|