summaryrefslogtreecommitdiffstats
path: root/src/test/ui/binop/issue-3820.rs
blob: b987a90b28baabcf50f5085d1e4fbc777972e3f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
struct Thing {
    x: isize
}

impl Thing {
    fn mul(&self, c: &isize) -> Thing {
        Thing {x: self.x * *c}
    }
}

fn main() {
    let u = Thing {x: 2};
    let _v = u.mul(&3); // This is ok
    let w = u * 3; //~ ERROR cannot multiply `Thing` by `{integer}`
}