]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_front/print/pprust.rs
Auto merge of #30457 - Manishearth:rollup, r=Manishearth
[rust.git] / src / librustc_front / print / pprust.rs
index d4cd70df38a495c48fed16c30b69bb48364b55e8..9ac0e65cba33b051e841e38f4648dc6c02b2e247 100644 (file)
@@ -12,9 +12,8 @@
 
 use syntax::abi;
 use syntax::ast;
-use syntax::owned_slice::OwnedSlice;
 use syntax::codemap::{self, CodeMap, BytePos, Spanned};
-use syntax::diagnostic;
+use syntax::errors;
 use syntax::parse::token::{self, BinOpToken};
 use syntax::parse::lexer::comments;
 use syntax::parse;
@@ -121,7 +120,7 @@ pub fn rust_printer_annotated<'a>(writer: Box<Write + 'a>,
 /// it can scan the input text for comments and literals to
 /// copy forward.
 pub fn print_crate<'a>(cm: &'a CodeMap,
-                       span_diagnostic: &diagnostic::SpanHandler,
+                       span_diagnostic: &errors::Handler,
                        krate: &hir::Crate,
                        filename: String,
                        input: &mut Read,
@@ -142,7 +141,7 @@ pub fn print_crate<'a>(cm: &'a CodeMap,
 
 impl<'a> State<'a> {
     pub fn new_from_input(cm: &'a CodeMap,
-                          span_diagnostic: &diagnostic::SpanHandler,
+                          span_diagnostic: &errors::Handler,
                           filename: String,
                           input: &mut Read,
                           out: Box<Write + 'a>,
@@ -473,7 +472,7 @@ pub fn print_foreign_mod(&mut self,
                              -> io::Result<()> {
         try!(self.print_inner_attributes(attrs));
         for item in &nmod.items {
-            try!(self.print_foreign_item(&**item));
+            try!(self.print_foreign_item(item));
         }
         Ok(())
     }
@@ -519,10 +518,10 @@ pub fn print_type(&mut self, ty: &hir::Ty) -> io::Result<()> {
             hir::TyBareFn(ref f) => {
                 let generics = hir::Generics {
                     lifetimes: f.lifetimes.clone(),
-                    ty_params: OwnedSlice::empty(),
+                    ty_params: P::empty(),
                     where_clause: hir::WhereClause {
                         id: ast::DUMMY_NODE_ID,
-                        predicates: Vec::new(),
+                        predicates: hir::HirVec::new(),
                     },
                 };
                 try!(self.print_ty_fn(f.abi, f.unsafety, &*f.decl, None, &generics, None));
@@ -878,7 +877,7 @@ pub fn print_enum_def(&mut self,
     }
 
     pub fn print_variants(&mut self,
-                          variants: &[P<hir::Variant>],
+                          variants: &[hir::Variant],
                           span: codemap::Span)
                           -> io::Result<()> {
         try!(self.bopen());
@@ -887,7 +886,7 @@ pub fn print_variants(&mut self,
             try!(self.maybe_print_comment(v.span.lo));
             try!(self.print_outer_attributes(&v.node.attrs));
             try!(self.ibox(indent_unit));
-            try!(self.print_variant(&**v));
+            try!(self.print_variant(v));
             try!(word(&mut self.s, ","));
             try!(self.end());
             try!(self.maybe_print_trailing_comment(v.span, None));
@@ -1107,7 +1106,7 @@ pub fn print_block_maybe_unclosed(&mut self,
         try!(self.print_inner_attributes(attrs));
 
         for st in &blk.stmts {
-            try!(self.print_stmt(&**st));
+            try!(self.print_stmt(st));
         }
         match blk.expr {
             Some(ref expr) => {
@@ -2257,11 +2256,11 @@ pub fn print_ty_fn(&mut self,
             try!(self.print_generics(generics));
         }
         let generics = hir::Generics {
-            lifetimes: Vec::new(),
-            ty_params: OwnedSlice::empty(),
+            lifetimes: hir::HirVec::new(),
+            ty_params: P::empty(),
             where_clause: hir::WhereClause {
                 id: ast::DUMMY_NODE_ID,
-                predicates: Vec::new(),
+                predicates: hir::HirVec::new(),
             },
         };
         try!(self.print_fn(decl,