mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
20 lines
258 B
Rust
20 lines
258 B
Rust
// run-pass
|
|
|
|
#[derive(Debug)]
|
|
#[allow(unused_tuple_struct_fields)]
|
|
struct Pair<T, V> (T, V);
|
|
|
|
impl Pair<
|
|
&str,
|
|
isize
|
|
> {
|
|
fn say(&self) {
|
|
println!("{:?}", self);
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let result = &Pair("shane", 1);
|
|
result.say();
|
|
}
|