Commit ed23dad487

Andrew Kelley <andrew@ziglang.org>
2020-04-07 22:05:42
fix the new runtime-safety tests
Thanks to Vexu's work in e62671f643, compile errors were identified in these test cases! This commit fixes them to use `const` as appropriate.
1 parent 4d29075
Changed files (1)
test/runtime_safety.zig
@@ -56,7 +56,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
             \\const std = @import("std");
         ++ check_panic_msg ++
             \\pub fn main() void {
-            \\    var buf_slice: []u8 = &[3]u8{ 'a', 'b', 0 };
+            \\    var buf_slice: []const u8 = &[3]u8{ 'a', 'b', 0 };
             \\    const slice = buf_slice[0..3 :0];
             \\}
         );
@@ -64,7 +64,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
             \\const std = @import("std");
         ++ check_panic_msg ++
             \\pub fn main() void {
-            \\    var buf_slice: []u8 = &[3]u8{ 'a', 'b', 0 };
+            \\    var buf_slice: []const u8 = &[3]u8{ 'a', 'b', 0 };
             \\    const slice = buf_slice[0.. :0];
             \\}
         );