We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f609d0a commit 64235dbCopy full SHA for 64235db
[refs]
@@ -1,5 +1,5 @@
1
---
2
-refs/heads/master: 6919cf5fe14701621437fcb57f3a0c38fb394c65
+refs/heads/master: d09f569aac99a4ef2f577d288d547504e3dcf588
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
refs/heads/snap-stage3: eae327032c775813eeb101233a4f7df24eab0a6a
5
refs/heads/try: ac820906c0e53eab79a98ee64f7231f57c3887b4
trunk/src/libstd/repr.rs
@@ -189,8 +189,7 @@ impl<'self> ReprVisitor<'self> {
189
} else if mtbl == 1 {
190
// skip, this is ast::m_imm
191
} else {
192
- assert_eq!(mtbl, 2);
193
- self.writer.write("const ".as_bytes());
+ fail!("invalid mutability value");
194
}
195
196
@@ -389,6 +388,7 @@ impl<'self> TyVisitor for ReprVisitor<'self> {
389
388
fn visit_evec_slice(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
390
do self.get::<raw::Slice<()>> |this, s| {
391
this.writer.write(['&' as u8]);
+ this.write_mut_qualifier(mtbl);
392
this.write_vec_range(mtbl, s.data, s.len, inner);
393
394
@@ -696,6 +696,9 @@ fn test_repr() {
696
exact_test(&(10u64, ~"hello"),
697
"(10u64, ~\"hello\")");
698
699
+ exact_test(&(&[1, 2]), "&[1, 2]");
700
+ exact_test(&(&mut [1, 2]), "&mut [1, 2]");
701
+
702
exact_test(&'\'', "'\\''");
703
exact_test(&'"', "'\"'");
704
exact_test(&("'"), "\"'\"");
0 commit comments