blob: fbf60ce278df262de8b0842b1020c076e36061aa [file] [log] [blame]
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 binary operation `*` cannot be applied to type `Thing`
}