]> git.proxmox.com Git - rustc.git/blob - tests/ui/deriving/deriving-meta.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / deriving / deriving-meta.rs
1 // run-pass
2 #![allow(unused_must_use)]
3 #![allow(unused_imports)]
4 // pretty-expanded FIXME #23616
5 #![allow(deprecated)]
6
7 use std::hash::{Hash, SipHasher};
8
9 #[derive(PartialEq, Clone, Hash)]
10 struct Foo {
11 bar: usize,
12 baz: isize
13 }
14
15 fn hash<T: Hash>(_t: &T) {}
16
17 pub fn main() {
18 let a = Foo {bar: 4, baz: -3};
19
20 a == a; // check for PartialEq impl w/o testing its correctness
21 a.clone(); // check for Clone impl w/o testing its correctness
22 hash(&a); // check for Hash impl w/o testing its correctness
23 }