]> git.proxmox.com Git - rustc.git/blob - src/test/ui/deriving/deriving-meta-multiple.rs
Update upstream source from tag 'upstream/1.38.0+dfsg1'
[rustc.git] / src / test / ui / deriving / deriving-meta-multiple.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 // testing multiple separate deriving attributes
10 #[derive(PartialEq)]
11 #[derive(Clone)]
12 #[derive(Hash)]
13 struct Foo {
14 bar: usize,
15 baz: isize
16 }
17
18 fn hash<T: Hash>(_t: &T) {}
19
20 pub fn main() {
21 let a = Foo {bar: 4, baz: -3};
22
23 a == a; // check for PartialEq impl w/o testing its correctness
24 a.clone(); // check for Clone impl w/o testing its correctness
25 hash(&a); // check for Hash impl w/o testing its correctness
26 }