diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-05-17 19:00:16 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-05-17 19:00:16 -0700 |
| commit | 3ffe390570ec90a5d6dcf92692d02c17b7b06f13 (patch) | |
| tree | 83d26f41443deb529de0d39da59aa2d847c94a08 /src/comp | |
| parent | 8637a4eaf389a1609389d143c385a4a328e3aa84 (diff) | |
| download | rust-3ffe390570ec90a5d6dcf92692d02c17b7b06f13.tar.gz rust-3ffe390570ec90a5d6dcf92692d02c17b7b06f13.zip | |
rustc: Print the types of declarations in --typed-pretty mode
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/pretty/pprust.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/comp/pretty/pprust.rs b/src/comp/pretty/pprust.rs index b67387d1ddf..042bda62ca5 100644 --- a/src/comp/pretty/pprust.rs +++ b/src/comp/pretty/pprust.rs @@ -743,6 +743,15 @@ fn print_decl(ps s, @ast::decl decl) { } case (_) { wrd1(s, "auto"); + + // Print the type if necessary. + alt (s.mode) { + case (mo_untyped) { /* no-op */ } + case (mo_typed(?tcx, ?ntt, ?tc)) { + auto lty = ty::ann_to_type(ntt, loc.ann); + wrd1(s, ty::ty_to_str(tcx, lty)); + } + } } } wrd(s.s, loc.ident); |
