Closed
Description
@graydon's workcache.rs file was trying to use a trait to make a type alias, which triggers an ICE:
extern mod std;
use send_map::linear;
use std::json;
use std::serialization::{Deserializable, deserialize};
trait JD : Deserializable<json::Deserializer> { }
//type JD = Deserializable<json::Deserializer>;
fn exec<T: JD>() {
let doc = result::unwrap(json::from_str(""));
let _v: T = deserialize(&json::Deserializer(move doc));
fail
}
fn main() {}
It errors with:
error: internal compiler error: substitution a had opt_region &static and b had opt_region none with variance Some(rv_invariant)
If you use a proper type
type alias, it compiles fine.