mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +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() {}
|