diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-24 23:05:02 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-24 23:05:02 +0300 |
| commit | f284cbc7af06a941de0cdd06291dc78d37268b9f (patch) | |
| tree | 94b287ceb5755130191c61dbefd317da66ccd4be /src/libsyntax/print | |
| parent | 40ce80484c636e525ac796a81f38a96c0ca8bf09 (diff) | |
| download | rust-f284cbc7af06a941de0cdd06291dc78d37268b9f.tar.gz rust-f284cbc7af06a941de0cdd06291dc78d37268b9f.zip | |
Cleanup interfaces of Name, SyntaxContext and Ident
Make sure Name, SyntaxContext and Ident are passed by value Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index df72645f97d..7c87e03f241 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -297,7 +297,7 @@ pub fn token_to_string(tok: &Token) -> String { 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), + token::NtIdent(ref e, _) => ident_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), @@ -376,8 +376,8 @@ pub fn path_to_string(p: &ast::Path) -> String { to_string(|s| s.print_path(p, false, 0)) } -pub fn ident_to_string(id: &ast::Ident) -> String { - to_string(|s| s.print_ident(*id)) +pub fn ident_to_string(id: ast::Ident) -> String { + to_string(|s| s.print_ident(id)) } pub fn fun_to_string(decl: &ast::FnDecl, @@ -2854,7 +2854,6 @@ impl<'a> State<'a> { ast::ViewPathSimple(ident, ref path) => { try!(self.print_path(path, false, 0)); - // FIXME(#6993) can't compare identifiers directly here if path.segments.last().unwrap().identifier.name != ident.name { try!(space(&mut self.s)); |
