diff options
Diffstat (limited to 'src/tools/clippy/src/docs/suspicious_arithmetic_impl.txt')
-rw-r--r-- | src/tools/clippy/src/docs/suspicious_arithmetic_impl.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/suspicious_arithmetic_impl.txt b/src/tools/clippy/src/docs/suspicious_arithmetic_impl.txt new file mode 100644 index 000000000..d67ff2793 --- /dev/null +++ b/src/tools/clippy/src/docs/suspicious_arithmetic_impl.txt @@ -0,0 +1,17 @@ +### What it does +Lints for suspicious operations in impls of arithmetic operators, e.g. +subtracting elements in an Add impl. + +### Why is this bad? +This is probably a typo or copy-and-paste error and not intended. + +### Example +``` +impl Add for Foo { + type Output = Foo; + + fn add(self, other: Foo) -> Foo { + Foo(self.0 - other.0) + } +} +```
\ No newline at end of file |