summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2020-02-10Avoid jumping to Rust code with user %rsp (reentry_panic)Jethro Beekman-7/+6
2020-02-10sanitize MXCSR/FPU control registersRaoul Strackx-0/+11
2020-02-10Corrected ac_mitigation patch. That patch used the untrusted stack to clear ↵Raoul Strackx-7/+16
rflags during enclave (re-)entry
2020-02-10Fix SGX RWLock representation for UnsafeCell niche fixJethro Beekman-11/+13
2020-02-07Stabilize Once::is_completedMichael Bradshaw-6/+5
2020-02-06Rollup merge of #68524 - jonas-schievink:generator-resume-arguments, r=ZoxcDylan DPC-1/+4
Generator Resume Arguments cc https://github.com/rust-lang/rust/issues/43122 and https://github.com/rust-lang/rust/issues/56974 Blockers: * [x] Fix miscompilation when resume argument is live across a yield point (https://github.com/rust-lang/rust/pull/68524#issuecomment-578459069) * [x] Fix 10% compile time regression in `await-call-tree` benchmarks (https://github.com/rust-lang/rust/pull/68524#issuecomment-578487162) * [x] Fix remaining 1-3% regression (https://github.com/rust-lang/rust/pull/68524#issuecomment-579566255) - resolved (https://github.com/rust-lang/rust/pull/68524#issuecomment-581144901) * [x] Make dropck rules account for resume arguments (https://github.com/rust-lang/rust/pull/68524#issuecomment-578541137) Follow-up work: * Change async/await desugaring to make use of this feature * Rewrite [`box_region.rs`](https://github.com/rust-lang/rust/blob/3d8778d767f0dde6fe2bc9459f21ead8e124d8cb/src/librustc_data_structures/box_region.rs) to use resume arguments (this shows up in profiles too)
2020-02-06Add primitive module to libcore/stdMark Rousskov-1/+4
This re-exports the primitive types from libcore at `core::primitive` to allow macro authors to have a reliable location to use them from.
2020-02-06Auto merge of #68861 - Dylan-DPC:rollup-0m09hsg, r=Dylan-DPCbors-3/+2
Rollup of 8 pull requests Successful merges: - #68762 (Strip unnecessary subexpression) - #68790 (Improve `merge_from_succ`) - #68809 (Make more arithmetic functions unstably const) - #68832 (Clean up E0264, E0267 and E0268 explanations) - #68840 (On suggesting `#![recursion_limit = "X"]`, note current crate name) - #68846 (doc fix on doc attribute) - #68851 (Fix issue number of `capacity` method) - #68858 (Merge item id stable hashing functions) Failed merges: r? @ghost
2020-02-05Rollup merge of #68851 - JohnTitor:fix-issue-number, r=CentrilDylan DPC-2/+2
Fix issue number of `capacity` method Follow-up of https://github.com/rust-lang/rust/pull/68558#issuecomment-582117131 r? @alexcrichton
2020-02-05Rollup merge of #68762 - ForNeVeR:patch-1, r=alexcrichtonDylan DPC-1/+0
Strip unnecessary subexpression It became unnecessary since a06baa56b95674fc626b3c3fd680d6a65357fe60 reformatted the file. The comment is currently a bit misleading.
2020-02-05Auto merge of #68755 - Tyg13:update_stdarch, r=alexcrichtonbors-6/+1
Update `rust-lang/stdarch` submodule Update submodule [rust-lang/stdarch](https://github.com/rust-lang/stdarch/)
2020-02-05Fix issue number of `capacity` methodYuki Okushi-2/+2
2020-02-04Auto merge of #68558 - HeroicKatora:buf-writer-capacity, r=alexcrichtonbors-0/+45
Add a method to query the capacity of a BufWriter and BufReader Besides the obvious of retrieving the parameter used to construct the writer, this method allows consumers to control the number of `flush` calls during write operations. For `BufReader` it gives an upper bound on the returned buffer in `fill_buf` which might influence the allocation behaviour of a consumer.
2020-02-04Added From<Vec<NonZeroU8>> for CStringDaniel Henry-Mantilla-0/+28
Updated tracking issue number Added safeguards for transmute_vec potentially being factored out elsewhere Clarified comment about avoiding mem::forget Removed unneeded unstable guard Added back a stability annotation for CI Minor documentation improvements Thanks to @Centril's code review Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com> Improved layout checks, type annotations and removed unaccurate comment Removed unnecessary check on array layout Adapt the stability annotation to the new 1.41 milestone Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com> Simplify the implementation. Use `Vec::into_raw_parts` instead of a manual implementation of `Vec::transmute`. If `Vec::into_raw_parts` uses `NonNull` instead, then the code here will need to be adjusted to take it into account (issue #65816) Reduce the whitespace of safety comments
2020-02-04Auto merge of #68708 - Mark-Simulacrum:stage0-step, r=pietroalbinibors-23/+1
Step stage0 to bootstrap from 1.42 This also includes a commit which fixes the rustfmt downloading logic to redownload when the rustfmt channel changes, and bumps rustfmt to a more recent version.
2020-02-03Rollup merge of #68797 - GuillaumeGomez:link-to-types, r=Dylan-DPCDylan DPC-2/+2
Fix links to types instead of modules r? @Dylan-DPC
2020-02-03Fix links to types instead of modulesGuillaume Gomez-2/+2
2020-02-02Add a resume type parameter to `Generator`Jonas Schievink-1/+4
2020-02-02Strip unnecessary subexpressionFriedrich von Never-1/+0
It became unnecessary since a06baa56b95674fc626b3c3fd680d6a65357fe60 reformatted the file.
2020-02-01stdarch: update submodule.Tyler Lanphear-6/+1
2020-01-31Drop cfg(bootstrap) codeMark Rousskov-23/+1
2020-01-31Rollup merge of #68660 - kubo39:patch-1, r=Dylan-DPCDylan DPC-2/+2
Fix typo.
2020-01-31Remove incorrect debug assertions from catch_unwindTomasz Miąsko-2/+0
Previously the debug assertions in the implementation of catch_unwind used to verify consistency of the panic count by checking that the count is zero just before leaving the function. This incorrectly assumed that no panic was in progress when entering `catch_unwind`.
2020-01-30Auto merge of #68325 - faern:move-numeric-consts-to-associated-consts-step1, ↵bors-0/+1
r=LukasKalbertodt Move numeric consts to associated consts step1 A subset of #67913. Implements the first step of RFC https://github.com/rust-lang/rfcs/pull/2700 This PR adds the new constants as unstable constants and defines the old ones in terms of the new ones. Then fix a tiny bit of code that started having naming collisions because of the new assoc consts. Removed a test that did not seem relevant any longer. Since doing just `u8::MIN` should now indeed be valid.
2020-01-30UpdateHiroki Noda-2/+2
2020-01-30Fix typo.Hiroki Noda-1/+1
2020-01-29Document remaining undocumented `From` implementations for IPsLeSeulArtichaut-0/+72
2020-01-29Rollup merge of #68627 - joshtriplett:write-all-none, r=Dylan-DPCYuki Okushi-0/+2
Document that write_all will not call write if given an empty buffer Some types of Write instances have a semantic meaning associated with writing an empty buffer, such as sending an empty packet. This works when calling `write` directly, and supplying an empty buffer. However, calling `write_all` on an empty buffer will simply never call `write`, because `write_all` assumes it has no work to do. Document this behavior, to help prospective users of datagram-packet-style Write instances.
2020-01-28Document that write_all will not call write if given an empty bufferJosh Triplett-0/+2
Some types of Write instances have a semantic meaning associated with writing an empty buffer, such as sending an empty packet. This works when calling `write` directly, and supplying an empty buffer. However, calling `write_all` on an empty buffer will simply never call `write`, because `write_all` assumes it has no work to do. Document this behavior, to help prospective users of datagram-packet-style Write instances.
2020-01-28Update links to WASI docs in time.rs moduleJakub Konka-2/+2
Since the docs for the WASI API are now evolving in [WebAssembly/WASI] repo, I thought it might be useful to update the links in the docs to point to that location instead of using the outdated `CraneStation/wasmtime` destination. [WebAssembly/WASI]: https://github.com/WebAssembly/WASI
2020-01-28Add capacity to BufReader with same unstable gateAndreas Molzer-0/+26
2020-01-28Auto merge of #68529 - TimDiekmann:rename-alloc, r=Amanieubors-2/+2
Rename `Alloc` to `AllocRef` The allocator-wg has decided to merge this change upstream in https://github.com/rust-lang/wg-allocators/issues/8#issuecomment-577122958. This renames `Alloc` to `AllocRef` because types that implement `Alloc` are a reference, smart pointer, or ZSTs. It is not possible to have an allocator like `MyAlloc([u8; N])`, that owns the memory and also implements `Alloc`, since that would mean, that moving a `Vec<T, MyAlloc>` would need to correct the internal pointer, which is not possible as we don't have move constructors. For further explanation please see https://github.com/rust-lang/wg-allocators/issues/8#issuecomment-489464843 and the comments after that one. Additionally it clarifies the semantics of `Clone` on an allocator. In the case of `AllocRef`, it is clear that the cloned handle still points to the same allocator instance, and that you can free data allocated from one handle with another handle. The initial proposal was to rename `Alloc` to `AllocHandle`, but `Ref` expresses the semantics better than `Handle`. Also, the only appearance of `Handle` in `std` are for windows specific resources, which might be confusing. Blocked on https://github.com/rust-lang/miri/pull/1160
2020-01-27Rename `Alloc` to `AllocRef`Tim Diekmann-2/+2
2020-01-26updatecomet-1/+1
2020-01-26Add a method to query the capacity of a BufWriterAndreas Molzer-0/+19
2020-01-25Rollup merge of #68515 - Wind-River:master_2020, r=alexcrichtonYuki Okushi-5/+39
Support feature process_set_argv0 for VxWorks r? @alexcrichton
2020-01-24Support feature process_set_argv0 for VxWorksBaoshanPang-5/+39
2020-01-24Remove unused ignore-license directivesTomasz Miąsko-4/+0
The tidy check was removed in rust-lang/rust#53617
2020-01-23Unlock assoc_int_consts in core+stdLinus Färnstrand-0/+1
2020-01-21Rollup merge of #68313 - batrla:master, r=alexcrichtonMazdak Farrokhzad-73/+51
Options IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD Options IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD and Solaris See ip(4P) man page: IP_MULTICAST_TTL Time to live for multicast datagrams. This option takes an unsigned character as an argument. Its value is the TTL that IP uses on outgoing multi- cast datagrams. The default is 1. IP_MULTICAST_LOOP Loopback for multicast datagrams. Normally multi- cast datagrams are delivered to members on the sending host (or sending zone). Setting the unsigned character argument to 0 causes the oppo- site behavior, meaning that when multiple zones are present, the datagrams are delivered to all zones except the sending zone. https://docs.oracle.com/cd/E88353_01/html/E37851/ip-4p.html https://man.openbsd.org/ip.4
2020-01-20Auto merge of #68066 - CAD97:stabilize-manuallydrop-take, ↵bors-1/+0
r=Amanieu,Mark-Simulacrum Stabilize ManuallyDrop::take Tracking issue: closes #55422 FCP merge: https://github.com/rust-lang/rust/issues/55422#issuecomment-572653619 Reclaims the doc improvements from closed #62198. ----- Stable version is a simple change if necessary. Proposal: [relnotes] (this changes how to best take advantage of `ManuallyDrop`, esp. wrt. `Drop::drop` and finalize-by-value members)
2020-01-20refactor fix using cfg_if! (fix build on Solaris)Vita Batrla-0/+1
2020-01-18Rollup merge of #68341 - fusion-engineering-forks:instant-docs, r=Dylan-DPCMazdak Farrokhzad-4/+4
Fix syscalls tables in docs of std::time.
2020-01-18slice_patterns: remove internal uses of gateMazdak Farrokhzad-1/+1
2020-01-18Fix table of syscalls in docs of std::time::SystemTime.Mara Bos-2/+2
2020-01-18Fix table of syscalls in docs of std::time::Instant.Mara Bos-2/+2
2020-01-18refactor fix using cfg_if! (fix build)Vita Batrla-6/+16
2020-01-17refactor fix using cfg_if!Vita Batrla-120/+55
2020-01-17Options IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD and SolarisVita Batrla-18/+50
See ip(4P) man page: IP_MULTICAST_TTL Time to live for multicast datagrams. This option takes an unsigned character as an argument. Its value is the TTL that IP uses on outgoing multi- cast datagrams. The default is 1. IP_MULTICAST_LOOP Loopback for multicast datagrams. Normally multi- cast datagrams are delivered to members on the sending host (or sending zone). Setting the unsigned character argument to 0 causes the oppo- site behavior, meaning that when multiple zones are present, the datagrams are delivered to all zones except the sending zone. https://docs.oracle.com/cd/E88353_01/html/E37851/ip-4p.html https://man.openbsd.org/ip.4
2020-01-16Rollup merge of #68033 - ollie27:win_f32, r=dtolnayDylan DPC-57/+13
Don't use f64 shims for f32 cmath functions on non 32-bit x86 MSVC These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.