about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-09-16Auto merge of #43017 - durka:stabilize-const-invocation, r=eddybbors-0/+13
Individualize feature gates for const fn invocation This PR changes the meaning of `#![feature(const_fn)]` so it is only required to declare a const fn but not to call one. Based on discussion at #24111. I was hoping we could have an FCP here in order to move that conversation forward. This sets the stage for future stabilization of the constness of several functions in the standard library (listed below), so could someone please tag the lang team for review. - `std::cell` - `Cell::new` - `RefCell::new` - `UnsafeCell::new` - `std::mem` - `size_of` - `align_of` - `std::ptr` - `null` - `null_mut` - `std::sync` - `atomic` - `Atomic{Bool,Ptr,Isize,Usize}::new` - `once` - `Once::new` - primitives - `{integer}::min_value` - `{integer}::max_value` Some other functions are const but they are also unstable or hidden, e.g. `Unique::new` so they don't have to be considered at this time. After this stabilization, the following `*_INIT` constants in the standard library can be deprecated. I wasn't sure whether to include those deprecations in the current PR. - `std::sync` - `atomic` - `ATOMIC_{BOOL,ISIZE,USIZE}_INIT` - `once` - `ONCE_INIT`
2017-09-16change #![feature(const_fn)] to specific gatesAlex Burka-0/+13
2017-09-14Rollup merge of #44563 - budziq:stablilize_tcpstream_connect_timeout, ↵Corey Farwell-1/+1
r=alexcrichton stabilize tcpstream_connect_timeout (closes #43079)
2017-09-14Rollup merge of #44541 - GuillaumeGomez:openoptions-docs, r=QuietMisdreavusCorey Farwell-5/+23
Openoptions docs r? @QuietMisdreavus
2017-09-14Rollup merge of #44388 - tbu-:pr_doc_udp_connect_multiple, r=frewsxcvCorey Farwell-16/+9
Clarify the behavior of UDP sockets wrt. multiple addresses in `connect` CC @frewsxcv #22569 #44209
2017-09-14Rollup merge of #44378 - frehberg:rustdoc, r=dtolnayCorey Farwell-13/+41
rustdoc: extend UdpSocket API doc (#657) see https://github.com/carllerche/mio/issues/657
2017-09-14stabilize tcpstream_connect_timeout (closes #43079)Michal Budzynski-1/+1
2017-09-14Merge branch 'master' into threadnameJoshua Sheard-109/+690
2017-09-14Auto merge of #43972 - TobiasSchaffner:std_clean, r=alexcrichtonbors-46/+537
Add the libstd-modifications needed for the L4Re target This commit adds the needed modifications to compile the std crate for the L4 Runtime environment (L4Re). A target for the L4Re was introduced in commit: c151220a84e40b65e45308cc0f3bbea4466d3acf In many aspects implementations for linux also apply for the L4Re microkernel. Some uncommon characteristics had to be resolved: * L4Re has no network funktionality * L4Re has a maximum stacksize of 1Mb for threads * L4Re has no uid or gid Co-authored-by: Sebastian Humenda <sebastian.humenda@tu-dresden.de>
2017-09-13Add note for append method in OpenOptions docsGuillaume Gomez-0/+6
2017-09-13Add missing urls for OpenOptions docsGuillaume Gomez-5/+17
2017-09-13Move default stack min size to thread implementationsTobias Schaffner-25/+31
The default min stack size value is smaller on l4re and therefore this value has to be different depending on the platform.
2017-09-12Auto merge of #44344 - jonhoo:entry_or_default, r=BurntSushibors-0/+27
Add or_default to Entry APIs As argued for in #44324, this PR adds a new `or_default` method to the various `Entry` APIs (currently just for `BTreeMap` and `HashMap`) when `V: Default`. This method is effectively a shorthand for `or_insert_with(Default::default)`.
2017-09-12rustdoc: extend UdpSocket API doc (#657)Frank Rehberger-13/+41
rustdoc: type-fixes
2017-09-10Auto merge of #44220 - ↵bors-21/+43
kennytm:fix-44216-instance-plus-max-duration-should-panic, r=alexcrichton Properly detect overflow in Instance ± Duration. Fix #44216. Fix #42622 The computation `Instant::now() + Duration::from_secs(u64::max_value())` now panics. The call `receiver.recv_timeout(Duration::from_secs(u64::max_value()))`, which involves such time addition, will also panic. The reason #44216 arises is because of an unchecked cast from `u64` to `i64`, making the duration equivalent to -1 second. Note that the current implementation is over-conservative, since e.g. (-2⁶²) + (2⁶³) is perfectly fine for an `i64`, yet this is rejected because (2⁶³) overflows the `i64`.
2017-09-10Auto merge of #44474 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-1/+6
Rollup of 13 pull requests - Successful merges: #44262, #44329, #44332, #44347, #44372, #44384, #44387, #44396, #44449, #44451, #44457, #44464, #44467 - Failed merges:
2017-09-10Rollup merge of #44396 - joshlf:tls-comment, r=alexcrichtonGuillaume Gomez-0/+4
std::thread::LocalKey: Document limitation with initializers Document that if a `LocalKey`'s initializer recursively depends on itself, initialization will result in infinite recursion.
2017-09-10Rollup merge of #44384 - alexcrichton:osx-segfault, r=estebankGuillaume Gomez-1/+2
std: Fix a segfault on OSX with backtraces Apparently `dladdr` can succeed but still give you NULL pointers! Closes #44379
2017-09-10Use rvalue promotion to 'static instead of static items.Eduard-Mihai Burtescu-16/+4
2017-09-09Auto merge of #44251 - kennytm:osx-backtrace, r=alexcrichtonbors-21/+48
Add libbacktrace support for Apple platforms (resubmitted) Resubmitting #43422 rebased on the current master (cc @JohnColanduoni). I have added an additional commit to fallback to `dladdr`-based `resolve_symbol` if `libbacktrace` returns `None`, otherwise the stack trace will be full of `<unknown>` when you forget to pass the `-g` flag (actually it seems — at least on macOS — the `dladdr` symbol is more accurate than the `libbacktrace` one).
2017-09-09Auto merge of #44438 - Xaeroxe:clamp, r=Mark-Simulacrumbors-89/+0
Revert clamp Revert clamp per https://github.com/rust-lang/rust/issues/44095#issuecomment-328218316 while we take time to assess the potential backwards compatibility damage done by it.
2017-09-08Revert "Add clamp functions"Jacob Kiesel-40/+0
This reverts commit c589f867f89d4e6e48c6602aed8e878208d4822f.
2017-09-08Revert "Add NAN examples"Jacob Kiesel-2/+0
This reverts commit f74c5d2e18e50c24de2cc1192bf2088cdaa61916.
2017-09-08Revert "Fix f32 examples."Jacob Kiesel-4/+2
This reverts commit 61f20f8df02e53ee60dc1719ce0e502eecebf8b4.
2017-09-08Revert "Fix f64 examples"Jacob Kiesel-4/+2
This reverts commit 576426a05a1a6cb33eece7082d7341b7c6bb5277.
2017-09-08Revert "Fix documentation and formatting."Jacob Kiesel-8/+2
This reverts commit 2e34ff767113c6a15c5862b0646ca9ad7ffd81b1.
2017-09-08Revert "Add panic unit tests"Jacob Kiesel-37/+0
This reverts commit b762283e57ff71f6763effb9cfc7fc0c7967b6b0.
2017-09-08Move the stack size value for L4Re to the min_stack_size functionSebastian Humenda-4/+5
2017-09-08Re-enable networking module fo rL4ReSebastian Humenda-7/+450
As suggested in the discussion of PR #43972, std should provide a uniform API to all platforms. Since there's no networking on L4Re, this now is a module in `sys::net` providing types and functions/methods returning an error for each action.
2017-09-08Add modifications needed for L4re in libstdTobias Schaffner-10/+45
This commit adds the needed modifications to compile the std crate for the L4 Runtime environment (L4Re). A target for the L4Re was introduced in commit: c151220a84e40b65e45308cc0f3bbea4466d3acf In many aspects implementations for linux also apply for the L4Re microkernel. Two uncommon characteristics had to be resolved: * L4Re has no network funktionality * L4Re has a maximum stacksize of 1Mb for threads Co-authored-by: Sebastian Humenda <sebastian.humenda@tu-dresden.de>
2017-09-08Match c_char definitions and enable signal reset for L4ReSebastian Humenda-13/+19
* Match definition of c_char in os/raw.rs with the libc definition Due to historic reasons, os/raw.rs redefines types for c_char from libc, but these didn't match. Now they do :). * Enable signal reset on exec for L4Re L4Re has full signal emulation and hence it needs to reset the signal set of the child with sigemptyset. However, gid and uid should *not* be set.
2017-09-07std::thread::LocalKey: Document limitation with initializersJoshua Liebow-Feeser-0/+4
2017-09-07Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`Tobias Bucher-16/+9
2017-09-07Disable the 80-year-difference test on 32-bit-time_t platforms.kennytm-3/+6
2017-09-07Fix incorrect test in `time::tests::system_time_math`.kennytm-1/+1
2017-09-07Properly detect overflow in Instance +/- Duration.kennytm-17/+36
Avoid unchecked cast from `u64` to `i64`. Use `try_into()` for checked cast. (On Unix, cast to `time_t` instead of `i64`.)
2017-09-07Auto merge of #43931 - eddyb:const-local-key, r=alexcrichtonbors-3/+13
Make the LocalKey facade of thread_local! inlineable cross-crate. Fixes (almost*) #25088 by changing the `LocalKey` `static` `thread_local!` generates to a `const`. This can be done because a `LocalKey` value holds no actual TLS data, only function pointers to get at said data, and it could even be made `Copy` without any negative consequences. The recent stabilization of rvalue promotion to `'static` allows doing this without changing the API. r? @alexcrichton *almost because we can't yet inline `__getit` because it breaks on MSVC, see https://github.com/rust-lang/rust/pull/43931#issuecomment-323534214
2017-09-06std: Fix a segfault on OSX with backtracesAlex Crichton-1/+2
Apparently `dladdr` can succeed but still give you NULL pointers! Closes #44379
2017-09-06Rollup merge of #44315 - kallisti5:epoch-doc-example-squashed, r=GuillaumeGomezMark Simulacrum-0/+11
std/time: Give an example to get UNIX_EPOCH in seconds
2017-09-06Rollup merge of #44097 - Xaeroxe:clamp, r=burntsushiMark Simulacrum-0/+89
Add clamp functions Implementation of clamp feature: Tracking issue: https://github.com/rust-lang/rust/issues/44095 RFC: https://github.com/rust-lang/rfcs/pull/1961
2017-09-06Implement named threads on WindowsJoshua Sheard-7/+17
2017-09-05Avoid weird or_insert_with exampleJon Gjengset-3/+1
2017-09-05Add or_default to Entry APIsJon Gjengset-0/+29
2017-09-04Add panic unit testsJacob Kiesel-0/+37
2017-09-04std/time: Give an example to get UNIX_EPOCH in secondsAlexander von Gluck IV-0/+11
2017-09-04Make the LocalKey facade of thread_local! inlineable cross-crate.Eduard-Mihai Burtescu-3/+13
2017-09-02update gcc crateRalf Jung-1/+1
Use gcc::Build rather than deprecated gcc::Config. Fixes #43973
2017-09-02Fallback to dladdr-based resolve_symbol if backtrace failed.kennytm-14/+29
This programs compiled without -g on macOS still provide the resolve to actual symbols, instead of `<unknown>` everywhere.
2017-09-02Use env::current_exe for libbacktrace on macOSJohn Colanduoni-20/+7
2017-09-02Add libbacktrace support for Apple platformsJohn Colanduoni-7/+32