about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2018-06-11Mark as permanently-unstable some implementation detailsSimon Sapin-2/+2
2018-06-11Stablize the alloc module without changing stability of its contents.Simon Sapin-6/+13
2018-06-11Document memory allocation APIsSimon Sapin-1/+1
Add some docs where they were missing, attempt to fix them where they were out of date.
2018-06-11Remove the deprecated Heap type/constSimon Sapin-1/+0
2018-06-11Remove deprecated heap modulesSimon Sapin-9/+2
The heap.rs file was already unused.
2018-06-11Replace `impl GlobalAlloc for Global` with a set of free functionsMike Hommey-0/+1
2018-06-11Remove alloc::Opaque and use *mut u8 as pointer type for GlobalAllocMike Hommey-6/+6
2018-06-11Add #[doc(inline)] in std::taskCrLF0710-0/+2
Add #[doc(inline)] in `std::task` to make the doc seem right.
2018-06-10Stabilize entry-or-defaultGuillaume Gomez-3/+1
2018-06-09Auto merge of #51359 - cramertj:fdio_spawn, r=sfacklerbors-110/+51
[fuchsia] Migrate from launchpad to fdio_spawn_etc fdio_spawn_etc is the preferred way of creating processes on Fuchsia now. cc @abarth
2018-06-07[fuchsia] Migrate from launchpad to fdio_spawn_etcAdam Barth-110/+51
fdio_spawn_etc is the preferred way of creating processes on Fuchsia now.
2018-06-06Auto merge of #51263 - cramertj:futures-in-core, r=aturonbors-0/+16
Add Future and task system to the standard library This adds preliminary versions of the `std::future` and `std::task` modules in order to unblock development of async/await (https://github.com/rust-lang/rust/issues/50547). These shouldn't be considered as final forms of these libraries-- design questions about the libraries should be left on https://github.com/rust-lang/rfcs/pull/2418. Once that RFC (or a successor) is merged, these APIs will be adjusted as necessary. r? @aturon
2018-06-06Add Future and task system to the standard libraryTaylor Cramer-0/+16
2018-06-05Rollup merge of #51255 - avdv:patch-1, r=kennytmMark Simulacrum-2/+2
Fix confusing error message for sub_instant When subtracting an Instant from another, the function will panick when `RHS > self`, but the error message confusingly displays a different error: ```rust let i = Instant::now(); let other = Instant::now(); if other > i { println!("{:?}", i - other); } ``` This results in a panic: ``` thread 'test_instant' panicked at 'other was less than the current instant', libstd/sys/unix/time.rs:292:17 ``` But clearly, `other` was actually greater than the current instant.
2018-06-05Auto merge of #51140 - GuillaumeGomez:doc-keyword, r=QuietMisdreavusbors-0/+1
rustdoc: introduce the #[doc(keyword="")] attribute for documenting keywords Part of #34601. r? @QuietMisdreavus
2018-06-04Optimize layout calculations in HashMapAmanieu d'Antras-3/+16
This now produces the same assembly code as the previous implementation.
2018-06-04Put doc keyword behind feature flagGuillaume Gomez-0/+1
2018-06-04Clarify error phrase in `sub_instant` functionClaudio Bley-2/+2
Uses the same wording as [`src/libstd/sys/windows/time.rs`][1]. 1: https://github.com/avdv/rust/blob/95e2bf253d864c5e14ad000ffa2040ce85916056/src/libstd/sys/windows/time.rs#L65
2018-06-03remove #[unwind(allowed)]Jorge Aparicio-1/+0
not required because this is a Rust function
2018-06-03undo payload in core::panic! changesJorge Aparicio-79/+30
2018-06-03format payload if possible instead of returning "Box<Any>"Jorge Aparicio-4/+11
2018-06-03implement #[panic_implementation]Jorge Aparicio-3/+96
2018-06-02Add a couple lines describing differences between into_mut/get_mut.Corey Farwell-0/+9
2018-06-02Fixed typoPhlosioneer-1/+1
2018-06-02Clarify the difference between get_mut and into_mut for OccupiedEntryPhlosioneer-2/+6
The examples for both hash_map::OccupiedEntry::get_mut and hash_map::OccupiedEntry::into_mut were almost identical. This led to some confusion over the difference, namely why you would ever use get_mut when into_mut gives alonger lifetime. Reddit thread: https://www.reddit.com/r/rust/comments/8a5swr/why_does_hashmaps This commit adds two lines and a comment to the example, to show that the entry object can be re-used after calling get_mut.
2018-06-02Auto merge of #51270 - nicokoch:issue-51266, r=TimNNbors-5/+12
fs: copy: Add EPERM to fallback error conditions Fixes #51266
2018-06-01Rollup merge of #51272 - steveklabnik:remove_feature_flag, r=QuietMisdreavusMark Simulacrum-2/+0
Remove feature flag from fs::read_to_string example This is stable, and so no longer needed
2018-06-01Simplify HashMap layout calculation by using LayoutAmanieu d'Antras-107/+13
2018-06-01Auto merge of #51264 - glandium:oom, r=alexcrichtonbors-10/+12
Make the OOM hook return `()` rather than `!` Per discussion in https://github.com/rust-lang/rust/issues/51245#issuecomment-393651083 This allows more flexibility in what can be done with the API. This also splits `rtabort!` into `dumb_print` happening in the default hook and `abort_internal`, happening in the actual oom handler after calling the hook. Registering an empty function thus makes the oom handler not print anything but still abort. Cc: @alexcrichton
2018-06-01Remove feature flag from fs::read_to_string examplesteveklabnik-2/+0
This is stable, and so no longer needed
2018-06-01fs: copy: Add EPERM to fallback error conditionsNicolas Koch-5/+12
Fixes #51266
2018-06-01Make the OOM hook return `()` rather than `!`Mike Hommey-10/+12
Per discussion in https://github.com/rust-lang/rust/issues/51245#issuecomment-393651083 This allows more flexibility in what can be done with the API. This also splits `rtabort!` into `dumb_print` happening in the default hook and `abort_internal`, happening in the actual oom handler after calling the hook. Registering an empty function thus makes the oom handler not print anything but still abort. Cc: @alexcrichton
2018-05-31Rollup merge of #51213 - nicokoch:copy_permissions, r=cramertjGuillaume Gomez-5/+5
fs: copy: Use File::set_permissions instead of fs::set_permissions We already got the open file descriptor at this point. Don't make the kernel resolve the path again.
2018-05-31Fix confusing error message for sub_instantClaudio Bley-1/+1
When subtracting an Instant from another, the function will panick when `RHS > self`, but the error message confusingly displays a different error: ```rust let i = Instant::now(); let other = Instant::now(); if other > i { println!("{:?}", i - other); } ``` This results in a panic: ``` thread 'test_instant' panicked at 'other was less than the current instant', libstd/sys/unix/time.rs:292:17 ```
2018-05-31libstd/sys/unix/fs.rs: fix compilation on fuchsiaGuillaume Girol-1/+1
2018-05-30std::fs::DirEntry.metadata(): use fstatat instead of lstat when possibleGuillaume Girol-11/+32
2018-05-30Auto merge of #50955 - steveklabnik:update-libbacktrace, r=alexcrichtonbors-23/+53
Update libbacktrace We haven't updated libbacktrace in two years. This is just blindly updating to the latest HEAD; I'd like to see what travis says. It at least builds on my machine, running some tests... This perpetuates the patches from https://github.com/rust-lang/rust/pull/30908
2018-05-30Replace libbacktrace with a submoduleAlex Crichton-23/+53
While we're at it update the `backtrace` crate from crates.io. It turns out that the submodule's configure script has gotten a lot more finnicky as of late so also switch over to using the `cc` crate manually which allows to avoid some hacks around the configure script as well
2018-05-30Auto merge of #50880 - glandium:oom, r=SimonSapinbors-24/+108
OOM handling changes As discussed in https://github.com/rust-lang/rust/issues/49668#issuecomment-384893456 and subsequent. This does have codegen implications. Even without the hooks, and with a handler that ignores the arguments, the compiler doesn't eliminate calling `rust_oom` with the `Layout`. Even if it managed to eliminate that, with the hooks, I don't know if the compiler would be able to figure out it can skip it if the hook is never set. A couple implementation notes: - I went with explicit enums rather than bools because it makes it clearer in callers what is being requested. - I didn't know what `feature` to put the hook setting functions behind. (and surprisingly, the compile went through without any annotation on the functions) - There's probably some bikeshedding to do on the naming. Cc: @Simonsapin, @sfackler
2018-05-30Remobve unused importNicolas Koch-1/+1
2018-05-30fs: copy: Use File::set_permissions instead of fs::set_permissionsNicolas Koch-4/+4
We already got the open file descriptor at this point. Don't make the kernel resolve the path again.
2018-05-30Add hooks allowing to override the `oom` behaviorMike Hommey-2/+46
2018-05-29Auto merge of #50772 - nicokoch:fastcopy, r=alexcrichtonbors-0/+88
fs: copy: use copy_file_range on Linux Linux 4.5 introduced a new system call [copy_file_range](http://man7.org/linux/man-pages/man2/copy_file_range.2.html) to copy data from one file to another. This PR uses the new system call (if available). This has several advantages: 1. No need to constantly copy data from userspace to kernel space, if the buffer is small or the file is large 2. On some filesystems, like BTRFS, the kernel can leverage internal fs mechanisms for huge performance gains 3. Filesystems on the network dont need to copy data between the host and the client machine (they have to in the current read/write implementation) I have created a small library that also implements the new system call for some huge performance gains here: https://github.com/nicokoch/fastcopy Benchmark results are in the README
2018-05-29Fix additional nits:Nicolas Koch-7/+3
- compute bytes_to_copy more elegantly - add assert that written is 0 in fallback case
2018-05-30Pass a `Layout` to `oom`Mike Hommey-23/+63
As discussed in https://github.com/rust-lang/rust/issues/49668#issuecomment-384893456 and subsequent, there are use-cases where the OOM handler needs to know the size of the allocation that failed. The alignment might also be a cause for allocation failure, so providing it as well can be useful.
2018-05-28Stabilize SystemTime::UNIX_EPOCHThayne McCombs-2/+1
2018-05-28Use FIXME instead of TODO; Move bytes_to_copy calculation inside ifNicolas Koch-6/+7
branch
2018-05-26Rollup merge of #51056 - tbu-:pr_once_new, r=dtolnaykennytm-11/+12
Mention and use `Once::new` instead of `ONCE_INIT`
2018-05-26Rollup merge of #51014 - GuillaumeGomez:env_docs, r=QuietMisdreavuskennytm-2/+15
Add documentation about env! second argument Fixes #48044. r? @QuietMisdreavus
2018-05-24Add documentation about env! second argumentGuillaume Gomez-2/+15