summary refs log tree commit diff
path: root/library/alloc/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2022-02-18Rollup merge of #93613 - crlf0710:rename_to_async_iter, r=yaahcMatthias Krüger-1/+1
Move `{core,std}::stream::Stream` to `{core,std}::async_iter::AsyncIterator` Following amendments in https://github.com/rust-lang/rfcs/pull/3208/. cc #79024 cc ``@yoshuawuyts`` ``@joshtriplett``
2022-02-12Stabilise inherent_ascii_escape (FCP in #77174)ltdk-1/+0
2022-02-09Stabilize cfg_target_has_atomicAmanieu d'Antras-1/+1
Closes #32976
2022-02-05Mark __rgl_oom and __rd_oom as "C-unwind"Amanieu d'Antras-0/+1
2022-02-03Move `{core,std}::stream::Stream` to `{core,std}::async_iter::AsyncIterator`.Charles Lew-1/+1
2022-01-28update cfg(bootstrap)sPietro Albini-12/+8
2022-01-11Partially stabilize `maybe_uninit_extra`Miguel Ojeda-1/+0
This covers: impl<T> MaybeUninit<T> { pub unsafe fn assume_init_read(&self) -> T { ... } pub unsafe fn assume_init_drop(&mut self) { ... } } It does not cover the const-ness of `write` under `const_maybe_uninit_write` nor the const-ness of `assume_init_read` (this commit adds `const_maybe_uninit_assume_init_read` for that). FCP: https://github.com/rust-lang/rust/issues/63567#issuecomment-958590287. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-01-04Fix a compile error when no_global_oom_handlingwoppopo-1/+1
2022-01-04Add tracking issues (`const_box`, `const_alloc_error`)woppopo-1/+2
2021-12-23Constify `Box<T, A>` methodswoppopo-0/+15
2021-12-15Rollup merge of #90521 - jhpratt:stabilize-destructuring_assignment, ↵Matthias Krüger-1/+1
r=jackh726,pnkfelix Stabilize `destructuring_assignment` Closes #71126 - [Stabilization report](https://github.com/rust-lang/rust/issues/71126#issuecomment-941148058) - [Completed FCP](https://github.com/rust-lang/rust/issues/71126#issuecomment-954914819) `@rustbot` label +F-destructuring-assignment +T-lang Also needs +relnotes but I don't have permission to add that tag.
2021-12-14Stabilize `destructuring_assignment`Jacob Pratt-1/+1
2021-12-14Stabilize iter::zip.PFPoitras-1/+0
2021-11-30Apply cfg-bootstrap switchMark Rousskov-1/+0
2021-11-15Stabilize format_args_captureJosh Triplett-1/+1
Works as expected, and there are widespread reports of success with it, as well as interest in it.
2021-11-15Give examples of format args capture in the fmt module documentationJosh Triplett-0/+1
2021-11-13Auto merge of #90542 - the8472:privatize-the-means-of-rawvec-production, ↵bors-1/+2
r=joshtriplett Make RawVec private to alloc RawVec was previously exposed for compiler-internal use (libarena specifically) in 1acbb0a9350560d951359cc359361b87992a6f2b Since it is unstable, doc-hidden and has no associated tracking issue it was never meant for public use. And since it is no longer used outside alloc itself it can be made private again. Also remove some functions that are dead due to lack of internal users.
2021-11-05Add feature to `alloc` so we can re-export.mbartlett21-0/+1
2021-11-03Make RawVec private to allocThe8472-1/+2
RawVec was previously exposed for compiler-internal use (libarena specifically) in 1acbb0a9350560d951359cc359361b87992a6f2b Since it is unstable, doc-hidden and has no associated tracking issue it was never meant for public use. And since it is no longer used outside alloc itself it can be made private again. Also remove some functions that are dead due to lack of internal users.
2021-10-31Rollup merge of #89951 - ojeda:stable-unwrap_unchecked, r=dtolnayMatthias Krüger-1/+0
Stabilize `option_result_unwrap_unchecked` Closes https://github.com/rust-lang/rust/issues/81383. Stabilization report: https://github.com/rust-lang/rust/issues/81383#issuecomment-944498212. ```@rustbot``` label +A-option-result +T-libs-api
2021-10-23update cfg(bootstrap)Pietro Albini-1/+1
2021-10-20Stabilize `option_result_unwrap_unchecked`Miguel Ojeda-1/+0
Closes https://github.com/rust-lang/rust/issues/81383. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2021-10-19Reenable feature(nll) in alloc.Mara Bos-0/+1
2021-10-19Remove unused language #![feature]s from alloc.Mara Bos-5/+0
2021-10-19Remove unused library #![feature]s from alloc.Mara Bos-3/+0
2021-10-19Sort and categorize #![feature]s in alloc.Mara Bos-42/+52
2021-10-15Remove alloc::preludeAmanieu d'Antras-1/+0
As per the libs team decision in #58935. Closes #58935
2021-10-14Fix missing remaining compiler specific cfg informationGuillaume Gomez-0/+1
2021-10-09Cfg hide no_global_oom_handling and no_fp_fmt_parseGary Guo-0/+1
2021-10-08Cfg hide more conditions for allocLoïc BRANSTETT-1/+6
2021-10-06Clean up code a bit:Guillaume Gomez-2/+3
* Remove "bool_to_options" feature * Update version for compiler feature * rustfmt
2021-10-05Suppress some cfg from being shown in the stdlib docsWim Looman-1/+6
2021-09-30implement advance_(back_)_by on more iteratorsThe8472-0/+1
2021-09-08Bump stage0 compiler to 1.56Mark Rousskov-3/+0
2021-08-17Constified `Default` implementationsDeadbeef-0/+1
The libs-api team agrees to allow const_trait_impl to appear in the standard library as long as stable code cannot be broken (they are properly gated) this means if the compiler teams thinks it's okay, then it's okay. My priority on constifying would be: 1. Non-generic impls (e.g. Default) or generic impls with no bounds 2. Generic functions with bounds (that use const impls) 3. Generic impls with bounds 4. Impls for traits with associated types For people opening constification PRs: please cc me and/or oli-obk.
2021-07-28Rollup merge of #87501 - spastorino:remove-min-tait, r=oli-obkYuki Okushi-1/+2
Remove min_type_alias_impl_trait in favor of type_alias_impl_trait r? ``@oli-obk``
2021-07-27Use type_alias_impl_trait instead of min in compiler and libSantiago Pastorino-1/+2
2021-07-27Auto merge of #85305 - MarcusDunn:master, r=pnkfelixbors-1/+1
Stabilize bindings_after_at attempting to stabilze bindings_after_at [#65490](https://github.com/rust-lang/rust/issues/65490), im pretty new to the whole thing so any pointers are greatly appreciated.
2021-07-18better support for running libcore and liballoc tests with MiriRalf Jung-0/+4
2021-06-28Update to new bootstrap compilerMark Rousskov-2/+1
2021-06-14Stabilize `maybe_uninit_ref`Yuki Okushi-1/+0
2021-06-04rustdoc: link to stable/beta docs consistently in documentationJoshua Nelson-1/+0
## User-facing changes - Intra-doc links to primitives that currently go to rust-lang.org/nightly/std/primitive.x.html will start going to channel that rustdoc was built with. Nightly will continue going to /nightly; Beta will link to /beta; stable compilers will link to /1.52.1 (or whatever version they were built as). - Cross-crate links from std to core currently go to /nightly unconditionally. They will start going to /1.52.0 on stable channels (but remain the same on nightly channels). - Intra-crate links from std to std (or core to core) currently go to the same URL they are hosted at; they will continue to do so. Notably, this is different from everything else because it can preserve the distinction between /stable and /1.52.0 by using relative links. Note that "links" includes both intra-doc links and rustdoc's own automatically generated hyperlinks. ## Implementation changes - Update the testsuite to allow linking to /beta and /1.52.1 in docs - Use an html_root_url for the standard library that's dependent on the channel This avoids linking to nightly docs on stable. - Update rustdoc to use channel-dependent links for primitives from an unknown crate - Set DOC_RUST_LANG_ORG_CHANNEL from bootstrap to ensure it's in sync - Include doc.rust-lang.org in the channel
2021-06-04added back bindings_after_at as a cfg_attrmarcusdunn-0/+1
2021-06-04removed ref to bindings_after_atmarcusdunn-1/+0
2021-05-29Add `String::extend_from_within`Waffle-0/+1
This patch adds `String::extend_from_within` function under the `string_extend_from_within` feature gate similar to the `Vec::extend_from_within` function.
2021-05-24remove cfg(bootstrap)Pietro Albini-3/+1
2021-05-09PR feedbackScott McMurray-2/+2
2021-05-06Perf Experiment: Wait, what if I just skip the trait aliasScott McMurray-1/+1
2021-05-06Bootstrapping preparation for the libraryScott McMurray-0/+1
Since just `ops::Try` will need to change meaning.
2021-05-05alloc: Add unstable Cfg feature `no-global_oom_handling`John Ericson-2/+2
For certain sorts of systems, programming, it's deemed essential that all allocation failures be explicitly handled where they occur. For example, see Linus Torvald's opinion in [1]. Merely not calling global panic handlers, or always `try_reserving` first (for vectors), is not deemed good enough, because the mere presence of the global OOM handlers is burdens static analysis. One option for these projects to use rust would just be to skip `alloc`, rolling their own allocation abstractions. But this would, in my opinion be a real shame. `alloc` has a few `try_*` methods already, and we could easily have more. Features like custom allocator support also demonstrate and existing to support diverse use-cases with the same abstractions. A natural way to add such a feature flag would a Cargo feature, but there are currently uncertainties around how std library crate's Cargo features may or not be stable, so to avoid any risk of stabilizing by mistake we are going with a more low-level "raw cfg" token, which cannot be interacted with via Cargo alone. Note also that since there is no notion of "default cfg tokens" outside of Cargo features, we have to invert the condition from `global_oom_handling` to to `not(no_global_oom_handling)`. This breaks the monotonicity that would be important for a Cargo feature (i.e. turning on more features should never break compatibility), but it doesn't matter for raw cfg tokens which are not intended to be "constraint solved" by Cargo or anything else. To support this use-case we create a new feature, "global-oom-handling", on by default, and put the global OOM handler infra and everything else it that depends on it behind it. By default, nothing is changed, but users concerned about global handling can make sure it is disabled, and be confident that all OOM handling is local and explicit. For this first iteration, non-flat collections are outright disabled. `Vec` and `String` don't yet have `try_*` allocation methods, but are kept anyways since they can be oom-safely created "from parts", and we hope to add those `try_` methods in the future. [1]: https://lore.kernel.org/lkml/CAHk-=wh_sNLoz84AUUzuqXEsYH35u=8HV3vK-jbRbJ_B-JjGrg@mail.gmail.com/