about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-111471/+0
2020-07-27Rollup merge of #74598 - mzohreva:mz/fix-test, r=KodrAusYuki Okushi-0/+2
Fix sync_once_cell_does_not_leak_partially_constructed_boxes Spinning multiple threads in this test causes a deadlock in SGX where thread scheduling is not preemptive. cc @jethrogb @AdrianCX
2020-07-26Avoid writes without any data in `Write::write_all_vectored`Tomasz Miąsko-2/+5
Previously, when non-empty sequence of empty IoSlices have been provided to `Write::write_all_vectored`, the buffers would be written as is with `Write::write_vectored` and subsequently the return value `Ok(0)` would be misinterpreted as an error. Avoid writes without any data by advancing the buffers first. This matches the documented behaviour of `Write::write_all_vectored` and is analogous to what happens in `Write::write_all`.
2020-07-26Auto merge of #74060 - kpp:remove_length_at_most_32, r=dtolnaybors-9/+4
Remove trait LengthAtMost32 This is a continuation of https://github.com/rust-lang/rust/pull/74026 preserving the original burrbull's commit. I talked to @burrbull, he suggested me to finish his PR.
2020-07-25Auto merge of #74017 - poliorcetics:where-keyword, r=jyn514bors-2/+93
Document the where keyword Partial fix of #34601 (and last PR for it 🎉). This documents the `where` keyword. @rustbot modify labels: T-doc,C-enhancement
2020-07-24Auto merge of #73645 - poliorcetics:ref-keyword, r=jyn514bors-2/+43
Document the ref keyword Partial fix for #34601. This documents the `ref` keyword with two examples, one failing to compile because the `ref` keyword is missing, and the same example fixed with the keyword inserted in the correct place. It also explains (very *very* rapidly) the differences between `&` and `ref`. I put a link to the best place I could find in the Reference but there may be something better that I didn't find.
2020-07-24Auto merge of #74681 - RalfJung:miri-extern-fn, r=oli-obkbors-1/+17
Miri: use extern fn to expose interpreter operations to program; fix leak checker on Windows This PR realizes an idea that @oli-obk has been suggesting for a while: to use Miri-specific `extern` functions to provide some extra capabilities to the program. Initially, we have two of these methods, which libstd itself needs: * `miri_start_panic`, which replaces the intrinsic of the same name (mostly for consistency, to avoid having multiple mechanisms for Miri-specific functionality). * `miri_static_root`, which adds an allocation to a list of static "roots" that Miri considers as not having leaked (including all memory reachable through them). This is needed for https://github.com/rust-lang/miri/issues/1302. We use `extern` functions instead of intrinsics for this so that user code can more easily call these Miri hoolks -- e.g. `miri_static_root` should be useful for https://github.com/rust-lang/miri/issues/1318. The Miri side of this is at https://github.com/rust-lang/miri/pull/1485. r? @oli-obk
2020-07-24Fix nits, rework the second example of select (the one deliberately failing ↵Alexis Bourget-33/+15
to compile)
2020-07-24Fix nitsAlexis Bourget-3/+3
2020-07-24Rollup merge of #72954 - hermitcore:rwlock, r=dtolnayManish Goregaokar-41/+140
revise RwLock for HermitCore - current version is derived from the wasm implementation - increasing the readability of `Condvar` - simplify the interface to the libos
2020-07-23Fix nitAlexis Bourget-1/+2
2020-07-23Fix nit and add link for CowAlexis Bourget-32/+8
2020-07-23avoid implicitly returning ()Ralf Jung-1/+2
2020-07-23on Windows, use miri_static_root for TLS dtorsRalf Jung-1/+16
2020-07-23Auto merge of #74613 - Mark-Simulacrum:revert-gimli, r=nnethercotebors-31/+23
Revert libbacktrace -> gimli This reverts 4cbd265c119cb1a5eb92e98d2bb93466f05efa46 028f8d7b85898683b99e05564cd2976c7e0d5b43 13db3cc1e8d2fd4b8e7c74d91002274d7b62801b d7a36d8964c927863faef5d3b42da08f37e5896c (and technically 79673d300915f846726c27b9e1974dc451013ee9 but it's made empty by previous reverts). The current plan is to land this PR as a temporary change, so that we can get a better handle on the regressions introduced by it. Trying to fix/examine them in master is difficult, and we want to be better able to evaluate them without impact to other PRs being landed in the mean time. That said, it is currently *my* belief that gimli, in one form or another, will need to land sometime soon. I think it's quite likely that it may slip a week or two, but I would personally push for re-landing it then "regardless" of the regressions. We should try to focus efforts on understanding and removing as much of the performance impact as possible, as everyone pretty much agrees that it should be quite minimal (and entirely in the linker, basically). r? @nnethercote
2020-07-23Rollup merge of #74606 - cuviper:cloexec, r=sfacklerManish Goregaokar-195/+74
Remove Linux workarounds for missing CLOEXEC support Now that #74163 updated the minimum Linux kernel to 2.6.32, we can assume the availability of APIs that open file descriptors that are already set to close on exec, including the flags `O_CLOEXEC`, `SOCK_CLOEXEC`, and `F_DUPFD_CLOEXEC`. Closes #74519.
2020-07-23Rollup merge of #74587 - lzutao:consts, r=dtolnayManish Goregaokar-27/+26
Prefer constant over function Just that I prefer constants over functions that can be made const.
2020-07-23Rollup merge of #74548 - tshepang:one-more-example, r=dtolnayManish Goregaokar-0/+3
one more Path::with_extension example, to demonstrate behavior
2020-07-23Rollup merge of #74490 - yaahc:disabled-bt, r=dtolnayManish Goregaokar-0/+6
add a Backtrace::disabled function Based upon @dtolnay's suggestion here: https://github.com/dtolnay/anyhow/pull/97#issuecomment-647172942
2020-07-23Rollup merge of #74141 - euclio:typos, r=steveklabnikManish Goregaokar-12/+12
libstd/libcore: fix various typos
2020-07-23Prefer constant over functionLzu Tao-28/+27
2020-07-22Update src/libstd/backtrace.rsJane Lusby-1/+1
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2020-07-22one more Path::with_extension example, to demonstrate behaviorTshepang Lekhonkhobe-0/+3
2020-07-22Move the pipe2 call behind a hard target `#[cfg]`Josh Stone-21/+29
2020-07-22build: Avoid unnecessary build script reruns in libstdVadim Petrochenkov-0/+1
Add a FIXME to build scripts in profiler_builtins
2020-07-22build: Remove unnecessary `build = "build.rs"` annotationsVadim Petrochenkov-1/+0
2020-07-22Revert "std: Switch from libbacktrace to gimli"Mark Rousskov-32/+23
This reverts commit 13db3cc1e8d2fd4b8e7c74d91002274d7b62801b.
2020-07-22Revert "std: Fix compilation without backtrace feature"Mark Rousskov-1/+2
This reverts commit 028f8d7b85898683b99e05564cd2976c7e0d5b43.
2020-07-21Remove Linux workarounds for missing CLOEXEC supportJosh Stone-187/+58
Now that #74163 updated the minimum Linux kernel to 2.6.32, we can assume the availability of APIs that open file descriptors that are already set to close on exec, including the flags `O_CLOEXEC`, `SOCK_CLOEXEC`, and `F_DUPFD_CLOEXEC`.
2020-07-21Fix sync_once_cell_does_not_leak_partially_constructed_boxesMohsen Zohrevandi-0/+2
Spinning multiple threads in this test causes a deadlock in SGX where thread scheduling is not preemptive.
2020-07-21Auto merge of #74075 - sunfishcode:wasi-prelude-rawfd, r=alexcrichtonbors-1/+1
Add `RawFd` to WASI's `std::os::wasi::prelude`. Add `RawFd` to WASI's `std::os::wasi::prelude`, making it consistent with all other platforms which also have `AsRawFd`, `FromRawFd`, and `IntoRawFd` in their respective preludes.
2020-07-20Rollup merge of #74546 - jethrogb:jb/duplicate-attribute-maybe_uninit_extra, ↵Manish Goregaokar-4/+1
r=kennytm Fix duplicate maybe_uninit_extra attribute Introduced in #72414
2020-07-20Fix duplicate maybe_uninit_extra attributeJethro Beekman-4/+1
2020-07-20Auto merge of #74010 - pierwill:pierwill-o-notation, r=GuillaumeGomezbors-1/+1
Use italics for O notation In documentation, I think it makes sense to italicize O notation (*O(n)*) as opposed to using back-ticks (`O(n)`). Visually, back-ticks focus the reader on the literal characters being used, making them ideal for representing code. Using italics, as far I can tell, more closely follows typographic conventions in mathematics and computer science. Just a suggestion, of course! 😇
2020-07-20Auto merge of #74540 - alexcrichton:std-no-backtrace, r=Mark-Simulacrumbors-2/+1
std: Fix compilation without backtrace feature This should hopefully handle #74484 but in any case fixes compilation of the standard library without the `backtrace` feature. The need for this feature is somewhat unclear now because the `backtrace` crate should always compile (no more C code!) but we can handle that later if necessary.
2020-07-19Use italics for O notationpierwill-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2020-07-19Rollup merge of #74536 - Nicholas-Baron:master, r=joshtriplettManish Goregaokar-4/+4
fix documentation surrounding the `in` and `for` keywords Addresses #74529 The `in` keyword incorrectly referenced the `Iterator` trait. This reference was changed to `IntoIterator` without changing the underlying link. Additionally, the `IntoIterator` trait was referenced towards the end of the documentation for `for`. An additional reference was added earlier and broadened the existing documentation from any iterator to anything that can be turned into an iterator.
2020-07-19Rollup merge of #74486 - poliorcetics:read-exact-doc-point-to-read, ↵Manish Goregaokar-1/+4
r=Mark-Simulacrum Improve Read::read_exact documentation Fixes #72186. For now I simply added a link to `Read::read` and held off changing the text in `Read::read_exact`. I can do it if it is deemed necessary. @rustbot modify labels: C-enhancement, T-libs
2020-07-19Rollup merge of #73618 - poliorcetics:false-keyword, r=jyn514Manish Goregaokar-3/+4
Documentation for the false keyword Partial fix of #34601. Short documentation for the false keyword mainly pointing to the `true` keyword.
2020-07-19std: Fix compilation without backtrace featureAlex Crichton-2/+1
This should hopefully handle #74484 but in any case fixes compilation of the standard library without the `backtrace` feature. The need for this feature is somewhat unclear now because the `backtrace` crate should always compile (no more C code!) but we can handle that later if necessary.
2020-07-19Update src/libstd/keyword_docs.rs Nicholas Baron-1/+1
Clear up wording regarding the iterator and usage of `break`. Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2020-07-19Linked the earlier mention of IntoIterator in the keyword 'for' docsNicholas-Baron-1/+1
2020-07-19Mentioned IntoIterator in keyword 'in' docsNicholas-Baron-2/+2
2020-07-19Mentioned IntoIterator earlier in keyword 'for' docsNicholas-Baron-2/+2
2020-07-19Fix merge conflict with recent PRAlexis Bourget-226/+372
2020-07-19Apply suggestions from reviewPoliorcetics-1/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-07-19Rollup merge of #74485 - Manishearth:more-intra-doc, r=jyn514Manish Goregaokar-196/+79
More intra-doc links, add explicit exception list to linkchecker Fixes the broken links behind #32553 Progress on #32130 and #32129 except for a small number of links. Instead of whitelisting entire files, I've changed the code to whitelist specific links in specific files, and added a comment requesting people explain the reasons they add exceptions. I'm not sure if we should close those issues in favor of the already filed intra-doc link issues.
2020-07-19Rollup merge of #74356 - lzutao:rm_combine, r=LukasKalbertodtManish Goregaokar-7/+3
Remove combine function Comparing two array directly helps generate better assert message. Resolve https://github.com/rust-lang/rust/pull/74271/files#r454538514
2020-07-19Rollup merge of #74333 - poliorcetics:std-alloc-unsafe-op-in-unsafe-fn, ↵Manish Goregaokar-20/+71
r=LukasKalbertodt Deny unsafe operations in unsafe functions in libstd/alloc.rs Partial fix of #73904. This encloses `unsafe` operations in `unsafe fn` in `libstd/alloc.rs`. @rustbot modify labels: F-unsafe-block-in-unsafe-fn
2020-07-19Remove useless link to bool primitiveAlexis Bourget-1/+0