From 8e7213f65b4348e1b54d8baeeb291267581227d2 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Wed, 11 Jun 2014 17:18:57 +1200 Subject: Remove TraitStore from ty_trait Use ty_rptr/ty_uniq(ty_trait) rather than TraitStore to represent trait types. Also addresses (but doesn't close) #12470. Part of the work towards DST (#12938). [breaking-change] lifetime parameters in `&mut trait` are now invariant. They used to be contravariant. --- src/libsyntax/parse/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index faffc496846..eb0c6f2555a 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -281,6 +281,7 @@ mod test { use serialize::{json, Encodable}; use std::io; use std::io::MemWriter; + use std::mem::transmute; use std::str; use std::gc::GC; use codemap::{Span, BytePos, Spanned}; @@ -295,8 +296,11 @@ mod test { fn to_json_str<'a, E: Encodable, io::IoError>>(val: &E) -> String { let mut writer = MemWriter::new(); - let mut encoder = json::Encoder::new(&mut writer as &mut io::Writer); - let _ = val.encode(&mut encoder); + // FIXME(14302) remove the transmute and unsafe block. + unsafe { + let mut encoder = json::Encoder::new(&mut writer as &mut io::Writer); + let _ = val.encode(transmute(&mut encoder)); + } str::from_utf8(writer.unwrap().as_slice()).unwrap().to_string() } -- cgit 1.4.1-3-g733a5