rust/tests/ui/binop/issue-3820.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
270 B
Rust
Raw Normal View History

2013-01-10 21:44:27 +00:00
struct Thing {
x: isize
2013-01-10 21:44:27 +00:00
}
impl Thing {
fn mul(&self, c: &isize) -> Thing {
2013-01-10 21:44:27 +00:00
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}`
2013-01-10 21:44:27 +00:00
}