From a380df809c8eb874540a123780612f14cfc7303e Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 7 Feb 2013 19:33:12 -0800 Subject: 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. --- src/libstd/json.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/json.rs b/src/libstd/json.rs index 99c6c2f008d..80c64b214ba 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -832,7 +832,7 @@ pub impl Decoder: serialize::Decoder { fn read_owned_vec(&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); -- cgit 1.4.1-3-g733a5