mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
25 lines
371 B
Rust
25 lines
371 B
Rust
|
#![warn(clippy::arithmetic)]
|
||
|
|
||
|
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;
|
||
|
}
|