]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/print/pprust.rs
Minor fixups based on feedback
[rust.git] / src / libsyntax / print / pprust.rs
index a619da84b2d510529d679312641bf89b257b50e0..a77c678248b565642a31fc5b60851c62ff1a9299 100644 (file)
@@ -976,6 +976,9 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> io::Result<()> {
                 try!(self.print_opt_lifetime(lifetime));
                 try!(self.print_mt(mt));
             }
+            ast::TyKind::Never => {
+                try!(word(&mut self.s, "!"));
+            },
             ast::TyKind::Tup(ref elts) => {
                 try!(self.popen());
                 try!(self.commasep(Inconsistent, &elts[..],
@@ -1018,6 +1021,9 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> io::Result<()> {
             ast::TyKind::PolyTraitRef(ref bounds) => {
                 try!(self.print_bounds("", &bounds[..]));
             }
+            ast::TyKind::ImplTrait(ref bounds) => {
+                try!(self.print_bounds("impl ", &bounds[..]));
+            }
             ast::TyKind::FixedLengthVec(ref ty, ref v) => {
                 try!(word(&mut self.s, "["));
                 try!(self.print_type(&ty));
@@ -2690,10 +2696,6 @@ pub fn print_fn_block_args(
                 self.maybe_print_comment(ty.span.lo)
             }
             ast::FunctionRetTy::Default(..) => unreachable!(),
-            ast::FunctionRetTy::None(span) => {
-                try!(self.word_nbsp("!"));
-                self.maybe_print_comment(span.lo)
-            }
         }
     }
 
@@ -2949,8 +2951,6 @@ pub fn print_fn_output(&mut self, decl: &ast::FnDecl) -> io::Result<()> {
         try!(self.ibox(INDENT_UNIT));
         try!(self.word_space("->"));
         match decl.output {
-            ast::FunctionRetTy::None(_) =>
-                try!(self.word_nbsp("!")),
             ast::FunctionRetTy::Default(..) => unreachable!(),
             ast::FunctionRetTy::Ty(ref ty) =>
                 try!(self.print_type(&ty))