Commit 2b1695b1b0

Andrew Kelley <andrew@ziglang.org>
2019-06-23 00:54:27
fix std.json regression
1 parent 86f362c
Changed files (2)
std/json.zig
@@ -876,8 +876,9 @@ pub const TokenStream = struct {
 
     pub fn next(self: *TokenStream) !?Token {
         if (self.token) |token| {
+            const copy = token;
             self.token = null;
-            return token;
+            return copy;
         }
 
         var t1: ?Token = undefined;
std/std.zig
@@ -90,7 +90,7 @@ test "std" {
     _ = @import("hash.zig");
     _ = @import("heap.zig");
     _ = @import("io.zig");
-    //_ = @import("json.zig");
+    _ = @import("json.zig");
     //_ = @import("lazy_init.zig");
     _ = @import("macho.zig");
     _ = @import("math.zig");