]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_front/print/pprust.rs
Use Names in path fragments and MacroDef
[rust.git] / src / librustc_front / print / pprust.rs
index ba4c61c83a02ed18b9f2fa550f23d65ee5f19981..0a56bcceb43c0a871e77398901b6b0b509593693 100644 (file)
@@ -2174,15 +2174,14 @@ pub fn print_where_clause(&mut self, where_clause: &hir::WhereClause)
 
     pub fn print_view_path(&mut self, vp: &hir::ViewPath) -> io::Result<()> {
         match vp.node {
-            hir::ViewPathSimple(ident, ref path) => {
+            hir::ViewPathSimple(name, 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 {
+                if path.segments.last().unwrap().identifier.name != name {
                     try!(space(&mut self.s));
                     try!(self.word_space("as"));
-                    try!(self.print_ident(ident));
+                    try!(self.print_name(name));
                 }
 
                 Ok(())
@@ -2203,7 +2202,7 @@ pub fn print_view_path(&mut self, vp: &hir::ViewPath) -> io::Result<()> {
                 try!(self.commasep(Inconsistent, &idents[..], |s, w| {
                     match w.node {
                         hir::PathListIdent { name, .. } => {
-                            s.print_ident(name)
+                            s.print_name(name)
                         },
                         hir::PathListMod { .. } => {
                             word(&mut s.s, "self")