]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui-toml/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs
Merge commit 'b52fb5234cd7c11ecfae51897a6f7fa52e8777fc' into clippyup
[rust.git] / src / tools / clippy / tests / ui-toml / arithmetic_side_effects_allowed / arithmetic_side_effects_allowed.rs
1 #![warn(clippy::arithmetic_side_effects)]
2
3 use core::ops::Add;
4
5 #[derive(Clone, Copy)]
6 struct Point {
7     x: i32,
8     y: i32,
9 }
10
11 impl Add for Point {
12     type Output = Self;
13
14     fn add(self, other: Self) -> Self {
15         todo!()
16     }
17 }
18
19 fn main() {
20     let _ = Point { x: 1, y: 0 } + Point { x: 2, y: 3 };
21
22     let point: Point = Point { x: 1, y: 0 };
23     let _ = point + point;
24 }