mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 14:13:58 +00:00
Fix compilation
This commit is contained in:
parent
3b6a6f6673
commit
67424000a9
2 changed files with 9 additions and 8 deletions
|
@ -1,4 +1,6 @@
|
||||||
extern crate itertools;
|
extern crate itertools;
|
||||||
|
|
||||||
|
use std::hash;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
||||||
#[derive(Debug, Eq)]
|
#[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> {
|
pub fn collect_tests(s: &str) -> Vec<Test> {
|
||||||
let mut res = vec![];
|
let mut res = vec![];
|
||||||
let prefix = "// ";
|
let prefix = "// ";
|
||||||
|
@ -21,7 +29,7 @@ pub fn collect_tests(s: &str) -> Vec<Test> {
|
||||||
.lines()
|
.lines()
|
||||||
.map(str::trim_left)
|
.map(str::trim_left)
|
||||||
.enumerate()
|
.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() {
|
'outer: for (is_comment, block) in comment_blocks.into_iter() {
|
||||||
if !is_comment {
|
if !is_comment {
|
||||||
|
|
|
@ -96,13 +96,6 @@ fn gen_tests(verify: bool) -> Result<()> {
|
||||||
Ok(())
|
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>> {
|
fn tests_from_dir(dir: &Path) -> Result<HashSet<Test>> {
|
||||||
let mut res = HashSet::new();
|
let mut res = HashSet::new();
|
||||||
for entry in ::walkdir::WalkDir::new(dir) {
|
for entry in ::walkdir::WalkDir::new(dir) {
|
||||||
|
|
Loading…
Reference in a new issue