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.
10 #![feature(untagged_unions)]
12 #![warn(clippy::expl_impl_clone_on_copy)]
14 use std::hash::{Hash, Hasher};
16 #[derive(PartialEq, Hash)]
19 impl PartialEq<u64> for Foo {
20 fn eq(&self, _: &u64) -> bool {
28 impl PartialEq for Bar {
29 fn eq(&self, _: &Bar) -> bool {
37 impl PartialEq<Baz> for Baz {
38 fn eq(&self, _: &Baz) -> bool {
47 fn hash<H: Hasher>(&self, _: &mut H) {}
54 fn clone(&self) -> Self {
59 // looks like unions don't support deriving Clone for now
65 impl Clone for Union {
66 fn clone(&self) -> Self {
77 impl<'a> Clone for Lt<'a> {
78 fn clone(&self) -> Self {
83 // Ok, `Clone` cannot be derived because of the big array
89 impl Clone for BigArray {
90 fn clone(&self) -> Self {
95 // Ok, function pointers are not always Clone
101 impl Clone for FnPtr {
102 fn clone(&self) -> Self {
113 impl<T> Clone for Generic<T> {
114 fn clone(&self) -> Self {