1
Fork 0

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.
This commit is contained in:
Nick Cameron 2014-06-11 17:18:57 +12:00
parent db298145c7
commit 8e7213f65b
30 changed files with 451 additions and 364 deletions

View file

@ -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<json::Encoder<'a>, 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()
}