Skip to content

Commit 8d38182

Browse files
committed
Print mutability of obj fields.
1 parent f03107b commit 8d38182

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: src/comp/pretty/pprust.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ fn print_item(&ps s, &@ast::item item) {
370370
popen(s);
371371
fn print_field(&ps s, &ast::obj_field field) {
372372
ibox(s, indent_unit);
373+
print_mutability(s, field.mut);
373374
print_type(s, *field.ty);
374375
space(s.s);
375376
word(s.s, field.ident);
@@ -1101,12 +1102,16 @@ fn print_maybe_parens(&ps s, &@ast::expr expr, int outer_prec) {
11011102
if (add_them) {pclose(s);}
11021103
}
11031104

1104-
fn print_mt(&ps s, &ast::mt mt) {
1105-
alt (mt.mut) {
1105+
fn print_mutability(&ps s, &ast::mutability mut) {
1106+
alt (mut) {
11061107
case (ast::mut) { word_nbsp(s, "mutable"); }
11071108
case (ast::maybe_mut) { word_nbsp(s, "mutable?"); }
11081109
case (ast::imm) { /* nothing */ }
11091110
}
1111+
}
1112+
1113+
fn print_mt(&ps s, &ast::mt mt) {
1114+
print_mutability(s, mt.mut);
11101115
print_type(s, *mt.ty);
11111116
}
11121117

0 commit comments

Comments
 (0)