fix a compiler crash (bug reported to rust-lang) and removed an unused import