mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
17 lines
308 B
Rust
17 lines
308 B
Rust
//@ run-pass
|
|
use std::ops::Add;
|
|
fn show(z: i32) {
|
|
println!("{}", z)
|
|
}
|
|
fn main() {
|
|
let x = 23;
|
|
let y = 42;
|
|
show(Add::add( x, y));
|
|
show(Add::add( x, &y));
|
|
show(Add::add(&x, y));
|
|
show(Add::add(&x, &y));
|
|
show( x + y);
|
|
show( x + &y);
|
|
show(&x + y);
|
|
show(&x + &y);
|
|
}
|