]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/derive.rs
3 #![feature(untagged_unions)]
6 #![warn(expl_impl_clone_on_copy)]
8 use std
::hash
::{Hash, Hasher}
;
10 #[derive(PartialEq, Hash)]
13 impl PartialEq
<u64> for Foo
{
14 fn eq(&self, _
: &u64) -> bool { true }
20 impl PartialEq
for Bar
{
21 fn eq(&self, _
: &Bar
) -> bool { true }
27 impl PartialEq
<Baz
> for Baz
{
28 fn eq(&self, _
: &Baz
) -> bool { true }
35 fn hash
<H
: Hasher
>(&self, _
: &mut H
) {}
42 fn clone(&self) -> Self { Qux }
45 // looks like unions don't support deriving Clone for now
51 impl Clone
for Union
{
52 fn clone(&self) -> Self {
65 impl<'a
> Clone
for Lt
<'a
> {
66 fn clone(&self) -> Self { unimplemented!() }
69 // Ok, `Clone` cannot be derived because of the big array
75 impl Clone
for BigArray
{
76 fn clone(&self) -> Self { unimplemented!() }
79 // Ok, function pointers are not always Clone
85 impl Clone
for FnPtr
{
86 fn clone(&self) -> Self { unimplemented!() }
95 impl<T
> Clone
for Generic
<T
> {
96 fn clone(&self) -> Self { unimplemented!() }