]> git.lizzy.rs Git - rust.git/blob - src/libcollections/tests/lib.rs
6ad5781c5d5fdf1984aee0dc5824bb46164d3d80
[rust.git] / src / libcollections / tests / lib.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![deny(warnings)]
12
13 #![feature(box_syntax)]
14 #![feature(inclusive_range_syntax)]
15 #![feature(collection_placement)]
16 #![feature(collections)]
17 #![feature(const_fn)]
18 #![feature(exact_size_is_empty)]
19 #![feature(pattern)]
20 #![feature(placement_in_syntax)]
21 #![feature(rand)]
22 #![feature(slice_rotate)]
23 #![feature(splice)]
24 #![feature(step_by)]
25 #![feature(str_escape)]
26 #![feature(test)]
27 #![feature(unboxed_closures)]
28 #![feature(unicode)]
29 #![feature(utf8_error_error_len)]
30
31 extern crate collections;
32 extern crate test;
33 extern crate std_unicode;
34 extern crate core;
35
36 use std::hash::{Hash, Hasher};
37 use std::collections::hash_map::DefaultHasher;
38
39 mod binary_heap;
40 mod btree;
41 mod cow_str;
42 mod fmt;
43 mod linked_list;
44 mod slice;
45 mod str;
46 mod string;
47 mod vec_deque;
48 mod vec;
49
50 fn hash<T: Hash>(t: &T) -> u64 {
51     let mut s = DefaultHasher::new();
52     t.hash(&mut s);
53     s.finish()
54 }