1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
14 #[allow(unused_assignments)]
15 #[warn(clippy::misrefactored_assign_op, clippy::assign_op_pattern)]
36 // check that we don't lint on op assign impls, because that's just the way to impl them
38 use std::ops::{Mul, MulAssign};
40 #[derive(Copy, Clone, Debug, PartialEq)]
43 impl Mul<i64> for Wrap {
46 fn mul(self, rhs: i64) -> Self {
51 impl MulAssign<i64> for Wrap {
52 fn mul_assign(&mut self, rhs: i64) {
59 let mut buf = Cow::Owned(String::from("bar"));
60 let cows = Cow::Borrowed("foo");
63 buf = buf + cows.clone();
65 // this should not as cow<str> Add is not commutative