about summary refs log tree commit diff
path: root/library/core
AgeCommit message (Collapse)AuthorLines
2024-01-10implement TrustedRandomAccess and TrustedLen for SkipThe8472-1/+51
2024-01-10implement TrustedLen for StepByThe8472-9/+24
2024-01-10Add `#[track_caller]` to the "From implies Into" implEmil Gardström-0/+1
2024-01-10Stabilize `slice_first_last_chunk`Trevor Gross-35/+20
This stabilizes all methods under `slice_first_last_chunk`. Additionally, it const stabilizes the non-mut functions and moves the `_mut` functions under `const_slice_first_last_chunk`. These are blocked on `const_mut_refs`. As part of this change, `slice_split_at_unchecked` was marked const-stable for internal use (but not fully stable).
2024-01-10Rollup merge of #119782 - RalfJung:rint, r=cuviperMatthias Krüger-0/+4
rint intrinsics: caution against actually trying to check for floating-point exceptions
2024-01-09rint intrinsics: caution against actually trying to check for floating-point ↵Ralf Jung-0/+4
exceptions
2024-01-09Auto merge of #116846 - krtab:slice_compare_no_memcmp_opt, r=the8472bors-1/+11
A more efficient slice comparison implementation for T: !BytewiseEq (This is a follow up PR on #113654) This PR changes the implementation for `[T]` slice comparison when `T: !BytewiseEq`. The previous implementation using zip was not optimized properly by the compiler, which didn't leverage the fact that both length were equal. Performance improvements are for example 20% when testing that `[Some(0_u64); 4096].as_slice() == [Some(0_u64); 4096].as_slice()`.
2024-01-09core: panic: fix broken linkMiguel Ojeda-1/+1
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-01-09Rollup merge of #118979 - ChrisDenton:unwrap-const, r=Nilstrieb,dtolnayMatthias Krüger-1/+8
Use `assert_unsafe_precondition` for `char::from_u32_unchecked` Use `assert_unsafe_precondition` in `char::from_u32_unchecked` so that it can be stabilized as `const`.
2024-01-09Rollup merge of #119598 - Laura7089:fix/deref-typo, r=NilstriebMatthias Krüger-1/+1
Fix a typo in core::ops::Deref's doc
2024-01-08A more efficient slice comparison implementation for T: !BytewiseEqArthur Carcano-1/+11
The previous implementation was not optimized properly by the compiler, which didn't leverage the fact that both length were equal.
2024-01-08Rollup merge of #116129 - fu5ha:better-pin-docs-2, r=AmanieuMatthias Krüger-370/+1099
Rewrite `pin` module documentation to clarify usage and invariants The documentation of `pin` today does not give a complete treatment of pinning from first principles, nor does it adequately help build intuition and understanding for how the different elements of the pinning story fit together. This rewrite attempts to address these in a way that makes the concept more approachable while also making the documentation more normative. This PR picks up where `@mcy` left off in #88500 (thanks to him for the original work and `@Manishearth` for mentioning it such that I originally found it). I've directly incorporated much of the feedback left on the original PR and have rewritten and changed some of the main conceits of the prose to better adhere to the feedback from the reviewers on that PR or just explain something in (hopefully) a better way.
2024-01-07linkManish Goregaokar-1/+1
2024-01-07Update library/core/src/pin.rsManish Goregaokar-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-01-07clean up structural pinningManish Goregaokar-8/+10
2024-01-07footnote on dropping futuresManish Goregaokar-2/+5
2024-01-07validManish Goregaokar-1/+1
2024-01-07punctuation in parensManish Goregaokar-2/+2
2024-01-07Apply suggestions from code reviewManish Goregaokar-4/+4
Co-authored-by: Ralf Jung <post@ralfj.de> Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
2024-01-07Clean up guarantees wordingManish Goregaokar-15/+7
We don't need to go into that much depth at this stage
2024-01-07lifetime -> lifespan where relevant. improve docs on as_ref()Manish Goregaokar-6/+6
2024-01-07Rephrase unpin docs in terms of pinning-agnosticnessManish Goregaokar-4/+6
2024-01-07trim section on managed-box modelGray Olson-9/+4
2024-01-07improve `Pin::new_unchecked` docsGray Olson-10/+16
2024-01-07fix broken linkGray Olson-1/+1
2024-01-07justify motivation of `Unpin` betterGray Olson-14/+30
2024-01-07improve `Pin` and `Pin::new` docsGray Olson-23/+67
2024-01-07`Pin<P>` -> `Pin<Ptr>`Gray Olson-75/+81
2024-01-07fix typos and edit proseGray Olson-76/+85
2024-01-07edit new section for typos and better wordingGray Olson-16/+21
2024-01-07fix importsGray Olson-6/+5
2024-01-07fix typosGray Olson-4/+4
2024-01-07add section on manual owning ptr managed solution via @kpreidGray Olson-9/+36
2024-01-07improve structural Unpin + formattingGray Olson-8/+10
2024-01-07reword unpin auto impl sectionGray Olson-26/+20
2024-01-07fix link in footnoteGray Olson-3/+3
2024-01-07improve `Pin` struct docs and add examplesGray Olson-8/+89
2024-01-07improve intro and discussion of pinning as library contractGray Olson-39/+59
2024-01-07improve intro and `Unpin`-related discussionGray Olson-67/+145
2024-01-07update doubly linked list commentary and fix linksGray Olson-19/+26
2024-01-07fix one more broken linkGray Olson-1/+1
2024-01-07fix broken linksGray Olson-2/+2
2024-01-07Fix examples, finish polishingGray Olson-48/+87
2024-01-07mostly doneGray Olson-348/+359
2024-01-07Rewrite `Pin<P>` docs to clarify guarantees and usesMiguel Young de la Sota-214/+605
The documentation today does not give a complete treatment of pinning from first principles, which appropriately describes how to design types that use it, nor does it provide formal statements of the guarantees users need to be aware of. This rewrite attempts to address these in a way that makes the concept more approachable while also making the documentation more normative.
2024-01-06Rollup merge of #119657 - cls:slice_split_once-typo, r=ChrisDentonMichael Goulet-2/+2
Fix typo in docs for slice::split_once, slice::rsplit_once This fixes a typo in the doc comments for these methods, which I tripped over while reading the docs: "If any matching elements are **resent** in the slice [...]", which is presumably meant to read **present**. I mentioned this in #112811, the tracking issue for `slice_split_once`, and was encouraged to open a PR.
2024-01-06Rollup merge of #119656 - RalfJung:round-docs, r=Mark-SimulacrumMichael Goulet-6/+12
document rounding behavior of rint/nearbyint for ties It's not possible to change the rounding mode in Rust, so these intrinsics will always behave like `roundeven`.
2024-01-06Auto merge of #119599 - marthadev:position, r=the8472bors-6/+13
Rewrite Iterator::position default impl Storing the accumulating value outside the fold in an attempt to improve code generation has shown speedups on various handwritten benchmarks, see discussion at #119551.
2024-01-06Rollup merge of #119624 - petrochenkov:dialoc4, r=compiler-errorsMatthias Krüger-0/+1
rustc_span: More consistent span combination operations Also add more tests for using `tt` in addition to `ident`, and some other minor tweaks, see individual commits. This is a part of https://github.com/rust-lang/rust/pull/119412 that doesn't yet add side tables for metavariable spans.
2024-01-06Rollup merge of #119595 - mbbill:patch-1, r=Mark-SimulacrumMatthias Krüger-1/+1
Fixed ambiguity in hint.rs Needle and haystack are actually not the same, they remain constant.