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

This commit is contained in:
Andrew Kelley 2019-06-22 01:19:06 -04:00
commit 65997f816b
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
3 changed files with 12 additions and 3 deletions

View File

@ -3787,7 +3787,7 @@ test "fn reflection" {
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>.
</p>
<p>
You can {#link|implicitly cast|Implicit Casts#} an error from a subset to its superset:
You can {#link|implicitly cast|Implicit Casts#} an error from a subset to a superset:
</p>
{#code_begin|test#}
const std = @import("std");

View File

@ -37,7 +37,7 @@ const mach_hdr = if (@sizeOf(usize) == 8) mach_header_64 else mach_header;
pub extern "c" var _mh_execute_header: mach_hdr = undefined;
comptime {
if (std.os.darwin.is_the_target) {
@export("__mh_execute_header", _mh_execute_header, .Weak);
@export("_mh_execute_header", _mh_execute_header, .Weak);
}
}

View File

@ -482,7 +482,16 @@ fn testAbsInt() void {
testing.expect((absInt(i32(10)) catch unreachable) == 10);
}
pub const absFloat = @import("fabs.zig").fabs;
pub const absFloat = fabs;
test "math.absFloat" {
testAbsFloat();
comptime testAbsFloat();
}
fn testAbsFloat() void {
testing.expect(absFloat(f32(-10.05)) == 10.05);
testing.expect(absFloat(f32(10.05)) == 10.05);
}
pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T {
@setRuntimeSafety(false);