auto_serialize should use explicit refs (fixes #4044)
This commit is contained in:
parent
cd6300e938
commit
32763caa60
@ -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
|
||||
)
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user