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.
11 #![feature(tool_lints)]
13 #![feature(untagged_unions)]
16 #![warn(clippy::expl_impl_clone_on_copy)]
18 use std::hash::{Hash, Hasher};
20 #[derive(PartialEq, Hash)]
23 impl PartialEq<u64> for Foo {
24 fn eq(&self, _: &u64) -> bool { true }
30 impl PartialEq for Bar {
31 fn eq(&self, _: &Bar) -> bool { true }
37 impl PartialEq<Baz> for Baz {
38 fn eq(&self, _: &Baz) -> bool { true }
45 fn hash<H: Hasher>(&self, _: &mut H) {}
52 fn clone(&self) -> Self { Qux }
55 // looks like unions don't support deriving Clone for now
61 impl Clone for Union {
62 fn clone(&self) -> Self {
75 impl<'a> Clone for Lt<'a> {
76 fn clone(&self) -> Self { unimplemented!() }
79 // Ok, `Clone` cannot be derived because of the big array
85 impl Clone for BigArray {
86 fn clone(&self) -> Self { unimplemented!() }
89 // Ok, function pointers are not always Clone
95 impl Clone for FnPtr {
96 fn clone(&self) -> Self { unimplemented!() }
105 impl<T> Clone for Generic<T> {
106 fn clone(&self) -> Self { unimplemented!() }