about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2018-08-02Auto merge of #52949 - Mark-Simulacrum:snap, r=alexcrichtonbors-14/+3
Switch to bootstrapping from 1.29 beta r? @alexcrichton
2018-08-02Auto merge of #52847 - upsuper:thread-stack-reserve, r=alexcrichtonbors-1/+4
Don't commit thread stack on Windows On Windows, there is a system level resource limitation called commit limit, which is roughly the sum of physical memory + paging files[1]. `CreateThread` by default commits the stack size[2], which unnecessarily takes such resource from the shared limit. This PR changes it to only reserve the stack size rather than commit it. Reserved memory would only take the address space of the current process until it's actually accessed. This should make the behavior on Windows match other platforms, and is also a pretty standard practice on Windows nowadays. [1] https://blogs.technet.microsoft.com/markrussinovich/2008/11/17/pushing-the-limits-of-windows-virtual-memory/ [2] https://docs.microsoft.com/zh-cn/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createthread
2018-08-01Switch to bootstrapping from 1.29 betaMark Rousskov-14/+3
2018-08-01Implement custom read_to_end for io::Takeljedrz-3/+16
2018-08-01Rollup merge of #52861 - ColinFinck:master, r=alexcrichtonPietro Albini-14/+469
Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and port libstd to it. As a start, the port uses the simplest possible configuration (no jemalloc, abort on panic) and makes use of existing Unix-specific code wherever possible. It adds targets for x86_64 (current main HermitCore platform) and aarch64 (HermitCore platform under development). Together with the patches to "liblibc" (https://github.com/rust-lang/libc/pull/1048) and llvm (https://github.com/rust-lang/llvm/pull/122), this enables HermitCore applications to be written in Rust.
2018-08-01Rollup merge of #52771 - matklad:patch-1, r=kennytmPietro Albini-1/+4
Clarify thread::park semantics It took me quite some time to realize that the example is not actually racy, so let's clarify it? :-)
2018-08-01Rollup merge of #52732 - SimonSapin:spring, r=Mark-SimulacrumPietro Albini-525/+0
Remove unstable and deprecated APIs
2018-08-01Rollup merge of #52340 - cypher:document-from-trait-in-ffi, r=steveklabnikPietro Albini-0/+48
Document From trait implementations for OsStr, OsString, CString, and CStr As part of issue #51430 (cc @skade). The allocation and copy claims should be double-checked. r? @steveklabnik
2018-08-01Document #39364 (WIP)Felix Rabe-0/+6
2018-07-31Fix coding style.Colin Finck-1/+4
2018-07-30Remove unstable and deprecated APIsSimon Sapin-524/+0
2018-07-30Remove the unstable std_unicode crate, deprecated since 1.27Simon Sapin-1/+0
Its former contents are now in libcore.
2018-07-30Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and ↵Colin Finck-14/+466
port libstd to it. As a start, the port uses the simplest possible configuration (no jemalloc, abort on panic) and makes use of existing Unix-specific code wherever possible. It adds targets for x86_64 (current main HermitCore platform) and aarch64 (HermitCore platform under development). Together with the patches to "liblibc" and "llvm", this enables HermitCore applications to be written in Rust.
2018-07-30Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkovbors-1/+1
Don't format!() string literals Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
2018-07-30Don't commit thread stack on WindowsXidorn Quan-1/+4
2018-07-29Auto merge of #52738 - ljedrz:push_to_extend, r=eddybbors-11/+8
Replace push loops with extend() where possible Or set the vector capacity where I couldn't do it. According to my [simple benchmark](https://gist.github.com/ljedrz/568e97621b749849684c1da71c27dceb) `extend`ing a vector can be over **10 times** faster than `push`ing to it in a loop: 10 elements (6.1 times faster): ``` test bench_extension ... bench: 75 ns/iter (+/- 23) test bench_push_loop ... bench: 458 ns/iter (+/- 142) ``` 100 elements (11.12 times faster): ``` test bench_extension ... bench: 87 ns/iter (+/- 26) test bench_push_loop ... bench: 968 ns/iter (+/- 3,528) ``` 1000 elements (11.04 times faster): ``` test bench_extension ... bench: 311 ns/iter (+/- 9) test bench_push_loop ... bench: 3,436 ns/iter (+/- 233) ``` Seems like a good idea to use `extend` as much as possible.
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-11/+8
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-2/+2
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-29Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakisbors-2/+1
Misc cleanups
2018-07-28Don't format!() string literalsljedrz-1/+1
2018-07-28Rollup merge of #52759 - stjepang:impl-send-sync-for-joinhandle, r=TimNNkennytm-0/+5
Impl Send & Sync for JoinHandle This is just a cosmetic change - it slightly relaxes and clarifies the public API without effectively promising any new guarantees. Currently we have [these auto trait implementations](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#synthetic-implementations): ```rust impl<T: Send> Send for JoinHandle<T> {} impl<T: Sync> Sync for JoinHandle<T> {} ``` Bound `T: Send` doesn't make much sense because `JoinHandle<T>` can be created only when `T: Send`. Note that [`JoinHandle::<T>::join`](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#method.join) doesn't require `T: Send` so why should the `Send` impl? And the `Sync` impl doesn't need `T: Sync` because `JoinHandle<T>` cannot even share `T` - it can only send it to the thread that calls `join`.
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-116/+116
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-27Use str::repeatShotaro Yamada-2/+1
2018-07-27Fix wsAleksey Kladov-1/+1
2018-07-27Clarify thread::park semanticsAleksey Kladov-1/+4
2018-07-27Prefer to_string() to format!()ljedrz-2/+2
2018-07-27Add stability attributesStjepan Glavina-0/+2
2018-07-27Impl Send & Sync for JoinHandleStjepan Glavina-0/+3
2018-07-26State default capacity for BufReader/BufWriterJonathan Behrens-2/+4
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-1/+0
2018-07-25Merge remote-tracking branches 'ljedrz/dyn_libcore', 'ljedrz/dyn_libstd' and ↵Tatsuyuki Ishi-114/+115
'ljedrz/dyn_libterm' into dyn-rollup
2018-07-25Add missing dynTatsuyuki Ishi-2/+2
2018-07-24Rollup merge of #52658 - Wallacoloo:topics/use-option-methods, r=cramertjMark Rousskov-13/+6
Prefer `Option::map`/etc over `match` wherever it improves clarity This isn't intended to change behavior anywhere. A lot of times statements like `match x { None => None, Some(y) => [...] }` can be rewritten using `Option::map` or `Option::and_then` in a way that preserves or improves clarity, so that's what I've done here. I think it's particularly valuable to keep things in `libcore` and `libstd` pretty/idiomatic since it's not uncommon to follow the `[src]` links when browsing the rust-lang.org docs for std/core. If there's any concern about pushing style-based changes though, I'll happily back out the non-std/core commits here.
2018-07-24Rollup merge of #52656 - jD91mZM2:stablize-uds, r=alexcrichtonMark Rousskov-1/+41
Stablize Redox Unix Sockets I don't know if I did this correctly, but I basically spammed the `#[stable]` attribute everywhere :^)
2018-07-24Auto merge of #52646 - ljedrz:single_char_pattern, r=michaelwoeristerbors-3/+3
Change single char str patterns to chars A `char` is faster.
2018-07-23libstd: Prefer `Option::map`/etc over `match` where applicableColin Wallace-13/+6
2018-07-24Stablize Redox Unix SocketsjD91mZM2-1/+41
2018-07-24Rollup merge of #52548 - tko:cursor-doc, r=sfacklerkennytm-8/+9
Cursor: update docs to clarify Cursor only works with in-memory buffers Reduce misconceptions about Cursor being more general than it really is. Fixes: #52470
2018-07-23Seperate summaries from rest of the commentMarkus Wein-0/+2
2018-07-23Change single char str patterns to charsljedrz-3/+3
2018-07-23Rollup merge of #52582 - felixrabe:patch-2, r=pietroalbinikennytm-1/+1
Typo
2018-07-23Rollup merge of #52581 - petrochenkov:bmacrodoc, r=alexcrichtonkennytm-17/+17
Avoid using `#[macro_export]` for documenting builtin macros Use a special `rustc_*` attribute instead. cc https://github.com/rust-lang/rust/pull/52234
2018-07-22Auto merge of #52394 - estebank:println, r=oli-obkbors-4/+18
Improve suggestion for missing fmt str in println Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal. Fix #52347.
2018-07-21fix tidy ~ againEsteban Küber-13/+0
2018-07-21Don't use the new `eprintln` for stage0 and stage1Esteban Küber-2/+2
I'm not entirely sure why (or if) this is needed.
2018-07-21Change `eprintln!()`Esteban Küber-2/+9
Address #30143 as well. `writeln!()` hasn't been changed.
2018-07-21Gate `format_args_nll` behind feature flagEsteban Küber-1/+1
2018-07-21TypoFelix Rabe-1/+1
2018-07-21Auto merge of #52535 - alexcrichton:update-stdsimd, r=Mark-Simulacrumbors-4/+0
Update stdsimd to undo an accidental stabilization Closes #52403
2018-07-20Update stdsimd to undo an accidental stabilizationAlex Crichton-4/+0
Closes #52403