Complete the removal of ty_nil, ast::LitNil, ast::TyBot and ast::TyUniq

[breaking-change]

This will break any uses of macros that assumed () being a valid literal.
This commit is contained in:
Jakub Bukaj
2014-11-09 16:14:15 +01:00
parent 08d6774f39
commit eb01b17b06
34 changed files with 348 additions and 405 deletions

View File

@@ -393,10 +393,7 @@ impl fmt::Show for clean::Type {
format!("<{:#}>", decl.lifetimes)
},
args = decl.decl.inputs,
arrow = match decl.decl.output {
clean::Primitive(clean::Unit) => "".to_string(),
_ => format!(" -> {}", decl.decl.output),
},
arrow = decl.decl.output,
bounds = {
let mut ret = String::new();
for bound in decl.bounds.iter() {
@@ -435,10 +432,7 @@ impl fmt::Show for clean::Type {
": {}",
m.collect::<Vec<String>>().connect(" + "))
},
arrow = match decl.decl.output {
clean::Primitive(clean::Unit) => "".to_string(),
_ => format!(" -&gt; {}", decl.decl.output)
})
arrow = decl.decl.output)
}
clean::BareFunction(ref decl) => {
write!(f, "{}{}fn{}{}",
@@ -514,14 +508,19 @@ impl fmt::Show for clean::Arguments {
}
}
impl fmt::Show for clean::FunctionRetTy {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
clean::Return(clean::Tuple(ref tys)) if tys.is_empty() => Ok(()),
clean::Return(ref ty) => write!(f, " -&gt; {}", ty),
clean::NoReturn => write!(f, " -&gt; !")
}
}
}
impl fmt::Show for clean::FnDecl {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "({args}){arrow}",
args = self.inputs,
arrow = match self.output {
clean::Primitive(clean::Unit) => "".to_string(),
_ => format!(" -&gt; {}", self.output),
})
write!(f, "({args}){arrow}", args = self.inputs, arrow = self.output)
}
}
@@ -551,12 +550,7 @@ impl<'a> fmt::Show for Method<'a> {
}
args.push_str(format!("{}", input.type_).as_slice());
}
write!(f, "({args}){arrow}",
args = args,
arrow = match d.output {
clean::Primitive(clean::Unit) => "".to_string(),
_ => format!(" -&gt; {}", d.output),
})
write!(f, "({args}){arrow}", args = args, arrow = d.output)
}
}