]> git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/trait-resolution-in-overloaded-op.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / ui / traits / trait-resolution-in-overloaded-op.rs
1 // #12402 Operator overloading only considers the method name, not which trait is implemented
2
3 trait MyMul<Rhs, Res> {
4 fn mul(&self, rhs: &Rhs) -> Res;
5 }
6
7 fn foo<T: MyMul<f64, f64>>(a: &T, b: f64) -> f64 {
8 a * b //~ ERROR cannot multiply `&T` by `f64`
9 }
10
11 fn main() {}