]> git.proxmox.com Git - rustc.git/blob - tests/ui/block-result/issue-22645.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / block-result / issue-22645.rs
1 use std::ops::Add;
2
3 trait Scalar {}
4 impl Scalar for f64 {}
5
6 struct Bob;
7
8 impl<RHS: Scalar> Add <RHS> for Bob {
9 type Output = Bob;
10 fn add(self, rhs : RHS) -> Bob { Bob }
11 }
12
13 fn main() {
14 let b = Bob + 3.5;
15 b + 3 //~ ERROR E0277
16 //~^ ERROR: mismatched types
17 }