diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-03-27 12:55:18 -0400 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2013-03-27 11:35:04 -0700 |
| commit | 2a74fda316f5c4b31d3582fd1cf7b6c04c178557 (patch) | |
| tree | e38ca82517d13ab78f7a8306a87506d85175031b /src/libsyntax/print/pprust.rs | |
| parent | 83aa70d7e3dba557d1812fe436082098cdf90c9a (diff) | |
| download | rust-2a74fda316f5c4b31d3582fd1cf7b6c04c178557.tar.gz rust-2a74fda316f5c4b31d3582fd1cf7b6c04c178557.zip | |
Fix pretty-printer test failure by carrying the bound lifetime names through
the types. Initially I thought it would be necessary to thread this data through not only the AST but the types themselves, but then I remembered that the pretty printer only cares about the AST. Regardless, I have elected to leave the changes to the types intact since they will eventually be needed. I left a few FIXMEs where it didn't seem worth finishing up since the code wasn't crucial yet.
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 9a9834c488b..a6064b467b1 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -14,6 +14,7 @@ use ast::{RegionTyParamBound, TraitTyParamBound, required, provided}; use ast; use ast_util; use opt_vec::OptVec; +use opt_vec; use attr; use codemap::{CodeMap, BytePos}; use codemap; @@ -402,14 +403,18 @@ pub fn print_type(s: @ps, &&ty: @ast::Ty) { pclose(s); } ast::ty_bare_fn(f) => { + let generics = ast::Generics {lifetimes: copy f.lifetimes, + ty_params: opt_vec::Empty}; print_ty_fn(s, Some(f.abi), None, None, f.purity, ast::Many, &f.decl, None, - None, None); + Some(&generics), None); } ast::ty_closure(f) => { + let generics = ast::Generics {lifetimes: copy f.lifetimes, + ty_params: opt_vec::Empty}; print_ty_fn(s, None, Some(f.sigil), f.region, f.purity, f.onceness, &f.decl, None, - None, None); + Some(&generics), None); } ast::ty_path(path, _) => print_path(s, path, false), ast::ty_fixed_length_vec(ref mt, v) => { @@ -1923,7 +1928,8 @@ pub fn print_ty_fn(s: @ps, opt_region: Option<@ast::Lifetime>, purity: ast::purity, onceness: ast::Onceness, - decl: &ast::fn_decl, id: Option<ast::ident>, + decl: &ast::fn_decl, + id: Option<ast::ident>, generics: Option<&ast::Generics>, opt_self_ty: Option<ast::self_ty_>) { ibox(s, indent_unit); |
