mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Fix compilation
This commit is contained in:
parent
3b6a6f6673
commit
67424000a9
@ -1,4 +1,6 @@
|
||||
extern crate itertools;
|
||||
|
||||
use std::hash;
|
||||
use itertools::Itertools;
|
||||
|
||||
#[derive(Debug, Eq)]
|
||||
@ -14,6 +16,12 @@ impl PartialEq for Test {
|
||||
}
|
||||
}
|
||||
|
||||
impl hash::Hash for Test {
|
||||
fn hash<H: hash::Hasher>(&self, state: &mut H) {
|
||||
self.name.hash(state)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn collect_tests(s: &str) -> Vec<Test> {
|
||||
let mut res = vec![];
|
||||
let prefix = "// ";
|
||||
@ -21,7 +29,7 @@ pub fn collect_tests(s: &str) -> Vec<Test> {
|
||||
.lines()
|
||||
.map(str::trim_left)
|
||||
.enumerate()
|
||||
.group_by(|(idx, line)| line.starts_with(prefix));
|
||||
.group_by(|(_idx, line)| line.starts_with(prefix));
|
||||
|
||||
'outer: for (is_comment, block) in comment_blocks.into_iter() {
|
||||
if !is_comment {
|
||||
|
@ -96,13 +96,6 @@ fn gen_tests(verify: bool) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
impl ::std::hash::Hash for Test {
|
||||
fn hash<H: ::std::hash::Hasher>(&self, state: &mut H) {
|
||||
self.name.hash(state)
|
||||
}
|
||||
}
|
||||
|
||||
fn tests_from_dir(dir: &Path) -> Result<HashSet<Test>> {
|
||||
let mut res = HashSet::new();
|
||||
for entry in ::walkdir::WalkDir::new(dir) {
|
||||
|
Loading…
Reference in New Issue
Block a user