2018-10-08 03:13:37 -05:00
|
|
|
#[derive(Debug)]
|
|
|
|
struct Pair<T, V> (T, V);
|
|
|
|
|
|
|
|
impl Pair<
|
|
|
|
&str,
|
|
|
|
isize
|
|
|
|
> {
|
|
|
|
fn say(self: &Pair<&str, isize>) {
|
2019-09-02 20:21:58 -05:00
|
|
|
//~^ ERROR mismatched `self` parameter type
|
|
|
|
//~| ERROR mismatched `self` parameter type
|
2018-10-08 03:13:37 -05:00
|
|
|
println!("{:?}", self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let result = &Pair("shane", 1);
|
|
|
|
result.say();
|
|
|
|
}
|