about summary refs log tree commit diff
path: root/src/test/run-pass/auto-encode.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-12-18 14:10:28 -0800
committerAlex Crichton <alex@alexcrichton.com>2013-12-19 17:08:05 -0800
commit73fceca7d6140fb208fa701074c4b25a4dd260c6 (patch)
tree4d47a7257ec5c7b3f90ef432a81052521a4742f2 /src/test/run-pass/auto-encode.rs
parent6d2e61bc6cadcfde6952913b7e170ded57f7b0dd (diff)
downloadrust-73fceca7d6140fb208fa701074c4b25a4dd260c6.tar.gz
rust-73fceca7d6140fb208fa701074c4b25a4dd260c6.zip
Purge @-boxes from the reading half of EBML
Now that the metadata is an owned value with a lifetime of a borrowed byte
slice, it's possible to have future optimizations where the metadata doesn't
need to be copied around (very expensive operation).
Diffstat (limited to 'src/test/run-pass/auto-encode.rs')
-rw-r--r--src/test/run-pass/auto-encode.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/test/run-pass/auto-encode.rs b/src/test/run-pass/auto-encode.rs
index 86af60e7360..1810f33eadb 100644
--- a/src/test/run-pass/auto-encode.rs
+++ b/src/test/run-pass/auto-encode.rs
@@ -10,6 +10,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// xfail-test FIXME(#5121)
+
 #[feature(managed_boxes)];
 
 extern mod extra;
@@ -28,18 +30,18 @@ use std::io;
 use extra::serialize::{Decodable, Encodable};
 use extra::time;
 
-fn test_ebml<A:
+fn test_ebml<'a, A:
     Eq +
     Encodable<EBWriter::Encoder> +
-    Decodable<EBReader::Decoder>
+    Decodable<EBReader::Decoder<'a>>
 >(a1: &A) {
     let mut wr = @mut std::io::mem::MemWriter::new();
     let mut ebml_w = EBWriter::Encoder(wr);
     a1.encode(&mut ebml_w);
-    let bytes = wr.inner_ref().to_owned();
+    let bytes = wr.inner_ref().as_slice();
 
-    let d = EBReader::Doc(@bytes);
-    let mut decoder = EBReader::Decoder(d);
+    let d: extra::ebml::Doc<'a> = EBReader::Doc(bytes);
+    let mut decoder: EBReader::Decoder<'a> = EBReader::Decoder(d);
     let a2: A = Decodable::decode(&mut decoder);
     assert!(*a1 == a2);
 }