about summary refs log tree commit diff
path: root/src/libstd/sys_common
AgeCommit message (Collapse)AuthorLines
2019-02-28Fix some imports and pathsTaiki Endo-1/+1
2019-02-28libstd => 2018Taiki Endo-108/+109
2019-02-26Auto merge of #58357 - sfackler:vectored-io, r=alexcrichtonbors-1/+9
Add vectored read and write support This functionality has lived for a while in the tokio ecosystem, where it can improve performance by minimizing copies. r? @alexcrichton
2019-02-20Rollup merge of #58553 - scottmcm:more-ihle, r=Centrilkennytm-6/+6
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-17Use more impl header lifetime elisionScott McMurray-6/+6
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-13Add vectored read and write supportSteven Fackler-1/+9
This functionality has lived for a while in the tokio ecosystem, where it can improve performance by minimizing copies.
2019-02-10libs: doc commentsAlexander Regueiro-7/+7
2018-12-31Bound sgx target_env with fortanix as target_vendorYu Ding-1/+1
Signed-off-by: Yu Ding <dingelish@gmail.com>
2018-12-25Remove licensesMark Rousskov-199/+0
2018-12-24std: Use backtrace-sys from crates.ioAlex Crichton-51/+29
This commit switches the standard library to using the `backtrace-sys` crate from crates.io instead of duplicating the logic here in the Rust repositor with the `backtrace-sys`'s crate's logic. Eventually this will hopefully be a good step towards using the `backtrace` crate directly from crates.io itself, but we're not quite there yet! Hopefully this is a small incremental first step we can take.
2018-12-14std: Use `rustc_demangle` from crates.ioAlex Crichton-228/+11
No more need to duplicate the demangling routine between crates.io and the standard library, we can use the exact same one!
2018-12-11Remove unnecessary feature gates from const fnsOliver Scherer-3/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-07SGX target: implement synchronization primitives and threadingJethro Beekman-0/+3
2018-12-07Add x86_64-fortanix-unknown-sgx target to libstd and dependenciesJethro Beekman-3/+5
The files src/libstd/sys/sgx/*.rs are mostly copied/adapted from the wasm target. This also updates the dlmalloc submodule to the very latest version.
2018-12-06Refactor net::each_addr/lookup_host to forward error from resolveJethro Beekman-16/+58
2018-12-06Refactor stderr_prints_nothing into a more modular functionJethro Beekman-4/+3
2018-12-04cleanup: remove static lifetimes from consts in libstdljedrz-1/+1
2018-11-11std: Delete the `alloc_system` crateAlex Crichton-0/+51
This commit deletes the `alloc_system` crate from the standard distribution. This unstable crate is no longer needed in the modern stable global allocator world, but rather its functionality is folded directly into the standard library. The standard library was already the only stable location to access this crate, and as a result this should not affect any stable code.
2018-11-06refactor: use shorthand fieldsteresy-3/+3
2018-09-15Improve output if no_lookup_host_duplicates failsPhilip Munksgaard-2/+3
If the test fails, output the offending addresses and a helpful error message. Also slightly improve legibility of the preceding line that puts the addresses into a HashMap.
2018-09-04Breaking change upgradesMark Rousskov-1/+1
2018-08-20Replace usages of ptr::offset with ptr::{add,sub}.Corey Farwell-1/+1
2018-08-08avoid using the word 'initialized' to talk about that non-reentrant-capable ↵Ralf Jung-3/+5
state of the mutex
2018-08-06actually, reentrant uninitialized mutex acquisition is outright UBRalf Jung-9/+7
2018-08-06argue why at_exit_imp is fineRalf Jung-3/+3
2018-08-06I think we have to strengthen Mutex::init UBRalf Jung-1/+1
2018-08-06clarify partially initialized Mutex issuesRalf Jung-0/+13
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-1/+1
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-9/+9
Rollup of bare_trait_objects PRs All deny attributes were moved into bootstrap so they can be disabled with a line of config. Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free. r? @Mark-Simulacrum cc @ljedrz @kennytm
2018-07-27Prefer to_string() to format!()ljedrz-1/+1
2018-07-23libstd: Prefer `Option::map`/etc over `match` where applicableColin Wallace-5/+4
2018-07-10Deny bare trait objects in `src/libstd`.ljedrz-9/+9
2018-07-02Make Stdio handle UnwindSafeEvan Simmons-0/+4
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-7/+7
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-17libstd: add an RAII utility for sys_common::mutex::MutexNODA, Kai-17/+39
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2018-05-12Rollup merge of #50550 - llogiq:fmt-result, r=petrochenkovMark Simulacrum-2/+2
use fmt::Result where applicable This is a quite boring PR, but I think the type alias improves readability, so why not use it?
2018-05-09use fmt::Result where applicableAndre Bogus-2/+2
2018-05-07Add explanation for #[must_use] on mutex guardsManish Goregaokar-1/+1
2018-04-21Remove unused methods on the private Wtf8 typeSimon Sapin-14/+0
The type and its direct parent module are `pub`, but they’re not reachable outside of std
2018-04-13std: Minimize size of panicking on wasmAlex Crichton-14/+22
This commit applies a few code size optimizations for the wasm target to the standard library, namely around panics. We notably know that in most configurations it's impossible for us to print anything in wasm32-unknown-unknown so we can skip larger portions of panicking that are otherwise simply informative. This allows us to get quite a nice size reduction. Finally we can also tweak where the allocation happens for the `Box<Any>` that we panic with. By only allocating once unwinding starts we can reduce the size of a panicking wasm module from 44k to 350 bytes.
2018-04-12Import the `alloc` crate as `alloc_crate` in stdSimon Sapin-3/+3
… to make the name `alloc` available.
2018-04-12Move Utf8Lossy decoder to libcoreSimon Sapin-1/+1
2018-04-04Auto merge of #48575 - ishitatsuyuki:unix-no-thread, r=alexcrichtonbors-0/+4
rustc_driver: get rid of the extra thread **Do not rollup** We can alter the stack size afterwards on Unix. Having a separate thread causes poor debugging experience when interrupting with signals. I have to get the backtrace of the all thread, as the main thread is waiting to join doing nothing else. This patch allows me to just run `bt` to get the desired backtrace.
2018-03-27Implement `shrink_to` method on collectionsDiggory Blake-0/+5
2018-03-23Rollup merge of #48624 - bdrewery:freebsd-posix-spawn, r=alexcrichtonAlex Crichton-0/+12
Command: Support posix_spawn() on FreeBSD/OSX/GNU Linux
2018-03-21Deprecate the AsciiExt trait in favor of inherent methodsSimon Sapin-10/+7
The trait and some of its methods are stable and will remain. Some of the newer methods are unstable and can be removed later. Fixes https://github.com/rust-lang/rust/issues/39658
2018-03-19Simplify PATH key comparisonBryan Drewery-1/+1
2018-03-19Don't use posix_spawn() if PATH was modified in the environment.Bryan Drewery-0/+12
The expected behavior is that the environment's PATH should be used to find the process. posix_spawn() could be used if we iterated PATH to search for the binary to execute. For now just skip posix_spawn() if PATH is modified.
2018-03-18rustc_driver: get rid of extra thread on UnixTatsuyuki Ishi-0/+4