1
Fork 0

Fix subtle error in caching during kind computation that could cause linear

values to be copied.  Rewrite kind computation so that instead of directly
computing the kind it computes what kinds of values are present in the type,
and then derive kinds based on that. I find this easier to think about.

Fixes #4821.
This commit is contained in:
Niko Matsakis 2013-02-07 19:33:12 -08:00
parent 6647a3402b
commit a380df809c
31 changed files with 612 additions and 579 deletions

View file

@ -832,7 +832,7 @@ pub impl Decoder: serialize::Decoder {
fn read_owned_vec<T>(&self, f: fn(uint) -> T) -> T {
debug!("read_owned_vec()");
let len = match *self.peek() {
List(list) => list.len(),
List(ref list) => list.len(),
_ => die!(~"not a list"),
};
let res = f(len);