Skip to content

Commit 64235db

Browse files
committed
---
yaml --- r: 79572 b: refs/heads/master c: d09f569 h: refs/heads/master v: v3
1 parent f609d0a commit 64235db

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 6919cf5fe14701621437fcb57f3a0c38fb394c65
2+
refs/heads/master: d09f569aac99a4ef2f577d288d547504e3dcf588
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eae327032c775813eeb101233a4f7df24eab0a6a
55
refs/heads/try: ac820906c0e53eab79a98ee64f7231f57c3887b4

trunk/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)