1 #![allow(unused_variables, clippy::disallowed_names)]
2 #![warn(clippy::op_ref)]
3 use std::collections::HashSet;
4 use std::ops::{BitAnd, Mul};
7 let tracked_fds: HashSet<i32> = HashSet::new();
8 let new_fds = HashSet::new();
9 let unwanted = &tracked_fds - &new_fds;
13 let bar = String::new();
14 let bar = "foo" == &bar;
16 let a = "a".to_string();
26 fn bitand(self, rhs: X) -> X {
30 impl<'a> BitAnd<&'a X> for X {
32 fn bitand(self, rhs: &'a X) -> X {
40 #[derive(Copy, Clone)]
44 fn bitand(self, rhs: Y) -> Y {
48 impl<'a> BitAnd<&'a Y> for Y {
50 fn bitand(self, rhs: &'a Y) -> Y {
59 #[derive(Clone, Copy)]
61 #[derive(Clone, Copy)]
66 fn mul(self, rhs: &A) -> Self::Output {
72 fn mul(self, rhs: A) -> Self::Output {
73 // Should not lint because removing the reference would lead to unconditional recursion
79 fn mul(self, rhs: &A) -> Self::Output {
85 fn mul(self, rhs: A) -> Self::Output {
91 // Removing the reference would lead to unconditional recursion