rustc: desugar use a::{b,c}; into use a::b; use a::c; in HIR.

This commit is contained in:
Eduard-Mihai Burtescu
2016-11-24 06:11:31 +02:00
parent 6ebc6d8154
commit bc096549e8
29 changed files with 228 additions and 395 deletions

View File

@@ -969,16 +969,6 @@ impl fmt::Display for clean::Import {
clean::Import::Glob(ref src) => {
write!(f, "use {}::*;", *src)
}
clean::Import::List(ref src, ref names) => {
write!(f, "use {}::{{", *src)?;
for (i, n) in names.iter().enumerate() {
if i > 0 {
write!(f, ", ")?;
}
write!(f, "{}", *n)?;
}
write!(f, "}};")
}
}
}
}
@@ -1000,23 +990,6 @@ impl fmt::Display for clean::ImportSource {
}
}
impl fmt::Display for clean::ViewListIdent {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self.source {
Some(did) => {
let path = clean::Path::singleton(self.name.clone());
resolved_path(f, did, &path, false)?;
}
_ => write!(f, "{}", self.name)?,
}
if let Some(ref name) = self.rename {
write!(f, " as {}", name)?;
}
Ok(())
}
}
impl fmt::Display for clean::TypeBinding {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if f.alternate() {