about summary refs log tree commit diff
path: root/library/core/src/pin.rs
AgeCommit message (Collapse)AuthorLines
2025-09-01Constify conversion traitsltdk-5/+19
2025-07-04clippy fix: indentationMarijn Schouten-8/+8
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-1/+1
2025-06-25Add `sym::macro_pin` diagnostic item for `core::pin::pin!()`Samuel Tardieu-0/+1
2025-06-02Remove more library bootstrapJosh Stone-1/+0
2025-05-20Rollup merge of #141289 - compiler-errors:more-self, r=jhprattMatthias Krüger-1/+1
use `Self` alias in self types rather than manually substituting it Of the rougly 145 uses of `self: Ty` in the standard library, 5 of them don't use `Self` but instead choose to manually "substitute" the `impl`'s self type into the type. This leads to weird behavior sometimes (https://github.com/rust-lang/rust/issues/140611#issuecomment-2883761300) -- **to be clear**, none of these usages actually trigger any bugs, but it's possible that they may break in the future (or at least lead to lints), so let's just "fix" them proactively.
2025-05-20use Self alias in self types rather than manually substituting itMichael Goulet-1/+1
2025-05-15Rollup merge of #139749 - ↵Matthias Krüger-5/+5
ruancomelli:docs/library/core/src/pin/fix-typo-necessarily-to-necessary, r=joboet docs(library/core/src/pin): fix typo "necessarily" -> "necessary" Fix a typo in [`library/core/src/pin.rs`](https://github.com/ruancomelli/rust/blob/14662fabeb69fe5ab6c6e68051bf9f80d4aaaa35/library/core/src/pin.rs), from > As we'll see later, this is **necessarily** from the time the value is first pinned until the end of its lifespan. to > As we'll see later, this is **necessary** from the time the value is first pinned until the end of its lifespan. (my emphasis).
2025-05-13Format and skip formatting for pinMichael Goulet-0/+2
2025-05-12update cfg(bootstrap)Pietro Albini-12/+0
2025-04-28Auto merge of #123239 - Urgau:dangerous_implicit_autorefs, ↵bors-1/+1
r=jdonszelmann,traviscross Implement a lint for implicit autoref of raw pointer dereference - take 2 *[t-lang nomination comment](https://github.com/rust-lang/rust/pull/123239#issuecomment-2727551097)* This PR aims at implementing a lint for implicit autoref of raw pointer dereference, it is based on #103735 with suggestion and improvements from https://github.com/rust-lang/rust/pull/103735#issuecomment-1370420305. The goal is to catch cases like this, where the user probably doesn't realise it just created a reference. ```rust pub struct Test { data: [u8], } pub fn test_len(t: *const Test) -> usize { unsafe { (*t).data.len() } // this calls <[T]>::len(&self) } ``` Since #103735 already went 2 times through T-lang, where they T-lang ended-up asking for a more restricted version (which is what this PR does), I would prefer this PR to be reviewed first before re-nominating it for T-lang. ---- Compared to the PR it is as based on, this PR adds 3 restrictions on the outer most expression, which must either be: 1. A deref followed by any non-deref place projection (that intermediate deref will typically be auto-inserted) 2. A method call annotated with `#[rustc_no_implicit_refs]`. 3. A deref followed by a `addr_of!` or `addr_of_mut!`. See bottom of post for details. There are several points that are not 100% clear to me when implementing the modifications: - ~~"4. Any number of automatically inserted deref/derefmut calls." I as never able to trigger this. Am I missing something?~~ Fixed - Are "index" and "field" enough? ---- cc `@JakobDegen` `@WaffleLapkin` r? `@RalfJung` try-job: dist-various-1 try-job: dist-various-2
2025-04-20Allow `dangerous_implicit_autorefs` lint in some testsUrgau-1/+1
2025-04-15Implement `pin!()` using `super let`.Mara Bos-102/+35
2025-04-13docs(library/core/src/pin): rewrite for clarityRuan Comelli-5/+5
2025-04-13docs(library/core/src/pin): fix typo "necessarily" -> "necessary"Ruan Comelli-1/+1
2025-04-13Initial `UnsafePinned`/`UnsafeUnpin` impl [Part 1: Libs]Sky-0/+5
2025-04-09update cfgsBoxy-1/+1
2025-03-19add rustc_macro_edition_2021Jana Dönszelmann-0/+1
2025-02-25fix doc in library/core/src/pin.rsxizheyin-2/+2
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-01-24docs: fix typo in std::pin overviewNathan VanBenschoten-2/+2
2025-01-15fix typo in typenames of pin documentationDJMrTV-2/+2
2024-12-28Fix sentence fragment in `pin` module docsGeoffrey Thomas-1/+1
Looks like this was inadvertently dropped in 8241ca60. Restore the words from before that commit.
2024-11-29Auto merge of #133533 - BoxyUwU:bump-boostrap, r=jieyouxu,Mark-Simulacrumbors-11/+11
Bump boostrap compiler to new beta Currently failing due to something about the const stability checks and `panic!`. I'm not sure why though since I wasn't able to see any PRs merged in the past few days that would result in a `cfg(bootstrap)` that shouldn't be removed. cc `@RalfJung` #131349
2024-11-27replace placeholder versionBoxy-11/+11
2024-11-25Fix typos in pin.rsAakarshit Uppal-3/+3
2024-11-20Stabilize const_pin_2George Bateman-2/+4
2024-10-22Rename Receiver -> LegacyReceiverAdrian Taylor-3/+3
As part of the "arbitrary self types v2" project, we are going to replace the current `Receiver` trait with a new mechanism based on a new, different `Receiver` trait. This PR renames the old trait to get it out the way. Naming is hard. Options considered included: * HardCodedReceiver (because it should only be used for things in the standard library, and hence is sort-of hard coded) * LegacyReceiver * TargetLessReceiver * OldReceiver These are all bad names, but fortunately this will be temporary. Assuming the new mechanism proceeds to stabilization as intended, the legacy trait will be removed altogether. Although we expect this trait to be used only in the standard library, we suspect it may be in use elsehwere, so we're landing this change separately to identify any surprising breakages. It's known that this trait is used within the Rust for Linux project; a patch is in progress to remove their dependency. This is a part of the arbitrary self types v2 project, https://github.com/rust-lang/rfcs/pull/3519 https://github.com/rust-lang/rust/issues/44874 r? @wesleywiser
2024-10-16Partially stabilize const_pinGeorge Bateman-10/+10
2024-10-08Stabilize Pin::as_deref_mutNoa-1/+1
2024-09-05update cfgsBoxy-1/+1
2024-08-27Fix Pin::set bounds regressionNoa-9/+12
2024-08-25Rollup merge of #129487 - ↵Matthias Krüger-0/+1
GrigorenkoPV:repr_transparent_external_private_fields, r=compiler-errors repr_transparent_external_private_fields: special-case some std types Fixes #129470 ```@rustbot``` label +A-lint +L-repr_transparent_external_private_fields
2024-08-24New `#[rustc_pub_transparent]` attributePavel Grigorenko-0/+1
2024-08-23Move into_inner_unchecked back to the bottom of the impl blockNoa-25/+25
2024-08-23Put Pin::as_deref_mut in impl Pin<Ptr>Noa-59/+62
2024-07-31PinCoerceUnsized trait into coreXiangfei Ding-2/+48
2024-07-29Reformat `use` declarations.Nicholas Nethercote-3/+1
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-26Fix doc nitsJohn Arundel-8/+8
Many tiny changes to stdlib doc comments to make them consistent (for example "Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph breaks, backticks for monospace style, and other minor nits. https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
2024-06-07Fix typo in docs for std::pinWalter Kalata-1/+1
2024-05-03Rollup merge of #123480 - Nadrieril:impl-all-derefpures, r=compiler-errorsMatthias Krüger-1/+4
deref patterns: impl `DerefPure` for more std types Context: [deref patterns](https://github.com/rust-lang/rust/issues/87121). The requirements of `DerefPure` aren't precise yet, but these types unambiguously satisfy them. Interestingly, a hypothetical `impl DerefMut for Cow` that does a `Clone` would *not* be eligible for `DerefPure` if we allow mixing deref patterns with normal patterns. If the following is exhaustive then the `DerefMut` would cause UB: ```rust match &mut Cow::Borrowed(&()) { Cow::Owned(_) => ..., // Doesn't match deref!(_x) if false => ..., // Causes the variant to switch to `Owned` Cow::Borrowed(_) => ..., // Doesn't match // We reach unreachable } ```
2024-05-01Step bootstrap cfgsMark Rousskov-1/+1
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-1/+1
And suggest adding the `#[coroutine]` to the closure
2024-04-12fix pin.rs typoYuanzhuo Yang-1/+1
correct "implemts" to "implements"
2024-04-11Correct broken link in core::pin docTomoki Nakagawa-5/+5
2024-04-05Impl `DerefPure` for more std typesNadrieril-1/+4
2024-03-27chore: fix some commentsxiaoxiangxianzi-1/+1
Signed-off-by: xiaoxiangxianzi <zhaoyizheng@outlook.com>
2024-03-23Fix some typos in the pin.rsHerobs-7/+7
2024-01-16Rename `pointer` field on `Pin`LegionMammal978-20/+26
The internal, unstable field of `Pin` can conflict with fields from the inner type accessed via the `Deref` impl. Rename it from `pointer` to `__pointer`, to make it less likely to conflict with anything else.
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>