about summary refs log tree commit diff
path: root/src/libstd/json.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2013-02-07 19:33:12 -0800
committerNiko Matsakis <niko@alum.mit.edu>2013-02-08 07:20:39 -0800
commita380df809c8eb874540a123780612f14cfc7303e (patch)
tree236ebb1aced8876fd5e28bc999a3904e304de239 /src/libstd/json.rs
parent6647a3402bf75368de1a692370c558d423f36940 (diff)
downloadrust-a380df809c8eb874540a123780612f14cfc7303e.tar.gz
rust-a380df809c8eb874540a123780612f14cfc7303e.zip
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.
Diffstat (limited to 'src/libstd/json.rs')
-rw-r--r--src/libstd/json.rs2
1 files changed, 1 insertions, 1 deletions
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<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);