mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
19 lines
315 B
Rust
19 lines
315 B
Rust
#[derive(Debug)]
|
|
struct Pair<T, V> (T, V);
|
|
|
|
impl Pair<
|
|
&str,
|
|
isize
|
|
> {
|
|
fn say(self: &Pair<&str, isize>) {
|
|
//~^ ERROR mismatched `self` parameter type
|
|
//~| ERROR mismatched `self` parameter type
|
|
println!("{:?}", self);
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let result = &Pair("shane", 1);
|
|
result.say();
|
|
}
|