Closed
Description
libcore/ops.rs provides all kinds of operator implementations for “value” and “reference type” combinations. But one thing does not seem to work like it should:
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); // <-- everything but this works
show(&x + y);
show(&x + &y);
}
I think there is a problem with how these methods are looked up because the UFCS apparently works. This issue currently kind of blocks the libcoretest/ops.rs tests I was planning to add.
cc @aturon