authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-22 01:19:06-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-22 01:19:06-04:00
log65997f816bd7aa48f585c61e4d966253d9947ec5
tree9d684e2a3bae616b1eb4841fb5dc8072cae738b2
parent726674b2bd0ac8159c961a944012b096d08e5615
parentbe51511d295269851ea4128f0fd3db49fe96a661
signature Commit is signed but in an unrecognized format.

Merge remote-tracking branch 'origin/master' into copy-elision-3


3 files changed, 12 insertions(+), 3 deletions(-)

doc/langref.html.in+1-1
...@@ -3787,7 +3787,7 @@ test "fn reflection" {...@@ -3787,7 +3787,7 @@ test "fn reflection" {
3787 However right now it is hard coded to be a {#syntax#}u16{#endsyntax#}. See <a href="https://github.com/ziglang/zig/issues/786">#768</a>.3787 However right now it is hard coded to be a {#syntax#}u16{#endsyntax#}. See <a href="https://github.com/ziglang/zig/issues/786">#768</a>.
3788 </p>3788 </p>
3789 <p>3789 <p>
3790 You can {#link|implicitly cast|Implicit Casts#} an error from a subset to its superset:3790 You can {#link|implicitly cast|Implicit Casts#} an error from a subset to a superset:
3791 </p>3791 </p>
3792 {#code_begin|test#}3792 {#code_begin|test#}
3793const std = @import("std");3793const std = @import("std");
std/c/darwin.zig+1-1
...@@ -37,7 +37,7 @@ const mach_hdr = if (@sizeOf(usize) == 8) mach_header_64 else mach_header;...@@ -37,7 +37,7 @@ const mach_hdr = if (@sizeOf(usize) == 8) mach_header_64 else mach_header;
37pub extern "c" var _mh_execute_header: mach_hdr = undefined;37pub extern "c" var _mh_execute_header: mach_hdr = undefined;
38comptime {38comptime {
39 if (std.os.darwin.is_the_target) {39 if (std.os.darwin.is_the_target) {
40 @export("__mh_execute_header", _mh_execute_header, .Weak);40 @export("_mh_execute_header", _mh_execute_header, .Weak);
41 }41 }
42}42}
4343
std/math.zig+10-1
...@@ -482,7 +482,16 @@ fn testAbsInt() void {...@@ -482,7 +482,16 @@ fn testAbsInt() void {
482 testing.expect((absInt(i32(10)) catch unreachable) == 10);482 testing.expect((absInt(i32(10)) catch unreachable) == 10);
483}483}
484484
485pub const absFloat = @import("fabs.zig").fabs;485pub const absFloat = fabs;
486
487test "math.absFloat" {
488 testAbsFloat();
489 comptime testAbsFloat();
490}
491fn testAbsFloat() void {
492 testing.expect(absFloat(f32(-10.05)) == 10.05);
493 testing.expect(absFloat(f32(10.05)) == 10.05);
494}
486495
487pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T {496pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T {
488 @setRuntimeSafety(false);497 @setRuntimeSafety(false);