diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-01-05 18:50:36 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-01-05 18:50:36 -0500 |
| commit | e621ad014e919521268d3e2c94afadbdadadb59f (patch) | |
| tree | a038e0051b6d8c9b220cb2faa2918eb3f42fa909 /std | |
| parent | 97e105489085fcf4530b3944499531d76848bbd1 (diff) | |
| download | zig-e621ad014e919521268d3e2c94afadbdadadb59f.tar.gz zig-e621ad014e919521268d3e2c94afadbdadadb59f.zip | |
pass cannot assign to constant test
Diffstat (limited to 'std')
| -rw-r--r-- | std/cstr.zig | 4 | ||||
| -rw-r--r-- | std/list.zig | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/std/cstr.zig b/std/cstr.zig index e3755b62df..cf1c020ccd 100644 --- a/std/cstr.zig +++ b/std/cstr.zig @@ -39,7 +39,7 @@ pub const CBuf = struct { /// Must deinitialize with deinit. pub fn initEmpty(allocator: &Allocator) -> %CBuf { - const self = CBuf { + var self = CBuf { .list = List(u8).init(allocator), }; %return self.resize(0); @@ -48,7 +48,7 @@ pub const CBuf = struct { /// Must deinitialize with deinit. pub fn initFromMem(allocator: &Allocator, m: []const u8) -> %CBuf { - const self = CBuf { + var self = CBuf { .list = List(u8).init(allocator), }; %return self.resize(m.len); diff --git a/std/list.zig b/std/list.zig index 52a6eb3095..69f17df7f4 100644 --- a/std/list.zig +++ b/std/list.zig @@ -23,7 +23,7 @@ pub fn List(inline T: type) -> type{ l.allocator.free(T, l.items); } - pub fn toSlice(l: &Self) -> []T { + pub fn toSlice(l: &const Self) -> []const T { return l.items[0...l.len]; } |
