summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui-toml/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs
blob: 1aed09b7c7bd4bc7dcdb4462191df436c0ba52ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#![warn(clippy::arithmetic_side_effects)]

use core::ops::Add;

#[derive(Clone, Copy)]
struct Point {
    x: i32,
    y: i32,
}

impl Add for Point {
    type Output = Self;

    fn add(self, other: Self) -> Self {
        todo!()
    }
}

fn main() {
    let _ = Point { x: 1, y: 0 } + Point { x: 2, y: 3 };

    let point: Point = Point { x: 1, y: 0 };
    let _ = point + point;
}