]> git.lizzy.rs Git - rust.git/commitdiff
Use more autoderef in libsyntax
authorJonas Schievink <jonas@schievink.net>
Mon, 8 Feb 2016 22:55:55 +0000 (23:55 +0100)
committerJonas Schievink <jonas@schievink.net>
Fri, 12 Feb 2016 18:28:42 +0000 (19:28 +0100)
src/libsyntax/attr.rs
src/libsyntax/ext/expand.rs
src/libsyntax/feature_gate.rs
src/libsyntax/fold.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/parser.rs
src/libsyntax/parse/token.rs
src/libsyntax/print/pprust.rs
src/libsyntax/ptr.rs
src/libsyntax/test.rs

index 9953947eb52b7c797c2a2a0538a1ddef76fbb602..dd414c463c7b1c4aea0bab5b160050c6200c0bde 100644 (file)
@@ -143,7 +143,7 @@ fn with_desugared_doc<T, F>(&self, f: F) -> T where
 impl AttributeMethods for Attribute {
     /// Extract the MetaItem from inside this Attribute.
     fn meta(&self) -> &MetaItem {
-        &*self.node.value
+        &self.node.value
     }
 
     /// Convert self to a normal #[doc="foo"] comment, if it is a
@@ -370,9 +370,9 @@ pub fn cfg_matches<T: CfgDiag>(cfgs: &[P<MetaItem>],
                            diag: &mut T) -> bool {
     match cfg.node {
         ast::MetaItemKind::List(ref pred, ref mis) if &pred[..] == "any" =>
-            mis.iter().any(|mi| cfg_matches(cfgs, &**mi, diag)),
+            mis.iter().any(|mi| cfg_matches(cfgs, &mi, diag)),
         ast::MetaItemKind::List(ref pred, ref mis) if &pred[..] == "all" =>
-            mis.iter().all(|mi| cfg_matches(cfgs, &**mi, diag)),
+            mis.iter().all(|mi| cfg_matches(cfgs, &mi, diag)),
         ast::MetaItemKind::List(ref pred, ref mis) if &pred[..] == "not" => {
             if mis.len() != 1 {
                 diag.emit_error(|diagnostic| {
@@ -380,7 +380,7 @@ pub fn cfg_matches<T: CfgDiag>(cfgs: &[P<MetaItem>],
                 });
                 return false;
             }
-            !cfg_matches(cfgs, &*mis[0], diag)
+            !cfg_matches(cfgs, &mis[0], diag)
         }
         ast::MetaItemKind::List(ref pred, _) => {
             diag.emit_error(|diagnostic| {
index 1ee108217c6b6a19481aede343e59c099d7e9f07..123a21fb8f0c00690b14eaef5b15292154c64276 100644 (file)
@@ -1040,7 +1040,7 @@ fn expand_item_multi_modifier(mut it: Annotatable,
                             allow_internal_unstable: true,
                         }
                     });
-                    it = mac.expand(fld.cx, attr.span, &*attr.node.value, it);
+                    it = mac.expand(fld.cx, attr.span, &attr.node.value, it);
                     fld.cx.bt_pop();
                 }
                 _ => unreachable!()
index 9bf1dd49db572ceb0f00f62f606571f604aeb18e..5dfec8dafcf3776e10193ff07ddb1dd7f8a1b4c3 100644 (file)
@@ -676,7 +676,7 @@ fn check_attribute(&self, attr: &ast::Attribute, is_macro: bool) {
             }
         }
         for &(ref n, ref ty) in self.plugin_attributes {
-            if &*n == name {
+            if n == name {
                 // Plugins can't gate attributes, so we don't check for it
                 // unlike the code above; we only use this loop to
                 // short-circuit to avoid the checks below
index d347899ca2e7a5f043bf44d7412eec6d801a1e92..6df313177a08cb4b37f8a9007cfd43e78601ea6b 100644 (file)
@@ -1071,7 +1071,7 @@ pub fn noop_fold_item_simple<T: Folder>(Item {id, ident, attrs, node, vis, span}
     let ident = match node {
         // The node may have changed, recompute the "pretty" impl name.
         ItemKind::Impl(_, _, _, ref maybe_trait, ref ty, _) => {
-            ast_util::impl_pretty_name(maybe_trait, Some(&**ty))
+            ast_util::impl_pretty_name(maybe_trait, Some(&ty))
         }
         _ => ident
     };
index 02844c35408df0ad804cf9a7fb5a6e6975f1bbdd..aaa6f79cb188adcd7769e1fdceca72dd18565639 100644 (file)
@@ -606,8 +606,8 @@ pub fn integer_lit(s: &str,
                 2 => sd.span_err(sp, "binary float literal is not supported"),
                 _ => ()
             }
-            let ident = token::intern_and_get_ident(&*s);
-            return filtered_float_lit(ident, Some(&**suf), sd, sp)
+            let ident = token::intern_and_get_ident(&s);
+            return filtered_float_lit(ident, Some(&suf), sd, sp)
         }
     }
 
@@ -990,24 +990,24 @@ fn parser_done(p: Parser){
     #[test] fn parse_use() {
         let use_s = "use foo::bar::baz;";
         let vitem = string_to_item(use_s.to_string()).unwrap();
-        let vitem_s = item_to_string(&*vitem);
+        let vitem_s = item_to_string(&vitem);
         assert_eq!(&vitem_s[..], use_s);
 
         let use_s = "use foo::bar as baz;";
         let vitem = string_to_item(use_s.to_string()).unwrap();
-        let vitem_s = item_to_string(&*vitem);
+        let vitem_s = item_to_string(&vitem);
         assert_eq!(&vitem_s[..], use_s);
     }
 
     #[test] fn parse_extern_crate() {
         let ex_s = "extern crate foo;";
         let vitem = string_to_item(ex_s.to_string()).unwrap();
-        let vitem_s = item_to_string(&*vitem);
+        let vitem_s = item_to_string(&vitem);
         assert_eq!(&vitem_s[..], ex_s);
 
         let ex_s = "extern crate foo as bar;";
         let vitem = string_to_item(ex_s.to_string()).unwrap();
-        let vitem_s = item_to_string(&*vitem);
+        let vitem_s = item_to_string(&vitem);
         assert_eq!(&vitem_s[..], ex_s);
     }
 
@@ -1030,7 +1030,7 @@ fn visit_pat(&mut self, p: &'v ast::Pat) {
             }
         }
         let mut v = PatIdentVisitor { spans: Vec::new() };
-        ::visit::walk_item(&mut v, &*item);
+        ::visit::walk_item(&mut v, &item);
         return v.spans;
     }
 
index 0d5bdfbbc3bb89ac4be733de5c0eb35256476e27..1e1877ec6ae0ace68d0a984b4d8885aaa1b6e23e 100644 (file)
@@ -444,7 +444,7 @@ fn tokens_to_string(tokens: &[TokenType]) -> String {
                 } else {
                     b.push_str(", ");
                 }
-                b.push_str(&*a.to_string());
+                b.push_str(&a.to_string());
                 b
             })
         }
@@ -696,7 +696,7 @@ pub fn expect_no_suffix(&self, sp: Span, kind: &str, suffix: Option<ast::Name>)
                 if text.is_empty() {
                     self.span_bug(sp, "found empty literal suffix in Some")
                 }
-                self.span_err(sp, &*format!("{} with a suffix is invalid", kind));
+                self.span_err(sp, &format!("{} with a suffix is invalid", kind));
             }
         }
     }
@@ -1574,7 +1574,7 @@ pub fn lit_from_token(&self, tok: &token::Token) -> PResult<'a, LitKind> {
 
                 if suffix_illegal {
                     let sp = self.last_span;
-                    self.expect_no_suffix(sp, &*format!("{} literal", lit.short_name()), suf)
+                    self.expect_no_suffix(sp, &format!("{} literal", lit.short_name()), suf)
                 }
 
                 Ok(out)
@@ -2083,7 +2083,7 @@ fn parse_bottom_expr(&mut self) -> PResult<'a, P<Expr>> {
                 let mut trailing_comma = false;
                 while self.token != token::CloseDelim(token::Paren) {
                     es.push(try!(self.parse_expr()));
-                    try!(self.commit_expr(&**es.last().unwrap(), &[],
+                    try!(self.commit_expr(&es.last().unwrap(), &[],
                                      &[token::Comma, token::CloseDelim(token::Paren)]));
                     if self.check(&token::Comma) {
                         trailing_comma = true;
@@ -2295,7 +2295,7 @@ fn parse_bottom_expr(&mut self) -> PResult<'a, P<Expr>> {
                                 }
 
                                 fields.push(try!(self.parse_field()));
-                                try!(self.commit_expr(&*fields.last().unwrap().expr,
+                                try!(self.commit_expr(&fields.last().unwrap().expr,
                                                  &[token::Comma],
                                                  &[token::CloseDelim(token::Brace)]));
                             }
@@ -2508,7 +2508,7 @@ fn parse_dot_or_call_expr_with_(&mut self, e0: P<Expr>, lo: BytePos) -> PResult<
                 }
                 continue;
             }
-            if self.expr_is_complete(&*e) { break; }
+            if self.expr_is_complete(&e) { break; }
             match self.token {
               // expr(...)
               token::OpenDelim(token::Paren) => {
@@ -2530,7 +2530,7 @@ fn parse_dot_or_call_expr_with_(&mut self, e0: P<Expr>, lo: BytePos) -> PResult<
                 self.bump();
                 let ix = try!(self.parse_expr());
                 hi = self.span.hi;
-                try!(self.commit_expr_expecting(&*ix, token::CloseDelim(token::Bracket)));
+                try!(self.commit_expr_expecting(&ix, token::CloseDelim(token::Bracket)));
                 let index = self.mk_index(e, ix);
                 e = self.mk_expr(lo, hi, index, None)
               }
@@ -2820,7 +2820,7 @@ pub fn parse_assoc_expr_with(&mut self,
         };
 
 
-        if self.expr_is_complete(&*lhs) {
+        if self.expr_is_complete(&lhs) {
             // Semi-statement forms are odd. See https://github.com/rust-lang/rust/issues/29071
             return Ok(lhs);
         }
@@ -2844,7 +2844,7 @@ pub fn parse_assoc_expr_with(&mut self,
             }
             self.bump();
             if op.is_comparison() {
-                self.check_no_chained_comparison(&*lhs, &op);
+                self.check_no_chained_comparison(&lhs, &op);
             }
             // Special cases:
             if op == AssocOp::As {
@@ -3152,7 +3152,7 @@ fn parse_match_expr(&mut self, attrs: ThinAttributes) -> PResult<'a, P<Expr>> {
         let lo = self.last_span.lo;
         let discriminant = try!(self.parse_expr_res(
             Restrictions::RESTRICTION_NO_STRUCT_LITERAL, None));
-        if let Err(mut e) = self.commit_expr_expecting(&*discriminant,
+        if let Err(mut e) = self.commit_expr_expecting(&discriminant,
                                                        token::OpenDelim(token::Brace)) {
             if self.token == token::Token::Semi {
                 e.span_note(match_span, "did you mean to remove this `match` keyword?");
@@ -3183,11 +3183,11 @@ pub fn parse_arm(&mut self) -> PResult<'a, Arm> {
         let expr = try!(self.parse_expr_res(Restrictions::RESTRICTION_STMT_EXPR, None));
 
         let require_comma =
-            !classify::expr_is_simple_block(&*expr)
+            !classify::expr_is_simple_block(&expr)
             && self.token != token::CloseDelim(token::Brace);
 
         if require_comma {
-            try!(self.commit_expr(&*expr, &[token::Comma], &[token::CloseDelim(token::Brace)]));
+            try!(self.commit_expr(&expr, &[token::Comma], &[token::CloseDelim(token::Brace)]));
         } else {
             self.eat(&token::Comma);
         }
@@ -3936,7 +3936,7 @@ fn handle_expression_like_statement(
             stmts: &mut Vec<Stmt>,
             last_block_expr: &mut Option<P<Expr>>) -> PResult<'a, ()> {
         // expression without semicolon
-        if classify::expr_requires_semi_to_be_stmt(&*e) {
+        if classify::expr_requires_semi_to_be_stmt(&e) {
             // Just check for errors and recover; do not eat semicolon yet.
             try!(self.commit_stmt(&[],
                              &[token::Semi, token::CloseDelim(token::Brace)]));
@@ -4861,7 +4861,7 @@ fn parse_item_impl(&mut self, unsafety: ast::Unsafety) -> PResult<'a, ItemInfo>
                 impl_items.push(try!(self.parse_impl_item()));
             }
 
-            Ok((ast_util::impl_pretty_name(&opt_trait, Some(&*ty)),
+            Ok((ast_util::impl_pretty_name(&opt_trait, Some(&ty)),
              ItemKind::Impl(unsafety, polarity, generics, opt_trait, ty, impl_items),
              Some(attrs)))
         }
@@ -5075,7 +5075,7 @@ fn parse_item_const(&mut self, m: Option<Mutability>) -> PResult<'a, ItemInfo> {
         let ty = try!(self.parse_ty_sum());
         try!(self.expect(&token::Eq));
         let e = try!(self.parse_expr());
-        try!(self.commit_expr_expecting(&*e, token::Semi));
+        try!(self.commit_expr_expecting(&e, token::Semi));
         let item = match m {
             Some(m) => ItemKind::Static(ty, m, e),
             None => ItemKind::Const(ty, e),
index 7d1b78b632f65eb3f477d7ec29656bc3a43b1830..accbb54c629b243220c4bdb33caa5f39349af5b4 100644 (file)
@@ -666,7 +666,7 @@ pub fn new_from_name(name: ast::Name) -> InternedString {
 impl Deref for InternedString {
     type Target = str;
 
-    fn deref(&self) -> &str { &*self.string }
+    fn deref(&self) -> &str { &self.string }
 }
 
 impl fmt::Debug for InternedString {
index 7e58fd9c3a1bff349c365675c851049981fd4d79..2eb719627da50dad109bbbaeccb6f2c6263569c4 100644 (file)
@@ -286,22 +286,22 @@ pub fn token_to_string(tok: &Token) -> String {
         token::SpecialVarNt(var)    => format!("${}", var.as_str()),
 
         token::Interpolated(ref nt) => match *nt {
-            token::NtExpr(ref e)        => expr_to_string(&**e),
-            token::NtMeta(ref e)        => meta_item_to_string(&**e),
-            token::NtTy(ref e)          => ty_to_string(&**e),
-            token::NtPath(ref e)        => path_to_string(&**e),
-            token::NtItem(ref e)        => item_to_string(&**e),
-            token::NtBlock(ref e)       => block_to_string(&**e),
-            token::NtStmt(ref e)        => stmt_to_string(&**e),
-            token::NtPat(ref e)         => pat_to_string(&**e),
+            token::NtExpr(ref e)        => expr_to_string(&e),
+            token::NtMeta(ref e)        => meta_item_to_string(&e),
+            token::NtTy(ref e)          => ty_to_string(&e),
+            token::NtPath(ref e)        => path_to_string(&e),
+            token::NtItem(ref e)        => item_to_string(&e),
+            token::NtBlock(ref e)       => block_to_string(&e),
+            token::NtStmt(ref e)        => stmt_to_string(&e),
+            token::NtPat(ref e)         => pat_to_string(&e),
             token::NtIdent(ref e, _)    => ident_to_string(e.node),
-            token::NtTT(ref e)          => tt_to_string(&**e),
-            token::NtArm(ref e)         => arm_to_string(&*e),
-            token::NtImplItem(ref e)    => impl_item_to_string(&**e),
-            token::NtTraitItem(ref e)   => trait_item_to_string(&**e),
-            token::NtGenerics(ref e)    => generics_to_string(&*e),
-            token::NtWhereClause(ref e) => where_clause_to_string(&*e),
-            token::NtArg(ref e)         => arg_to_string(&*e),
+            token::NtTT(ref e)          => tt_to_string(&e),
+            token::NtArm(ref e)         => arm_to_string(&e),
+            token::NtImplItem(ref e)    => impl_item_to_string(&e),
+            token::NtTraitItem(ref e)   => trait_item_to_string(&e),
+            token::NtGenerics(ref e)    => generics_to_string(&e),
+            token::NtWhereClause(ref e) => where_clause_to_string(&e),
+            token::NtArg(ref e)         => arg_to_string(&e),
         }
     }
 }
@@ -758,7 +758,7 @@ fn print_attribute_inline(&mut self, attr: &ast::Attribute,
                 ast::AttrStyle::Inner => try!(word(self.writer(), "#![")),
                 ast::AttrStyle::Outer => try!(word(self.writer(), "#[")),
             }
-            try!(self.print_meta_item(&*attr.meta()));
+            try!(self.print_meta_item(&attr.meta()));
             word(self.writer(), "]")
         }
     }
@@ -779,7 +779,7 @@ fn print_meta_item(&mut self, item: &ast::MetaItem) -> io::Result<()> {
                 try!(self.popen());
                 try!(self.commasep(Consistent,
                                    &items[..],
-                                   |s, i| s.print_meta_item(&**i)));
+                                   |s, i| s.print_meta_item(&i)));
                 try!(self.pclose());
             }
         }
@@ -923,14 +923,14 @@ pub fn commasep_cmnt<T, F, G>(&mut self,
 
     pub fn commasep_exprs(&mut self, b: Breaks,
                           exprs: &[P<ast::Expr>]) -> io::Result<()> {
-        self.commasep_cmnt(b, exprs, |s, e| s.print_expr(&**e), |e| e.span)
+        self.commasep_cmnt(b, exprs, |s, e| s.print_expr(&e), |e| e.span)
     }
 
     pub fn print_mod(&mut self, _mod: &ast::Mod,
                      attrs: &[ast::Attribute]) -> io::Result<()> {
         try!(self.print_inner_attributes(attrs));
         for item in &_mod.items {
-            try!(self.print_item(&**item));
+            try!(self.print_item(&item));
         }
         Ok(())
     }
@@ -959,7 +959,7 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> io::Result<()> {
         match ty.node {
             ast::TyKind::Vec(ref ty) => {
                 try!(word(&mut self.s, "["));
-                try!(self.print_type(&**ty));
+                try!(self.print_type(&ty));
                 try!(word(&mut self.s, "]"));
             }
             ast::TyKind::Ptr(ref mt) => {
@@ -968,7 +968,7 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> io::Result<()> {
                     ast::Mutability::Mutable => try!(self.word_nbsp("mut")),
                     ast::Mutability::Immutable => try!(self.word_nbsp("const")),
                 }
-                try!(self.print_type(&*mt.ty));
+                try!(self.print_type(&mt.ty));
             }
             ast::TyKind::Rptr(ref lifetime, ref mt) => {
                 try!(word(&mut self.s, "&"));
@@ -978,7 +978,7 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> io::Result<()> {
             ast::TyKind::Tup(ref elts) => {
                 try!(self.popen());
                 try!(self.commasep(Inconsistent, &elts[..],
-                                   |s, ty| s.print_type(&**ty)));
+                                   |s, ty| s.print_type(&ty)));
                 if elts.len() == 1 {
                     try!(word(&mut self.s, ","));
                 }
@@ -986,7 +986,7 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> io::Result<()> {
             }
             ast::TyKind::Paren(ref typ) => {
                 try!(self.popen());
-                try!(self.print_type(&**typ));
+                try!(self.print_type(&typ));
                 try!(self.pclose());
             }
             ast::TyKind::BareFn(ref f) => {
@@ -1000,7 +1000,7 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> io::Result<()> {
                 };
                 try!(self.print_ty_fn(f.abi,
                                       f.unsafety,
-                                      &*f.decl,
+                                      &f.decl,
                                       None,
                                       &generics,
                                       None));
@@ -1012,7 +1012,7 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> io::Result<()> {
                 try!(self.print_qpath(path, qself, false))
             }
             ast::TyKind::ObjectSum(ref ty, ref bounds) => {
-                try!(self.print_type(&**ty));
+                try!(self.print_type(&ty));
                 try!(self.print_bounds("+", &bounds[..]));
             }
             ast::TyKind::PolyTraitRef(ref bounds) => {
@@ -1020,14 +1020,14 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> io::Result<()> {
             }
             ast::TyKind::FixedLengthVec(ref ty, ref v) => {
                 try!(word(&mut self.s, "["));
-                try!(self.print_type(&**ty));
+                try!(self.print_type(&ty));
                 try!(word(&mut self.s, "; "));
-                try!(self.print_expr(&**v));
+                try!(self.print_expr(&v));
                 try!(word(&mut self.s, "]"));
             }
             ast::TyKind::Typeof(ref e) => {
                 try!(word(&mut self.s, "typeof("));
-                try!(self.print_expr(&**e));
+                try!(self.print_expr(&e));
                 try!(word(&mut self.s, ")"));
             }
             ast::TyKind::Infer => {
@@ -1064,7 +1064,7 @@ pub fn print_foreign_item(&mut self,
                 }
                 try!(self.print_ident(item.ident));
                 try!(self.word_space(":"));
-                try!(self.print_type(&**t));
+                try!(self.print_type(&t));
                 try!(word(&mut self.s, ";"));
                 try!(self.end()); // end the head-ibox
                 self.end() // end the outer cbox
@@ -1139,7 +1139,7 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
             ast::ItemKind::Use(ref vp) => {
                 try!(self.head(&visibility_qualified(item.vis,
                                                      "use")));
-                try!(self.print_view_path(&**vp));
+                try!(self.print_view_path(&vp));
                 try!(word(&mut self.s, ";"));
                 try!(self.end()); // end inner head-block
                 try!(self.end()); // end outer head-block
@@ -1152,12 +1152,12 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
                 }
                 try!(self.print_ident(item.ident));
                 try!(self.word_space(":"));
-                try!(self.print_type(&**ty));
+                try!(self.print_type(&ty));
                 try!(space(&mut self.s));
                 try!(self.end()); // end the head-ibox
 
                 try!(self.word_space("="));
-                try!(self.print_expr(&**expr));
+                try!(self.print_expr(&expr));
                 try!(word(&mut self.s, ";"));
                 try!(self.end()); // end the outer cbox
             }
@@ -1166,12 +1166,12 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
                                                     "const")));
                 try!(self.print_ident(item.ident));
                 try!(self.word_space(":"));
-                try!(self.print_type(&**ty));
+                try!(self.print_type(&ty));
                 try!(space(&mut self.s));
                 try!(self.end()); // end the head-ibox
 
                 try!(self.word_space("="));
-                try!(self.print_expr(&**expr));
+                try!(self.print_expr(&expr));
                 try!(word(&mut self.s, ";"));
                 try!(self.end()); // end the outer cbox
             }
@@ -1188,7 +1188,7 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
                     item.vis
                 ));
                 try!(word(&mut self.s, " "));
-                try!(self.print_block_with_attrs(&**body, &item.attrs));
+                try!(self.print_block_with_attrs(&body, &item.attrs));
             }
             ast::ItemKind::Mod(ref _mod) => {
                 try!(self.head(&visibility_qualified(item.vis,
@@ -1217,7 +1217,7 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
                 try!(self.print_where_clause(&params.where_clause));
                 try!(space(&mut self.s));
                 try!(self.word_space("="));
-                try!(self.print_type(&**ty));
+                try!(self.print_type(&ty));
                 try!(word(&mut self.s, ";"));
                 try!(self.end()); // end the outer ibox
             }
@@ -1279,7 +1279,7 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
                     None => {}
                 }
 
-                try!(self.print_type(&**ty));
+                try!(self.print_type(&ty));
                 try!(self.print_where_clause(&generics.where_clause));
 
                 try!(space(&mut self.s));
@@ -1412,7 +1412,7 @@ pub fn print_struct(&mut self,
                             ast::UnnamedField(vis) => {
                                 try!(s.print_visibility(vis));
                                 try!(s.maybe_print_comment(field.span.lo));
-                                s.print_type(&*field.node.ty)
+                                s.print_type(&field.node.ty)
                             }
                         }
                     }
@@ -1441,7 +1441,7 @@ pub fn print_struct(&mut self,
                         try!(self.print_visibility(visibility));
                         try!(self.print_ident(ident));
                         try!(self.word_nbsp(":"));
-                        try!(self.print_type(&*field.node.ty));
+                        try!(self.print_type(&field.node.ty));
                         try!(word(&mut self.s, ","));
                     }
                 }
@@ -1524,7 +1524,7 @@ pub fn print_variant(&mut self, v: &ast::Variant) -> io::Result<()> {
             Some(ref d) => {
                 try!(space(&mut self.s));
                 try!(self.word_space("="));
-                self.print_expr(&**d)
+                self.print_expr(&d)
             }
             _ => Ok(())
         }
@@ -1614,15 +1614,15 @@ pub fn print_stmt(&mut self, st: &ast::Stmt) -> io::Result<()> {
         try!(self.maybe_print_comment(st.span.lo));
         match st.node {
             ast::StmtKind::Decl(ref decl, _) => {
-                try!(self.print_decl(&**decl));
+                try!(self.print_decl(&decl));
             }
             ast::StmtKind::Expr(ref expr, _) => {
                 try!(self.space_if_not_bol());
-                try!(self.print_expr_outer_attr_style(&**expr, false));
+                try!(self.print_expr_outer_attr_style(&expr, false));
             }
             ast::StmtKind::Semi(ref expr, _) => {
                 try!(self.space_if_not_bol());
-                try!(self.print_expr_outer_attr_style(&**expr, false));
+                try!(self.print_expr_outer_attr_style(&expr, false));
                 try!(word(&mut self.s, ";"));
             }
             ast::StmtKind::Mac(ref mac, style, ref attrs) => {
@@ -1632,7 +1632,7 @@ pub fn print_stmt(&mut self, st: &ast::Stmt) -> io::Result<()> {
                     ast::MacStmtStyle::Braces => token::Brace,
                     _ => token::Paren
                 };
-                try!(self.print_mac(&**mac, delim));
+                try!(self.print_mac(&mac, delim));
                 match style {
                     ast::MacStmtStyle::Braces => {}
                     _ => try!(word(&mut self.s, ";")),
@@ -1691,7 +1691,7 @@ pub fn print_block_maybe_unclosed(&mut self,
         match blk.expr {
             Some(ref expr) => {
                 try!(self.space_if_not_bol());
-                try!(self.print_expr_outer_attr_style(&**expr, false));
+                try!(self.print_expr_outer_attr_style(&expr, false));
                 try!(self.maybe_print_trailing_comment(expr.span, Some(blk.span.hi)));
             }
             _ => ()
@@ -1709,9 +1709,9 @@ fn print_else(&mut self, els: Option<&ast::Expr>) -> io::Result<()> {
                         try!(self.cbox(INDENT_UNIT - 1));
                         try!(self.ibox(0));
                         try!(word(&mut self.s, " else if "));
-                        try!(self.print_expr(&**i));
+                        try!(self.print_expr(&i));
                         try!(space(&mut self.s));
-                        try!(self.print_block(&**then));
+                        try!(self.print_block(&then));
                         self.print_else(e.as_ref().map(|e| &**e))
                     }
                     // "another else-if-let"
@@ -1719,12 +1719,12 @@ fn print_else(&mut self, els: Option<&ast::Expr>) -> io::Result<()> {
                         try!(self.cbox(INDENT_UNIT - 1));
                         try!(self.ibox(0));
                         try!(word(&mut self.s, " else if let "));
-                        try!(self.print_pat(&**pat));
+                        try!(self.print_pat(&pat));
                         try!(space(&mut self.s));
                         try!(self.word_space("="));
-                        try!(self.print_expr(&**expr));
+                        try!(self.print_expr(&expr));
                         try!(space(&mut self.s));
-                        try!(self.print_block(&**then));
+                        try!(self.print_block(&then));
                         self.print_else(e.as_ref().map(|e| &**e))
                     }
                     // "final else"
@@ -1732,7 +1732,7 @@ fn print_else(&mut self, els: Option<&ast::Expr>) -> io::Result<()> {
                         try!(self.cbox(INDENT_UNIT - 1));
                         try!(self.ibox(0));
                         try!(word(&mut self.s, " else "));
-                        self.print_block(&**b)
+                        self.print_block(&b)
                     }
                     // BLEAH, constraints would be great here
                     _ => {
@@ -1867,7 +1867,7 @@ fn print_expr_struct(&mut self,
                 try!(s.ibox(INDENT_UNIT));
                 try!(s.print_ident(field.ident.node));
                 try!(s.word_space(":"));
-                try!(s.print_expr(&*field.expr));
+                try!(s.print_expr(&field.expr));
                 s.end()
             },
             |f| f.span));
@@ -1879,7 +1879,7 @@ fn print_expr_struct(&mut self,
                     try!(space(&mut self.s));
                 }
                 try!(word(&mut self.s, ".."));
-                try!(self.print_expr(&**expr));
+                try!(self.print_expr(&expr));
                 try!(self.end());
             }
             _ => if !fields.is_empty() {
@@ -1913,13 +1913,13 @@ fn print_expr_method_call(&mut self,
                               tys: &[P<ast::Ty>],
                               args: &[P<ast::Expr>]) -> io::Result<()> {
         let base_args = &args[1..];
-        try!(self.print_expr(&*args[0]));
+        try!(self.print_expr(&args[0]));
         try!(word(&mut self.s, "."));
         try!(self.print_ident(ident.node));
         if !tys.is_empty() {
             try!(word(&mut self.s, "::<"));
             try!(self.commasep(Inconsistent, tys,
-                               |s, ty| s.print_type(&**ty)));
+                               |s, ty| s.print_type(&ty)));
             try!(word(&mut self.s, ">"));
         }
         self.print_call_post(base_args)
@@ -1988,7 +1988,7 @@ fn print_expr_outer_attr_style(&mut self,
                 try!(self.print_expr_vec(&exprs[..], attrs));
             }
             ast::ExprKind::Repeat(ref element, ref count) => {
-                try!(self.print_expr_repeat(&**element, &**count, attrs));
+                try!(self.print_expr_repeat(&element, &count, attrs));
             }
             ast::ExprKind::Struct(ref path, ref fields, ref wth) => {
                 try!(self.print_expr_struct(path, &fields[..], wth, attrs));
@@ -1997,43 +1997,43 @@ fn print_expr_outer_attr_style(&mut self,
                 try!(self.print_expr_tup(&exprs[..], attrs));
             }
             ast::ExprKind::Call(ref func, ref args) => {
-                try!(self.print_expr_call(&**func, &args[..]));
+                try!(self.print_expr_call(&func, &args[..]));
             }
             ast::ExprKind::MethodCall(ident, ref tys, ref args) => {
                 try!(self.print_expr_method_call(ident, &tys[..], &args[..]));
             }
             ast::ExprKind::Binary(op, ref lhs, ref rhs) => {
-                try!(self.print_expr_binary(op, &**lhs, &**rhs));
+                try!(self.print_expr_binary(op, &lhs, &rhs));
             }
             ast::ExprKind::Unary(op, ref expr) => {
-                try!(self.print_expr_unary(op, &**expr));
+                try!(self.print_expr_unary(op, &expr));
             }
             ast::ExprKind::AddrOf(m, ref expr) => {
-                try!(self.print_expr_addr_of(m, &**expr));
+                try!(self.print_expr_addr_of(m, &expr));
             }
             ast::ExprKind::Lit(ref lit) => {
-                try!(self.print_literal(&**lit));
+                try!(self.print_literal(&lit));
             }
             ast::ExprKind::Cast(ref expr, ref ty) => {
                 if let ast::ExprKind::Cast(..) = expr.node {
-                    try!(self.print_expr(&**expr));
+                    try!(self.print_expr(&expr));
                 } else {
-                    try!(self.print_expr_maybe_paren(&**expr));
+                    try!(self.print_expr_maybe_paren(&expr));
                 }
                 try!(space(&mut self.s));
                 try!(self.word_space("as"));
-                try!(self.print_type(&**ty));
+                try!(self.print_type(&ty));
             }
             ast::ExprKind::Type(ref expr, ref ty) => {
-                try!(self.print_expr(&**expr));
+                try!(self.print_expr(&expr));
                 try!(self.word_space(":"));
-                try!(self.print_type(&**ty));
+                try!(self.print_type(&ty));
             }
             ast::ExprKind::If(ref test, ref blk, ref elseopt) => {
-                try!(self.print_if(&**test, &**blk, elseopt.as_ref().map(|e| &**e)));
+                try!(self.print_if(&test, &blk, elseopt.as_ref().map(|e| &**e)));
             }
             ast::ExprKind::IfLet(ref pat, ref expr, ref blk, ref elseopt) => {
-                try!(self.print_if_let(&**pat, &**expr, &** blk, elseopt.as_ref().map(|e| &**e)));
+                try!(self.print_if_let(&pat, &expr, &blk, elseopt.as_ref().map(|e| &**e)));
             }
             ast::ExprKind::While(ref test, ref blk, opt_ident) => {
                 if let Some(ident) = opt_ident {
@@ -2041,9 +2041,9 @@ fn print_expr_outer_attr_style(&mut self,
                     try!(self.word_space(":"));
                 }
                 try!(self.head("while"));
-                try!(self.print_expr(&**test));
+                try!(self.print_expr(&test));
                 try!(space(&mut self.s));
-                try!(self.print_block_with_attrs(&**blk, attrs));
+                try!(self.print_block_with_attrs(&blk, attrs));
             }
             ast::ExprKind::WhileLet(ref pat, ref expr, ref blk, opt_ident) => {
                 if let Some(ident) = opt_ident {
@@ -2051,12 +2051,12 @@ fn print_expr_outer_attr_style(&mut self,
                     try!(self.word_space(":"));
                 }
                 try!(self.head("while let"));
-                try!(self.print_pat(&**pat));
+                try!(self.print_pat(&pat));
                 try!(space(&mut self.s));
                 try!(self.word_space("="));
-                try!(self.print_expr(&**expr));
+                try!(self.print_expr(&expr));
                 try!(space(&mut self.s));
-                try!(self.print_block_with_attrs(&**blk, attrs));
+                try!(self.print_block_with_attrs(&blk, attrs));
             }
             ast::ExprKind::ForLoop(ref pat, ref iter, ref blk, opt_ident) => {
                 if let Some(ident) = opt_ident {
@@ -2064,12 +2064,12 @@ fn print_expr_outer_attr_style(&mut self,
                     try!(self.word_space(":"));
                 }
                 try!(self.head("for"));
-                try!(self.print_pat(&**pat));
+                try!(self.print_pat(&pat));
                 try!(space(&mut self.s));
                 try!(self.word_space("in"));
-                try!(self.print_expr(&**iter));
+                try!(self.print_expr(&iter));
                 try!(space(&mut self.s));
-                try!(self.print_block_with_attrs(&**blk, attrs));
+                try!(self.print_block_with_attrs(&blk, attrs));
             }
             ast::ExprKind::Loop(ref blk, opt_ident) => {
                 if let Some(ident) = opt_ident {
@@ -2078,13 +2078,13 @@ fn print_expr_outer_attr_style(&mut self,
                 }
                 try!(self.head("loop"));
                 try!(space(&mut self.s));
-                try!(self.print_block_with_attrs(&**blk, attrs));
+                try!(self.print_block_with_attrs(&blk, attrs));
             }
             ast::ExprKind::Match(ref expr, ref arms) => {
                 try!(self.cbox(INDENT_UNIT));
                 try!(self.ibox(4));
                 try!(self.word_nbsp("match"));
-                try!(self.print_expr(&**expr));
+                try!(self.print_expr(&expr));
                 try!(space(&mut self.s));
                 try!(self.bopen());
                 try!(self.print_inner_attributes_no_trailing_hardbreak(attrs));
@@ -2096,7 +2096,7 @@ fn print_expr_outer_attr_style(&mut self,
             ast::ExprKind::Closure(capture_clause, ref decl, ref body) => {
                 try!(self.print_capture_clause(capture_clause));
 
-                try!(self.print_fn_block_args(&**decl));
+                try!(self.print_fn_block_args(&decl));
                 try!(space(&mut self.s));
 
                 let default_return = match decl.output {
@@ -2105,19 +2105,19 @@ fn print_expr_outer_attr_style(&mut self,
                 };
 
                 if !default_return || !body.stmts.is_empty() || body.expr.is_none() {
-                    try!(self.print_block_unclosed(&**body));
+                    try!(self.print_block_unclosed(&body));
                 } else {
                     // we extract the block, so as not to create another set of boxes
                     let i_expr = body.expr.as_ref().unwrap();
                     match i_expr.node {
                         ast::ExprKind::Block(ref blk) => {
                             try!(self.print_block_unclosed_with_attrs(
-                                &**blk,
+                                &blk,
                                 i_expr.attrs.as_attr_slice()));
                         }
                         _ => {
                             // this is a bare expression
-                            try!(self.print_expr(&**i_expr));
+                            try!(self.print_expr(&i_expr));
                             try!(self.end()); // need to close a box
                         }
                     }
@@ -2132,44 +2132,44 @@ fn print_expr_outer_attr_style(&mut self,
                 try!(self.cbox(INDENT_UNIT));
                 // head-box, will be closed by print-block after {
                 try!(self.ibox(0));
-                try!(self.print_block_with_attrs(&**blk, attrs));
+                try!(self.print_block_with_attrs(&blk, attrs));
             }
             ast::ExprKind::Assign(ref lhs, ref rhs) => {
-                try!(self.print_expr(&**lhs));
+                try!(self.print_expr(&lhs));
                 try!(space(&mut self.s));
                 try!(self.word_space("="));
-                try!(self.print_expr(&**rhs));
+                try!(self.print_expr(&rhs));
             }
             ast::ExprKind::AssignOp(op, ref lhs, ref rhs) => {
-                try!(self.print_expr(&**lhs));
+                try!(self.print_expr(&lhs));
                 try!(space(&mut self.s));
                 try!(word(&mut self.s, op.node.to_string()));
                 try!(self.word_space("="));
-                try!(self.print_expr(&**rhs));
+                try!(self.print_expr(&rhs));
             }
             ast::ExprKind::Field(ref expr, id) => {
-                try!(self.print_expr(&**expr));
+                try!(self.print_expr(&expr));
                 try!(word(&mut self.s, "."));
                 try!(self.print_ident(id.node));
             }
             ast::ExprKind::TupField(ref expr, id) => {
-                try!(self.print_expr(&**expr));
+                try!(self.print_expr(&expr));
                 try!(word(&mut self.s, "."));
                 try!(self.print_usize(id.node));
             }
             ast::ExprKind::Index(ref expr, ref index) => {
-                try!(self.print_expr(&**expr));
+                try!(self.print_expr(&expr));
                 try!(word(&mut self.s, "["));
-                try!(self.print_expr(&**index));
+                try!(self.print_expr(&index));
                 try!(word(&mut self.s, "]"));
             }
             ast::ExprKind::Range(ref start, ref end) => {
                 if let &Some(ref e) = start {
-                    try!(self.print_expr(&**e));
+                    try!(self.print_expr(&e));
                 }
                 try!(word(&mut self.s, ".."));
                 if let &Some(ref e) = end {
-                    try!(self.print_expr(&**e));
+                    try!(self.print_expr(&e));
                 }
             }
             ast::ExprKind::Path(None, ref path) => {
@@ -2199,7 +2199,7 @@ fn print_expr_outer_attr_style(&mut self,
                 match *result {
                     Some(ref expr) => {
                         try!(word(&mut self.s, " "));
-                        try!(self.print_expr(&**expr));
+                        try!(self.print_expr(&expr));
                     }
                     _ => ()
                 }
@@ -2220,7 +2220,7 @@ fn print_expr_outer_attr_style(&mut self,
                         _ => try!(s.print_string(&out.constraint, ast::StrStyle::Cooked))
                     }
                     try!(s.popen());
-                    try!(s.print_expr(&*out.expr));
+                    try!(s.print_expr(&out.expr));
                     try!(s.pclose());
                     Ok(())
                 }));
@@ -2231,7 +2231,7 @@ fn print_expr_outer_attr_style(&mut self,
                                    |s, &(ref co, ref o)| {
                     try!(s.print_string(&co, ast::StrStyle::Cooked));
                     try!(s.popen());
-                    try!(s.print_expr(&**o));
+                    try!(s.print_expr(&o));
                     try!(s.pclose());
                     Ok(())
                 }));
@@ -2258,7 +2258,7 @@ fn print_expr_outer_attr_style(&mut self,
                 if !options.is_empty() {
                     try!(space(&mut self.s));
                     try!(self.word_space(":"));
-                    try!(self.commasep(Inconsistent, &*options,
+                    try!(self.commasep(Inconsistent, &options,
                                        |s, &co| {
                         try!(s.print_string(co, ast::StrStyle::Cooked));
                         Ok(())
@@ -2271,7 +2271,7 @@ fn print_expr_outer_attr_style(&mut self,
             ast::ExprKind::Paren(ref e) => {
                 try!(self.popen());
                 try!(self.print_inner_attributes_inline(attrs));
-                try!(self.print_expr(&**e));
+                try!(self.print_expr(&e));
                 try!(self.pclose());
             }
         }
@@ -2280,10 +2280,10 @@ fn print_expr_outer_attr_style(&mut self,
     }
 
     pub fn print_local_decl(&mut self, loc: &ast::Local) -> io::Result<()> {
-        try!(self.print_pat(&*loc.pat));
+        try!(self.print_pat(&loc.pat));
         if let Some(ref ty) = loc.ty {
             try!(self.word_space(":"));
-            try!(self.print_type(&**ty));
+            try!(self.print_type(&ty));
         }
         Ok(())
     }
@@ -2298,16 +2298,16 @@ pub fn print_decl(&mut self, decl: &ast::Decl) -> io::Result<()> {
                 try!(self.word_nbsp("let"));
 
                 try!(self.ibox(INDENT_UNIT));
-                try!(self.print_local_decl(&**loc));
+                try!(self.print_local_decl(&loc));
                 try!(self.end());
                 if let Some(ref init) = loc.init {
                     try!(self.nbsp());
                     try!(self.word_space("="));
-                    try!(self.print_expr(&**init));
+                    try!(self.print_expr(&init));
                 }
                 self.end()
             }
-            ast::DeclKind::Item(ref item) => self.print_item(&**item)
+            ast::DeclKind::Item(ref item) => self.print_item(&item)
         }
     }
 
@@ -2411,7 +2411,7 @@ fn print_path_parameters(&mut self,
                     try!(self.commasep(
                         Inconsistent,
                         &data.types,
-                        |s, ty| s.print_type(&**ty)));
+                        |s, ty| s.print_type(&ty)));
                         comma = true;
                 }
 
@@ -2422,7 +2422,7 @@ fn print_path_parameters(&mut self,
                     try!(self.print_ident(binding.ident));
                     try!(space(&mut self.s));
                     try!(self.word_space("="));
-                    try!(self.print_type(&*binding.ty));
+                    try!(self.print_type(&binding.ty));
                     comma = true;
                 }
 
@@ -2434,7 +2434,7 @@ fn print_path_parameters(&mut self,
                 try!(self.commasep(
                     Inconsistent,
                     &data.inputs,
-                    |s, ty| s.print_type(&**ty)));
+                    |s, ty| s.print_type(&ty)));
                 try!(word(&mut self.s, ")"));
 
                 match data.output {
@@ -2442,7 +2442,7 @@ fn print_path_parameters(&mut self,
                     Some(ref ty) => {
                         try!(self.space_if_not_bol());
                         try!(self.word_space("->"));
-                        try!(self.print_type(&**ty));
+                        try!(self.print_type(&ty));
                     }
                 }
             }
@@ -2473,7 +2473,7 @@ pub fn print_pat(&mut self, pat: &ast::Pat) -> io::Result<()> {
                 match *sub {
                     Some(ref p) => {
                         try!(word(&mut self.s, "@"));
-                        try!(self.print_pat(&**p));
+                        try!(self.print_pat(&p));
                     }
                     None => ()
                 }
@@ -2486,7 +2486,7 @@ pub fn print_pat(&mut self, pat: &ast::Pat) -> io::Result<()> {
                         if !args.is_empty() {
                             try!(self.popen());
                             try!(self.commasep(Inconsistent, &args[..],
-                                              |s, p| s.print_pat(&**p)));
+                                              |s, p| s.print_pat(&p)));
                             try!(self.pclose());
                         }
                     }
@@ -2507,7 +2507,7 @@ pub fn print_pat(&mut self, pat: &ast::Pat) -> io::Result<()> {
                             try!(s.print_ident(f.node.ident));
                             try!(s.word_nbsp(":"));
                         }
-                        try!(s.print_pat(&*f.node.pat));
+                        try!(s.print_pat(&f.node.pat));
                         s.end()
                     },
                     |f| f.node.pat.span));
@@ -2522,7 +2522,7 @@ pub fn print_pat(&mut self, pat: &ast::Pat) -> io::Result<()> {
                 try!(self.popen());
                 try!(self.commasep(Inconsistent,
                                    &elts[..],
-                                   |s, p| s.print_pat(&**p)));
+                                   |s, p| s.print_pat(&p)));
                 if elts.len() == 1 {
                     try!(word(&mut self.s, ","));
                 }
@@ -2530,38 +2530,38 @@ pub fn print_pat(&mut self, pat: &ast::Pat) -> io::Result<()> {
             }
             ast::PatBox(ref inner) => {
                 try!(word(&mut self.s, "box "));
-                try!(self.print_pat(&**inner));
+                try!(self.print_pat(&inner));
             }
             ast::PatRegion(ref inner, mutbl) => {
                 try!(word(&mut self.s, "&"));
                 if mutbl == ast::Mutability::Mutable {
                     try!(word(&mut self.s, "mut "));
                 }
-                try!(self.print_pat(&**inner));
+                try!(self.print_pat(&inner));
             }
-            ast::PatLit(ref e) => try!(self.print_expr(&**e)),
+            ast::PatLit(ref e) => try!(self.print_expr(&e)),
             ast::PatRange(ref begin, ref end) => {
-                try!(self.print_expr(&**begin));
+                try!(self.print_expr(&begin));
                 try!(space(&mut self.s));
                 try!(word(&mut self.s, "..."));
-                try!(self.print_expr(&**end));
+                try!(self.print_expr(&end));
             }
             ast::PatVec(ref before, ref slice, ref after) => {
                 try!(word(&mut self.s, "["));
                 try!(self.commasep(Inconsistent,
                                    &before[..],
-                                   |s, p| s.print_pat(&**p)));
+                                   |s, p| s.print_pat(&p)));
                 if let Some(ref p) = *slice {
                     if !before.is_empty() { try!(self.word_space(",")); }
                     if p.node != ast::PatWild {
-                        try!(self.print_pat(&**p));
+                        try!(self.print_pat(&p));
                     }
                     try!(word(&mut self.s, ".."));
                     if !after.is_empty() { try!(self.word_space(",")); }
                 }
                 try!(self.commasep(Inconsistent,
                                    &after[..],
-                                   |s, p| s.print_pat(&**p)));
+                                   |s, p| s.print_pat(&p)));
                 try!(word(&mut self.s, "]"));
             }
             ast::PatMac(ref m) => try!(self.print_mac(m, token::Paren)),
@@ -2586,12 +2586,12 @@ fn print_arm(&mut self, arm: &ast::Arm) -> io::Result<()> {
                 try!(space(&mut self.s));
                 try!(self.word_space("|"));
             }
-            try!(self.print_pat(&**p));
+            try!(self.print_pat(&p));
         }
         try!(space(&mut self.s));
         if let Some(ref e) = arm.guard {
             try!(self.word_space("if"));
-            try!(self.print_expr(&**e));
+            try!(self.print_expr(&e));
             try!(space(&mut self.s));
         }
         try!(self.word_space("=>"));
@@ -2599,7 +2599,7 @@ fn print_arm(&mut self, arm: &ast::Arm) -> io::Result<()> {
         match arm.body.node {
             ast::ExprKind::Block(ref blk) => {
                 // the block will close the pattern's ibox
-                try!(self.print_block_unclosed_indent(&**blk, INDENT_UNIT));
+                try!(self.print_block_unclosed_indent(&blk, INDENT_UNIT));
 
                 // If it is a user-provided unsafe block, print a comma after it
                 if let BlockCheckMode::Unsafe(ast::UserProvided) = blk.rules {
@@ -2608,7 +2608,7 @@ fn print_arm(&mut self, arm: &ast::Arm) -> io::Result<()> {
             }
             _ => {
                 try!(self.end()); // close the ibox for the pattern
-                try!(self.print_expr(&*arm.body));
+                try!(self.print_expr(&arm.body));
                 try!(word(&mut self.s, ","));
             }
         }
@@ -2634,7 +2634,7 @@ fn print_explicit_self(&mut self,
             ast::SelfKind::Explicit(ref typ, _) => {
                 try!(word(&mut self.s, "self"));
                 try!(self.word_space(":"));
-                try!(self.print_type(&**typ));
+                try!(self.print_type(&typ));
             }
         }
         return Ok(true);
@@ -2722,7 +2722,7 @@ pub fn print_fn_block_args(
         try!(self.word_space("->"));
         match decl.output {
             ast::FunctionRetTy::Ty(ref ty) => {
-                try!(self.print_type(&**ty));
+                try!(self.print_type(&ty));
                 self.maybe_print_comment(ty.span.lo)
             }
             ast::FunctionRetTy::Default(..) => unreachable!(),
@@ -2834,7 +2834,7 @@ pub fn print_ty_param(&mut self, param: &ast::TyParam) -> io::Result<()> {
             Some(ref default) => {
                 try!(space(&mut self.s));
                 try!(self.word_space("="));
-                self.print_type(&**default)
+                self.print_type(&default)
             }
             _ => Ok(())
         }
@@ -2860,7 +2860,7 @@ pub fn print_where_clause(&mut self, where_clause: &ast::WhereClause)
                                                                              ref bounds,
                                                                              ..}) => {
                     try!(self.print_formal_lifetime_list(bound_lifetimes));
-                    try!(self.print_type(&**bounded_ty));
+                    try!(self.print_type(&bounded_ty));
                     try!(self.print_bounds(":", bounds));
                 }
                 ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate{ref lifetime,
@@ -2881,7 +2881,7 @@ pub fn print_where_clause(&mut self, where_clause: &ast::WhereClause)
                     try!(self.print_path(path, false, 0));
                     try!(space(&mut self.s));
                     try!(self.word_space("="));
-                    try!(self.print_type(&**ty));
+                    try!(self.print_type(&ty));
                 }
             }
         }
@@ -2953,13 +2953,13 @@ pub fn print_mutability(&mut self,
 
     pub fn print_mt(&mut self, mt: &ast::MutTy) -> io::Result<()> {
         try!(self.print_mutability(mt.mutbl));
-        self.print_type(&*mt.ty)
+        self.print_type(&mt.ty)
     }
 
     pub fn print_arg(&mut self, input: &ast::Arg, is_closure: bool) -> io::Result<()> {
         try!(self.ibox(INDENT_UNIT));
         match input.ty.node {
-            ast::TyKind::Infer if is_closure => try!(self.print_pat(&*input.pat)),
+            ast::TyKind::Infer if is_closure => try!(self.print_pat(&input.pat)),
             _ => {
                 match input.pat.node {
                     ast::PatIdent(_, ref path1, _) if
@@ -2968,12 +2968,12 @@ pub fn print_arg(&mut self, input: &ast::Arg, is_closure: bool) -> io::Result<()
                         // Do nothing.
                     }
                     _ => {
-                        try!(self.print_pat(&*input.pat));
+                        try!(self.print_pat(&input.pat));
                         try!(word(&mut self.s, ":"));
                         try!(space(&mut self.s));
                     }
                 }
-                try!(self.print_type(&*input.ty));
+                try!(self.print_type(&input.ty));
             }
         }
         self.end()
@@ -2992,7 +2992,7 @@ pub fn print_fn_output(&mut self, decl: &ast::FnDecl) -> io::Result<()> {
                 try!(self.word_nbsp("!")),
             ast::FunctionRetTy::Default(..) => unreachable!(),
             ast::FunctionRetTy::Ty(ref ty) =>
-                try!(self.print_type(&**ty))
+                try!(self.print_type(&ty))
         }
         try!(self.end());
 
index 27f5700cad58a168b4cd783283cc5a98028f4a8a..fda9741d35c419285d9ea0961721a2c96983a6c9 100644 (file)
@@ -87,7 +87,7 @@ impl<T> Deref for P<T> {
     type Target = T;
 
     fn deref<'a>(&'a self) -> &'a T {
-        &*self.ptr
+        &self.ptr
     }
 }
 
@@ -153,7 +153,7 @@ pub fn into_vec(self) -> Vec<T> {
     }
 
     pub fn as_slice<'a>(&'a self) -> &'a [T] {
-        &*self.ptr
+        &self.ptr
     }
 
     pub fn move_iter(self) -> vec::IntoIter<T> {
index 6b4f94641906197e6a563004e060b47dd85cb0f5..81b702e794d7737ef08f3652c231ba6f174e577c 100644 (file)
@@ -123,7 +123,7 @@ fn fold_item(&mut self, i: P<ast::Item>) -> SmallVector<P<ast::Item>> {
         debug!("current path: {}",
                ast_util::path_name_i(&self.cx.path));
 
-        let i = if is_test_fn(&self.cx, &*i) || is_bench_fn(&self.cx, &*i) {
+        let i = if is_test_fn(&self.cx, &i) || is_bench_fn(&self.cx, &i) {
             match i.node {
                 ast::ItemKind::Fn(_, ast::Unsafety::Unsafe, _, _, _, _) => {
                     let diag = self.cx.span_diagnostic;
@@ -134,9 +134,9 @@ fn fold_item(&mut self, i: P<ast::Item>) -> SmallVector<P<ast::Item>> {
                     let test = Test {
                         span: i.span,
                         path: self.cx.path.clone(),
-                        bench: is_bench_fn(&self.cx, &*i),
-                        ignore: is_ignored(&*i),
-                        should_panic: should_panic(&*i)
+                        bench: is_bench_fn(&self.cx, &i),
+                        ignore: is_ignored(&i),
+                        should_panic: should_panic(&i)
                     };
                     self.cx.testfns.push(test);
                     self.tests.push(i.ident);
@@ -205,7 +205,7 @@ fn fold_item(&mut self, i: P<ast::Item>) -> SmallVector<P<ast::Item>> {
         // Remove any #[main] or #[start] from the AST so it doesn't
         // clash with the one we're going to add, but mark it as
         // #[allow(dead_code)] to avoid printing warnings.
-        let folded = match entry::entry_point_type(&*folded, self.depth) {
+        let folded = match entry::entry_point_type(&folded, self.depth) {
             EntryPointType::MainNamed |
             EntryPointType::MainAttr |
             EntryPointType::Start =>
@@ -556,7 +556,7 @@ fn mk_test_module(cx: &mut TestCtxt) -> (P<ast::Item>, Option<P<ast::Item>>) {
         })
     });
 
-    debug!("Synthetic test module:\n{}\n", pprust::item_to_string(&*item));
+    debug!("Synthetic test module:\n{}\n", pprust::item_to_string(&item));
 
     (item, reexport)
 }