Skip to content

Commit eae3270

Browse files
committed
auto merge of #9066 : thestinger/rust/repr, r=alexcrichton
2 parents dd5c737 + db4720b commit eae3270

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libstd/repr.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ impl<'self> ReprVisitor<'self> {
189189
} else if mtbl == 1 {
190190
// skip, this is ast::m_imm
191191
} else {
192-
assert_eq!(mtbl, 2);
193-
self.writer.write("const ".as_bytes());
192+
fail!("invalid mutability value");
194193
}
195194
}
196195

@@ -389,6 +388,7 @@ impl<'self> TyVisitor for ReprVisitor<'self> {
389388
fn visit_evec_slice(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
390389
do self.get::<raw::Slice<()>> |this, s| {
391390
this.writer.write(['&' as u8]);
391+
this.write_mut_qualifier(mtbl);
392392
this.write_vec_range(mtbl, s.data, s.len, inner);
393393
}
394394
}
@@ -696,6 +696,9 @@ fn test_repr() {
696696
exact_test(&(10u64, ~"hello"),
697697
"(10u64, ~\"hello\")");
698698

699+
exact_test(&(&[1, 2]), "&[1, 2]");
700+
exact_test(&(&mut [1, 2]), "&mut [1, 2]");
701+
699702
exact_test(&'\'', "'\\''");
700703
exact_test(&'"', "'\"'");
701704
exact_test(&("'"), "\"'\"");

0 commit comments

Comments
 (0)