auto_serialize should use explicit refs (fixes #4044)

This commit is contained in:
Erick Tryzelaar 2012-11-26 22:31:48 -08:00
parent cd6300e938
commit 32763caa60
2 changed files with 5 additions and 3 deletions

View File

@ -265,7 +265,7 @@ priv impl ext_ctxt {
let path = @{span: span, global: false, idents: ~[nm],
rp: None, types: ~[]};
@{id: self.next_id(),
node: ast::pat_ident(ast::bind_by_implicit_ref,
node: ast::pat_ident(ast::bind_by_ref(ast::m_imm),
path,
None),
span: span}
@ -887,7 +887,7 @@ fn ser_variant(
let pat_node = if pats.is_empty() {
ast::pat_ident(
ast::bind_by_implicit_ref,
ast::bind_by_ref(ast::m_imm),
cx.path(span, ~[v_name]),
None
)

View File

@ -1,3 +1,5 @@
#[forbid(deprecated_pattern)];
extern mod std;
// These tests used to be separate files, but I wanted to refactor all
@ -32,7 +34,7 @@ fn test_ebml<A:
let ebml_w = &EBWriter::Serializer(wr);
a1.serialize(ebml_w)
};
let d = EBReader::Doc(@bytes);
let d = EBReader::Doc(@move bytes);
let a2: A = deserialize(&EBReader::Deserializer(d));
assert *a1 == a2;
}