5762 Commits

Author SHA1 Message Date
Loris Cro
d85259989e autodoc: var 2 let in main.js 2022-07-19 19:10:11 -07:00
Loris Cro
67da1b8c88 autodoc: fixed all type errors in main.js 2022-07-19 19:10:11 -07:00
Loris Cro
80f9490e06 autodoc: more js type fixes 2022-07-19 19:10:11 -07:00
Loris Cro
919b8e400c autodoc: more typechecking in main.js 2022-07-19 19:10:11 -07:00
Loris Cro
72e5b4fb74 autodoc: improve type checking in main.js 2022-07-19 19:10:11 -07:00
Loris Cro
64feb222b5 autodoc: make links respect internal docs mode 2022-07-19 19:10:11 -07:00
Loris Cro
53fa75c852 autodoc: improved frontend rendering 2022-07-19 19:10:11 -07:00
Loris Cro
36c4b1aac9 autodoc: improve rendering and add "show priv decls" checkbox 2022-07-19 19:10:11 -07:00
Reece Van Atta
5f0ab34cc5 autodoc: add type comments to main.js file 2022-07-19 19:10:11 -07:00
ABuffSeagull
e39d1ae78f autodoc: fix missing variable declaration for strict mode 2022-07-19 19:10:11 -07:00
Loris Cro
63be9e65ed autodoc: added support for error sets and extended functions 2022-07-19 19:10:11 -07:00
Loris Cro
ec7f4d1faa autodoc: add support for anytype and improve semantics for array length 2022-07-19 19:10:11 -07:00
Loris Cro
056ba8e57c autodoc: add support for @This and improve call support in decl paths 2022-07-19 19:10:11 -07:00
Loris Cro
3eb90a110f autodoc: add support for pointers and comptime expressions in decl paths 2022-07-19 19:10:11 -07:00
Loris Cro
1e2cd421b9 autodoc: add support for array decls 2022-07-19 19:10:11 -07:00
Loris Cro
8bb529b395 autodoc: add support for generic functions & generic function calls 2022-07-19 19:10:11 -07:00
Loris Cro
195231b212 autodoc: add support for non-generic function calls 2022-07-19 19:10:11 -07:00
Loris Cro
580e633777 autodoc: added support for non-lazy decl paths 2022-07-19 19:10:11 -07:00
Loris Cro
253e7e112e autodoc: add frontend support for optionals & generic cleanup 2022-07-19 19:10:11 -07:00
Loris Cro
5d4c88c741 autodoc: added basic support for unresolved comptime expressions 2022-07-19 19:10:11 -07:00
Loris Cro
ee16eddecf autodoc: added basic support for @import 2022-07-19 19:10:11 -07:00
Loris Cro
4a868fa2be autodoc: escape html in decl ref names 2022-07-19 19:10:11 -07:00
Loris Cro
564d6c4960 autodocs: improve function rendering 2022-07-19 19:10:10 -07:00
Loris Cro
b296f5ac02 autodocs: added basic support for functions 2022-07-19 19:10:10 -07:00
Loris Cro
ef5a2e8d6f autodocs: added basic support for unions 2022-07-19 19:10:10 -07:00
Loris Cro
a04045c709 autodocs: fix rendering of non-type decls 2022-07-19 19:10:10 -07:00
Loris Cro
ce40f34cbc autodocs: added support for some non-type values 2022-07-19 19:10:10 -07:00
Loris Cro
29771440b2 autodocs: add support for int values 2022-07-19 19:10:10 -07:00
Loris Cro
0135d22716 autodocs: add support for indirect decl references 2022-07-19 19:10:10 -07:00
Loris Cro
38281c8ed4 autodoc: add declval support to docs js 2022-07-19 19:10:10 -07:00
Andrew Kelley
046df9b7d0
Merge pull request #12131 from hnakamur/fix_big_int_Managed_mul_sqr_capacity_too_large
Fix std.math.big.int.Managed capacity after mul and sqr
2022-07-19 18:54:30 -04:00
LeRoyce Pearson
c26d9f6287 Read dynstr starting at rpath offset
Since we know the offset, we may as well read starting there. Still expects
rpath to fit in 4096 bytes; that might be worth fixing in the future.

Fixes issue #12112
2022-07-19 14:01:35 -04:00
Veikka Tuominen
0e26c61499 std.fs: remove accidental comptime block 2022-07-17 11:54:13 +03:00
Veikka Tuominen
fcaeca5b0a std.fs: add Iterable versions of openDirAbsolute*
Follow up to 262f4c7b3a850594a75ec154db2ba8d5f9f517ab
2022-07-17 11:52:30 +03:00
Vincent Rischmann
47c58cba59
Fix io_uring tests (#12134)
* io_uring: fix the timeout_remove test

The test does a IORING_OP_TIMEOUT followed with a IORING_OP_TIMEOUT_REMOVE
and assumed we would get the CQEs in the same order.

Linux v5.18 changed how this works and we now get them in the reverse order.

The documentation doesn't explicitly say which CQE we should get first
so just make the test work with both cases.

* io_uring: fix the remove_buffers test

The original test was buggy but accidentally worked with kernels < 5.18

The test assumed that IORING_OP_REMOVE_BUFFERS removed from the start of
but in fact the documentation doesn't specify which buffer is removed,
only that a certain number of buffers are removed.

Starting with the kernel 5.18 the check for the `used_buffer_id` fails.
Turns out that previous kernels removed buffers in such a way that the
remaining buffer for this read would always be 0, however this isn't
true anymore.

Instead of checking a specific value just check that the `used_buffer_id`
corresponds to a valid ID.
2022-07-16 10:05:11 -05:00
alichraghi
9c66fdadc7 std.testing: add refAllDeclsRecursive function 2022-07-16 12:33:25 +03:00
Ryan Liptak
43770c0103 Fix checkAllAllocationFailures being too strict when checking arg types
Before this would fail to compile:

```
fn testFn(alloc: std.mem.Allocator, arr: []const u8) !void {
    _ = alloc;
    _ = arr;
}

test "checkAll" {
    var arr = [_]u8{ 1, 2, 3 };
    try std.testing.checkAllAllocationFailures(std.testing.allocator, testFn, .{arr[0..]});
}
```

with the error `error: Unexpected type for extra argument at index 0: expected []const u8, found *[3]u8`

By removing this strict equality check, we allow the type checking to be done during the `@field(args, arg_i_str) = @field(extra_args, field.name);` instead, which then allows for things like type coercion to work, but still will give a compile error if the types are incorrect. So, after this change, the above succeeds (because `*[3]u8` can be coerced to `[]const u8`).

The new compile error when providing an incorrect type that can't be coerced looks like this:

```
zig/lib/std/testing.zig:639:35: error: expected type '[]const u8', found '*[3]u32'
        @field(args, arg_i_str) = @field(extra_args, field.name);
                                  ^
```
2022-07-16 12:32:20 +03:00
Hiroaki Nakamura
3e667fd292 Use Managed.len in sub, divFloor, and divTrunc too 2022-07-16 11:46:13 +09:00
Hiroaki Nakamura
0cee8372cf Use Managed.len() instead of Managed.toConst().limbs.len 2022-07-16 08:14:16 +09:00
Hiroaki Nakamura
d63604b116 Fix std.math.big.int.Managed capacity after mul and sqr 2022-07-16 00:08:55 +09:00
Veikka Tuominen
262f4c7b3a std.fs: remove OpenDirOptions.iterate 2022-07-15 14:39:21 +03:00
Veikka Tuominen
2b67f56c35 std.fs: split Dir into IterableDir
Also adds safety check for attempting to iterate directory not opened with `iterate = true`.
2022-07-15 13:04:21 +03:00
Kim SHrier
397e6547a9 add FreeBSD support to std.os.getFdPath
This implementation uses the F_KINFO fcntl command added in FreeBSD
13 release. FreeBSD 12 users get a compile error.

Co-authored-by: Stephen Gregoratto <dev@sgregoratto.me>
2022-07-15 10:16:31 +03:00
Bill Nagel
a455927150 handle HOSTUNREACH for blocking and non-blocking connects 2022-07-14 12:51:40 +03:00
Andrew Kelley
1653a9b259
Merge pull request #12098 from ziglang/llvm-riscv64
LLVM: implement signext/zeroext attributes
2022-07-13 19:15:19 -04:00
Andrew Kelley
fad95741db AstGen: fix loop control flow applying to wrong loop
In the case of 'continue' or 'break' inside the 'else' block of a
'while' or 'for' loop.

Closes #12109
2022-07-13 16:10:41 -07:00
Andrew Kelley
92bc3cbe27 stage2: fix comptime bitcast involving f80
* Sema: implement comptime bitcast of f80 with integer-like types
  bitwise rather than taking a round trip through memory layout.
* Type: introduce `isAbiInt`.
* Value: comptime memory write of f80 writes 0 bytes for padding
  instead of leaving the memory uninitialized.
* Value: floatReadFromMemory has a more general implementation, checking
  the endianness rather than checking for specific architectures.

This fixes behavior test failures occurring on MIPS.
2022-07-13 13:14:37 -07:00
Andrew Kelley
35e7011124 LLVM: implement signext/zeroext attributes
For calling convention ABI purposes, integer attributes and return
values need to have an LLVM attribute signext or zeroext added
sometimes. This commit implements that logic.

It also implements a proof-of-concept of moving the F16T type from
being a compiler_rt hack to being how the compiler lowers f16 in
functions that need to match certain calling conventions.

Closes #12054
2022-07-13 11:14:46 -07:00
Andrew Kelley
efe34243c6 std.math: add inline to some functions
These functions semantically benefit from being inline; it makes sense
that `isInf(x)` where `x` is comptime-known should have a
comptime-known result.
2022-07-13 11:14:46 -07:00
Andrew Kelley
6ab5219e34 std: update test cases to reflect new packed struct semantics 2022-07-12 18:38:11 -07:00