2018-10-08 01:13:37 -07:00
|
|
|
#[derive(Debug)]
|
|
|
|
struct Pair<T, V> (T, V);
|
|
|
|
|
|
|
|
impl Pair<
|
|
|
|
&str,
|
|
|
|
isize
|
|
|
|
> {
|
|
|
|
fn say(self: &Pair<&str, isize>) {
|
2018-11-27 10:56:36 +01:00
|
|
|
//~^ ERROR mismatched method receiver
|
|
|
|
//~| ERROR mismatched method receiver
|
2018-10-08 01:13:37 -07:00
|
|
|
println!("{:?}", self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let result = &Pair("shane", 1);
|
|
|
|
result.say();
|
|
|
|
}
|