about summary refs log tree commit diff
path: root/library/alloc/src
AgeCommit message (Collapse)AuthorLines
2024-09-15stabilize const_mut_refsRalf Jung-1/+1
2024-09-15Rollup merge of #130061 - theemathas:box_vec_non_null, ↵Stuart Cook-16/+531
r=MarkSimulacrum,workingjubilee Add `NonNull` convenience methods to `Box` and `Vec` Implements the ACP: https://github.com/rust-lang/libs-team/issues/418. The docs for the added methods are mostly copied from the existing methods that use raw pointers instead of `NonNull`. I'm new to this "contributing to rustc" thing, so I'm sorry if I did something wrong. In particular, I don't know what the process is for creating a new unstable feature. Please advise me if I should do something. Thank you.
2024-09-15Add tracking issue number for `box_vec_non_null`Tim (Theemathas) Chirananthavat-8/+8
2024-09-13Update tests for hidden references to mutable staticObei Sideg-0/+6
2024-09-13Rollup merge of #130245 - RalfJung:miri-alloc-backtrace, r=AmanieuStuart Cook-0/+14
make basic allocation functions track_caller in Miri for nicer backtraces This matches what we did with basic pointer and atomic operations.
2024-09-12Rollup merge of #130101 - RalfJung:const-cleanup, r=fee1-deadMatthias Krüger-19/+6
some const cleanup: remove unnecessary attributes, add const-hack indications I learned that we use `FIXME(const-hack)` on top of the "const-hack" label. That seems much better since it marks the right place in the code and moves around with the code. So I went through the PRs with that label and added appropriate FIXMEs in the code. IMO this means we can then remove the label -- Cc ``@rust-lang/wg-const-eval.`` I also noticed some const stability attributes that don't do anything useful, and removed them. r? ``@fee1-dead``
2024-09-11make basic allocation functions track_caller in Miri for nicer backtracesRalf Jung-0/+14
2024-09-10Auto merge of #130025 - Urgau:missing_docs-expect, r=petrochenkovbors-0/+3
Also emit `missing_docs` lint with `--test` to fulfil expectations This PR removes the "test harness" suppression of the `missing_docs` lint to be able to fulfil `#[expect]` (expectations) as it is now "relevant". I think the goal was to maybe avoid false-positive while linting on public items under `#[cfg(test)]` but with effective visibility we should no longer have any false-positive. Another possibility would be to query the lint level and only emit the lint if it's of expect level, but that is even more hacky. Fixes https://github.com/rust-lang/rust/issues/130021 try-job: x86_64-gnu-aux
2024-09-09Add missing `#[allow(missing_docs)]` on hack functions in allocUrgau-0/+3
2024-09-08add FIXME(const-hack)Ralf Jung-19/+6
2024-09-08Remove needless returns detected by clippy in librariesEduardo Sánchez Muñoz-7/+7
2024-09-07Auto merge of #129941 - BoxyUwU:bump-boostrap, r=albertlarsan68bors-21/+17
Bump boostrap compiler to new beta Accidentally left some comments on the update cfgs commit directly xd
2024-09-07Add `NonNull` convenience methods to `Vec`Tim (Theemathas) Chirananthavat-16/+308
2024-09-07Add `NonNull` convenience methods to `Box`Tim (Theemathas) Chirananthavat-0/+223
2024-09-06Remove duplicate implMatthew Giordano-88/+6
2024-09-06remove the Clone requirementMatthew Giordano-173/+170
2024-09-05update cfgsBoxy-4/+0
2024-09-05Rollup merge of #101339 - the8472:ci-randomize-debug, r=Mark-SimulacrumMatthias Krüger-1/+1
enable -Zrandomize-layout in debug CI builds This builds rustc/libs/tools with `-Zrandomize-layout` on *-debug CI runners. Only a handful of tests and asserts break with that enabled, which is promising. One test was fixable, the rest is dealt with by disabling them through new cargo features or compiletest directives. The config.toml flag `rust.randomize-layout` defaults to false, so it has to be explicitly enabled for now.
2024-09-03replace placeholder versionBoxy-17/+17
2024-09-02Rollup merge of #129748 - RalfJung:box-validity, r=workingjubileeMatthias Krüger-15/+13
Box validity: update for new zero-sized rules Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/529 Cc `@joshlf` `@rust-lang/opsem`
2024-09-02Auto merge of #129873 - matthiaskrgr:rollup-bv849ud, r=matthiaskrgrbors-4/+4
Rollup of 9 pull requests Successful merges: - #127474 (doc: Make block of inline Deref methods foldable) - #129678 (Deny imports of `rustc_type_ir::inherent` outside of type ir + new trait solver) - #129738 (`rustc_mir_transform` cleanups) - #129793 (add extra linebreaks so rustdoc can identify the first sentence) - #129804 (Fixed some typos in the standard library documentation/comments) - #129837 (Actually parse stdout json, instead of using hacky contains logic.) - #129842 (Fix LLVM ABI NAME for riscv64imac-unknown-nuttx-elf) - #129843 (Mark myself as on vacation for triagebot) - #129858 (Replace walk with visit so we dont skip outermost expr kind in def collector) Failed merges: - #129777 (Add `unreachable_pub`, round 4) - #129868 (Remove kobzol vacation status) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-02Rollup merge of #129804 - ranger-ross:fixed-documentation-typos, r=NoratriebMatthias Krüger-4/+4
Fixed some typos in the standard library documentation/comments I spent some time to fix a few typos in `library/std` and `library/core`
2024-09-02Auto merge of #129063 - the8472:cold-opt-size, r=Amanieubors-0/+7
Apply size optimizations to panic machinery and some cold functions * std dependencies gimli and addr2line are now built with opt-level=s * various panic-related methods and `#[cold]` methods are now marked `#[optimize(size)]` Panics should be cold enough that it doesn't make sense to optimize them for speed. The only tradeoff here is if someone does a lot of backtrace captures (without panics) and printing then the opt-level change might impact their perf. Seems to be the first use of the optimize attribute. Tracking issue #54882
2024-09-01tweak wording regarding Box validityRalf Jung-2/+3
2024-08-31when -Zrandomize-layout is enabled disable alloc test testing internal ↵The 8472-1/+1
struct sizes
2024-08-31Fix `elided_named_lifetimes` in codePavel Grigorenko-1/+1
2024-08-31Fixed typos in btree map docsranger-ross-4/+4
2024-08-29add new_cyclic_in for ArcMatthew Giordano-0/+93
2024-08-29improve commentsMatthew Giordano-1/+2
2024-08-29fix new_cyclic_in for rcMatthew Giordano-48/+79
2024-08-29fix fmtMatthew Giordano-10/+2
2024-08-29Box validity: update for new zero-sized rulesRalf Jung-15/+12
2024-08-28Rollup merge of #129673 - matthewpipie:arc-weak-debug-trait, r=dtolnayJubilee-1/+1
Add fmt::Debug to sync::Weak<T, A> Currently, `sync::Weak<T>` implements `Debug`, but `sync::Weak<T, A>` does not. This appears to be an oversight, as `rc::Weak<T, A>` implements `Debug`. (Note: `sync::Weak` is the weak for `Arc`, and `rc::Weak` is the weak for `Rc`.) This PR adds the Debug trait for `sync::Weak<T, A>`. The issue was initially brought up here: https://github.com/rust-lang/wg-allocators/issues/131
2024-08-27add new_cyclic_in for rcMatthew Giordano-2/+58
2024-08-27Add fmt::Debug to sync::Weak<T, A>Matthew Giordano-1/+1
2024-08-27library: Stabilize new_uninit for Box, Rc, and ArcJubilee Young-64/+32
A partial stabilization that only affects: - AllocType<T>::new_uninit - AllocType<T>::assume_init - AllocType<[T]>::new_uninit_slice - AllocType<[T]>::assume_init where "AllocType" is Box, Rc, or Arc
2024-08-25Rollup merge of #129416 - workingjubilee:partial-move-from-stabilization, ↵Matthias Krüger-9/+16
r=dtolnay library: Move unstable API of new_uninit to new features - `new_zeroed` variants move to `new_zeroed_alloc` - the `write` fn moves to `box_uninit_write` The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
2024-08-25Rollup merge of #129091 - RalfJung:box_as_ptr, r=AmanieuMatthias Krüger-2/+90
add Box::as_ptr and Box::as_mut_ptr methods Unstably implements https://github.com/rust-lang/libs-team/issues/355. Tracking issue: https://github.com/rust-lang/rust/issues/129090. r? libs-api
2024-08-23library: Move unstable API of new_uninit to new featuresJubilee Young-9/+16
- `new_zeroed` variants move to `new_zeroed_alloc` - the `write` fn moves to `box_uninit_write` The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
2024-08-22Implement feature `string_from_utf8_lossy_owned`okaneco-0/+74
Implement feature for lossily converting from `Vec<u8>` to `String` - Add `String::from_utf8_lossy_owned` - Add `FromUtf8Error::into_utf8_lossy`
2024-08-19Stabilize `iter::repeat_n`Scott McMurray-1/+0
2024-08-19docs: Mention `spare_capacity_mut()` in `Vec::set_len`Jan Ferdinand Sauer-1/+6
2024-08-14apply #[optimize(size)] to #[cold] ones and part of the panick machineryThe 8472-0/+7
2024-08-14add Box::as_ptr and Box::as_mut_ptr methodsRalf Jung-2/+90
2024-08-14Rollup merge of #128759 - notriddle:notriddle/spec-to-string, ↵Matthias Krüger-7/+47
r=workingjubilee,compiler-errors alloc: add ToString specialization for `&&str` Fixes #128690
2024-08-12std::fmt::FormatterFn -> std::fmt::FromFnschvv31n-1/+1
2024-08-12Auto merge of #126793 - saethlin:mono-rawvec, r=scottmcmbors-212/+384
Apply "polymorphization at home" to RawVec The idea here is to move all the logic in RawVec into functions with explicit size and alignment parameters. This should eliminate all the fussing about how tweaking RawVec code produces large swings in compile times. This uncovered https://github.com/rust-lang/rust-clippy/issues/12979, so I've modified the relevant test in a way that tries to preserve the spirit of the test without tripping the ICE.
2024-08-10Auto merge of #128927 - GuillaumeGomez:rollup-ei2lr0f, r=GuillaumeGomezbors-40/+56
Rollup of 8 pull requests Successful merges: - #128273 (Improve `Ord` violation help) - #128807 (run-make: explaing why fmt-write-bloat is ignore-windows) - #128903 (rustdoc-json-types `Discriminant`: fix typo) - #128905 (gitignore: Add Zed and Helix editors) - #128908 (diagnostics: do not warn when a lifetime bound infers itself) - #128909 (Fix dump-ice-to-disk for RUSTC_ICE=0 users) - #128910 (Differentiate between methods and associated functions in diagnostics) - #128923 ([rustdoc] Stop showing impl items for negative impls) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-10Rollup merge of #128273 - Voultapher:improve-ord-violation-help, ↵Guillaume Gomez-40/+56
r=workingjubilee Improve `Ord` violation help Recent experience in #128083 showed that the panic message when an Ord violation is detected by the new sort implementations can be confusing. So this PR aims to improve it, together with minor bug fixes in the doc comments for sort*, sort_unstable* and select_nth_unstable*. Is it possible to get these changes into the 1.81 release? It doesn't change behavior and would greatly help when users encounter this panic for the first time, which they may after upgrading to 1.81. Tagging `@orlp`
2024-08-10Stabilize `min_exhaustive_patterns`Nadrieril-0/+2