about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-08-15std: Add issues to all unstable featuresAlex Crichton-222/+270
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-2/+0
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389
2015-08-14Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrcbors-3/+3
This PR implements the majority of RFC 1214. In particular, it implements: - the new outlives relation - comprehensive WF checking For the most part, new code receives warnings, not errors, though 3 regressions were found via a crater run. There are some deviations from RFC 1214. Most notably: - we still consider implied bounds from fn ret; this intersects other soundness issues that I intend to address in detail in a follow-up RFC. Fixing this without breaking a lot of code probably requires rewriting compare-method somewhat (which is probably a good thing). - object types do not check trait bounds for fear of encountering `Self`; this was left as an unresolved question in RFC 1214, but ultimately feels inconsistent. Both of those two issues are highlighted in the tracking issue, https://github.com/rust-lang/rust/issues/27579. #27579 also includes a testing matrix with new tests that I wrote -- these probably duplicate some existing tests, I tried to check but wasn't quite sure what to look for. I tried to be thorough in testing the WF relation, at least, but would welcome suggestions for missing tests. r? @nrc (or perhaps someone else?)
2015-08-14Auto merge of #27822 - arielb1:inline-round-take-2, r=Gankrobors-0/+1
This speeds up rustc on #25916 from 1.36±0.022s to 1.326±0.025s Tests pass locally (even on 32-bit :-) r? @Gankro
2015-08-13Auto merge of #27684 - alexcrichton:remove-deprecated, r=aturonbors-959/+46
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-13Mark round_up_to_next as inline arielb1-0/+1
This speeds up rustc on #25916 from 1.36±0.022s to 1.326±0.025s Tests pass locally (even on 32-bit :-)
2015-08-13Auto merge of #27693 - nagisa:remutex-docs, r=alexcrichtonbors-3/+10
Initial version of PR had an DerefMut implementation, which was later removed because it may cause mutable reference aliasing. Suggest how to implement mutability with reentrant mutex and remove the claim we implement DerefMut.
2015-08-12Fallout in libs -- misc missing bounds uncovered by WF checks.Niko Matsakis-3/+3
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-959/+46
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-12Fix ReentrantMutex documentation wrt DerefMutSimonas Kazlauskas-3/+10
Initial version of PR had an DerefMut implementation, which was later removed because it may cause mutable reference aliasing. Suggest how to implement mutability with reentrant mutex and remove the claim we implement DerefMut.
2015-08-11rollup merge of #27679: durka/patch-5Alex Crichton-4/+4
I'm not 100% sure lines 63 and 73 are typos.
2015-08-11rollup merge of #27678: alexcrichton/snapshotsAlex Crichton-186/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-11rollup merge of #27676: alexcrichton/msvc-unwindAlex Crichton-5/+5
This commit leverages the runtime support for DWARF exception info added in #27210 to enable unwinding by default on 64-bit MSVC. This also additionally adds a few minor fixes here and there in the test harness and such to get `make check` entirely passing on 64-bit MSVC: * The invocation of `maketest.py` now works with spaces/quotes in CC * debuginfo tests are disabled on MSVC * A link error for librustc was hacked around (see #27438)
2015-08-11rollup merge of #27674: zaeleus/ios-importsAlex Crichton-3/+5
See https://github.com/rust-lang/rust/issues/27590#issuecomment-128885975.
2015-08-11rollup merge of #27663: tbu-/pr_remove_fixmeAlex Crichton-1/+0
2015-08-11rollup merge of #27622: eefriedman/https-urlAlex Crichton-3/+3
Also fixes a few outdated links.
2015-08-11rollup merge of #27615: GuillaumeGomez/send_syncAlex Crichton-0/+14
Part of #22709. cc @Veedrac r? @bluss
2015-08-12Auto merge of #27615 - GuillaumeGomez:send_sync, r=huonwbors-0/+14
Part of #22709. cc @Veedrac r? @bluss
2015-08-11correct copy/paste typos in stdio.rs commentsAlex Burka-4/+4
I'm not 100% sure lines 63 and 73 are typos.
2015-08-11trans: Re-enable unwinding on 64-bit MSVCAlex Crichton-5/+5
This commit leverages the runtime support for DWARF exception info added in #27210 to enable unwinding by default on 64-bit MSVC. This also additionally adds a few minor fixes here and there in the test harness and such to get `make check` entirely passing on 64-bit MSVC: * The invocation of `maketest.py` now works with spaces/quotes in CC * debuginfo tests are disabled on MSVC * A link error for librustc was hacked around (see #27438)
2015-08-11Register new snapshotsAlex Crichton-186/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-11std: Fix imports for ios targetMichael Macias-3/+5
2015-08-11Add HashSet and HashMap testsGuillaume Gomez-25/+15
2015-08-11Remove unneeded FIXMETobias Bucher-1/+0
2015-08-11Rollup merge of #27651 - tshepang:patch-8, r=GankroManish Goregaokar-1/+1
2015-08-11Rollup merge of #27648 - tshepang:patch-7, r=brsonManish Goregaokar-2/+2
2015-08-11Rollup merge of #27633 - tshepang:patch-6, r=alexcrichtonManish Goregaokar-1/+1
2015-08-11Rollup merge of #27577 - diaphore:trailing-newline-formatmessagew, ↵Manish Goregaokar-3/+7
r=alexcrichton `FormatMessageW` always inserts trailing `\r\n` to system messages which is a minor annoyance when they're fed to `Debug` but can break formatting with `Display`. ```rust fn main() { use std::env; if let Err(err) = env::set_current_dir("???") { println!("{:#?}\n{}", err, err); } } ``` ```_ Error { repr: Os { code: 2, message: "The system cannot find the file specified.\r\n" } } The system cannot find the file specified. (os error 2) ```
2015-08-11Auto merge of #27549 - tshepang:clarity, r=alexcrichtonbors-1/+1
2015-08-11Auto merge of #26818 - sfackler:duration-stabilization, r=aturonbors-60/+49
This commit stabilizes the `std::time` module and the `Duration` type. `Duration::span` remains unstable, and the `Display` implementation for `Duration` has been removed as it is still being reworked and all trait implementations for stable types are de facto stable. This is a [breaking-change] to those using `Duration`'s `Display` implementation. I'm opening this PR as a platform for discussion - there may be some method renaming to do as part of the stabilization process.
2015-08-10Fix doc testSteven Fackler-1/+0
2015-08-10Add back and deprecate old methods.Steven Fackler-0/+17
2015-08-10Stabilize the Duration APISteven Fackler-59/+32
This commit stabilizes the `std::time` module and the `Duration` type. `Duration::span` remains unstable, and the `Display` implementation for `Duration` has been removed as it is still being reworked and all trait implementations for stable types are de facto stable. This is a [breaking-change] to those using `Duration`'s `Display` implementation.
2015-08-10Auto merge of #27338 - alexcrichton:remove-morestack, r=brsonbors-509/+88
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow) r? @brson
2015-08-10Remove morestack supportAlex Crichton-509/+88
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-08-11doc: remove an unneeded distinctionTshepang Lekhonkhobe-1/+1
2015-08-10Auto merge of #27531 - bluss:io-copy-dst, r=alexcrichtonbors-2/+14
std: Allow ?Sized parameters in std::io::copy
2015-08-10doc: success is implied reallyTshepang Lekhonkhobe-2/+2
2015-08-10Add Send/Sync traits on Iter struct in hash/tableGuillaume Gomez-1/+25
2015-08-10Auto merge of #27252 - tbu-:pr_less_transmutes, r=alexcrichtonbors-18/+20
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`. This builds upon #27233.
2015-08-10Auto merge of #27516 - alexcrichton:osx-flaky-zomg, r=brsonbors-0/+4
The investigation into #14232 discovered that it's possible that signal delivery to a newly spawned process is racy on OSX. This test has been failing spuriously on the OSX bots for some time now, so ignore it as we don't currently know a solution and it looks like it may be out of our control.
2015-08-10std: Allow ?Sized parameters in std::io::copyUlrik Sverdrup-2/+14
std::io::copy did not allow passing trait objects directly (only with an extra &mut wrapping).
2015-08-10Revert "Mark round_up_to_next as inline"Tim Neumann-1/+0
This reverts commit febdc3b201bcce1546c88e3be1b956d3f90d3059.
2015-08-10doc: add missing symbolTshepang Lekhonkhobe-1/+1
2015-08-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-3/+3
Also fixes a few outdated links.
2015-08-09Make `str::as_bytes_mut` privateTobias Bucher-3/+3
2015-08-09Make `slice::transmute*` privateTobias Bucher-2/+1
2015-08-09Replace many uses of `mem::transmute` with more specific functionsTobias Bucher-20/+23
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`.
2015-08-09Mark round_up_to_next as inlineAriel Ben-Yehuda-0/+1
This speeds up rustc on #25916 from 1.36Â0.022s to 1.326Â0.025s
2015-08-07Trim trailing newline from FormatMessageWdiaphore-3/+7