Round 5 test fixes and rebase conflicts

This commit is contained in:
Alex Crichton
2015-02-18 18:02:58 -08:00
parent cb29c468f3
commit 0cd54b85ef
8 changed files with 52 additions and 10 deletions

View File

@@ -104,7 +104,7 @@ struct EnvKey(CString);
#[derive(Eq, Clone, Debug)]
struct EnvKey(CString);
#[cfg(windows)]
#[cfg(all(windows, stage0))]
impl<H: hash::Writer + hash::Hasher> hash::Hash<H> for EnvKey {
fn hash(&self, state: &mut H) {
let &EnvKey(ref x) = self;
@@ -116,6 +116,18 @@ impl<H: hash::Writer + hash::Hasher> hash::Hash<H> for EnvKey {
}
}
}
#[cfg(all(windows, not(stage0)))]
impl hash::Hash for EnvKey {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
let &EnvKey(ref x) = self;
match str::from_utf8(x.as_bytes()) {
Ok(s) => for ch in s.chars() {
(ch as u8 as char).to_lowercase().hash(state);
},
Err(..) => x.hash(state)
}
}
}
#[cfg(windows)]
impl PartialEq for EnvKey {