-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LocalWaker and ContextBuilder types to core, and LocalWake trait to alloc. #118960
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This CI failure is strange:
It seems the error message is correct about the fact that we shouldn't be linking to #87021 and we should link instead to #96992. But it makes me question why does it only fail on my branch, I didn't change this issue number after all. |
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
Just for the record, it might be wise to check if EDIT: This implementation was later removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have signoff from T-libs-api on the new unstable surface area? The ACP issue seems to have had a good bit of discussion but I didn't see that signoff made explicit. If you can drive that towards a comment here or there and/or link something, that would be good.
I'm particularly concerned about the surface area confusing newer users -- especially given the frequent concerns over async complexity -- I wonder if we should add a sentence/paragraph to the top-level docs in https://doc.rust-lang.org/nightly/std/task/index.html to clarify the current state (i.e., stable surface area should be sufficient for most uses or so).
I think it may be better to put it on the docs for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to see a LocalWaker
type, but this not the way to do it in my opinion. That's coming from someone who has written a lot of Future
s, async function and a runtime specialised in thread-locality (i.e. I very much like to see this change).
I don't think making the Waker
optional in Context
is wise considering all existing Future
related code depends on the Waker
type always being part of the Context
, it was never not there, a promise we're walking back with this pr.
I made the waker type mandatory on the last commit. Several people have expressed their concern with this aspect of the API. And while I do think that it is better for them to be optional than not, that is not something I consider terribly important. |
☔ The latest upstream changes (presumably #120136) made this pull request unmergeable. Please resolve the merge conflicts. |
…w the extention of contexts by futures
…y removing a #[cfg(target_has_atomic = ptr)]
5e55bad
to
180c68b
Compare
@Mark-Simulacrum Do we really need an explicit signoff here? Both teams have discussed it and approved nightly experimentation (libs-team, wg-async). I feel that with no significant changes on the proposal, it is going to be hard to get the teams to meet to discuss the same topic again. |
Those comments seem sufficient to me (I hadn't seen them in my quick skim) for nightly experimentation. @rustbot ready |
@bors r+ |
…ulacrum Add LocalWaker and ContextBuilder types to core, and LocalWake trait to alloc. Implementation for rust-lang#118959.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#113833 (`std::error::Error` -> Trait Implementations: lifetimes consistency improvement) - rust-lang#115386 (PartialEq, PartialOrd: update and synchronize handling of transitive chains) - rust-lang#116284 (make matching on NaN a hard error, and remove the rest of illegal_floating_point_literal_pattern) - rust-lang#118960 (Add LocalWaker and ContextBuilder types to core, and LocalWake trait to alloc.) - rust-lang#120060 (Use the same mir-opt bless targets on all platforms) - rust-lang#120214 (match lowering: consistently lower bindings deepest-first) - rust-lang#120384 (Use `<T, U>` for array/slice equality `impl`s) r? `@ghost` `@rustbot` modify labels: rollup
…ulacrum Add LocalWaker and ContextBuilder types to core, and LocalWake trait to alloc. Implementation for rust-lang#118959.
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#113833 (`std::error::Error` -> Trait Implementations: lifetimes consistency improvement) - rust-lang#115386 (PartialEq, PartialOrd: update and synchronize handling of transitive chains) - rust-lang#116284 (make matching on NaN a hard error, and remove the rest of illegal_floating_point_literal_pattern) - rust-lang#118960 (Add LocalWaker and ContextBuilder types to core, and LocalWake trait to alloc.) - rust-lang#120384 (Use `<T, U>` for array/slice equality `impl`s) - rust-lang#120518 (riscv only supports split_debuginfo=off for now) - rust-lang#120619 (Assert that params with the same *index* have the same *name*) - rust-lang#120657 (Remove unused struct) - rust-lang#120661 (target: default to the medium code model on LoongArch targets) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#113833 (`std::error::Error` -> Trait Implementations: lifetimes consistency improvement) - rust-lang#115386 (PartialEq, PartialOrd: update and synchronize handling of transitive chains) - rust-lang#116284 (make matching on NaN a hard error, and remove the rest of illegal_floating_point_literal_pattern) - rust-lang#118960 (Add LocalWaker and ContextBuilder types to core, and LocalWake trait to alloc.) - rust-lang#120384 (Use `<T, U>` for array/slice equality `impl`s) - rust-lang#120518 (riscv only supports split_debuginfo=off for now) - rust-lang#120657 (Remove unused struct) - rust-lang#120661 (target: default to the medium code model on LoongArch targets) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#113833 (`std::error::Error` -> Trait Implementations: lifetimes consistency improvement) - rust-lang#115386 (PartialEq, PartialOrd: update and synchronize handling of transitive chains) - rust-lang#116284 (make matching on NaN a hard error, and remove the rest of illegal_floating_point_literal_pattern) - rust-lang#118960 (Add LocalWaker and ContextBuilder types to core, and LocalWake trait to alloc.) - rust-lang#120384 (Use `<T, U>` for array/slice equality `impl`s) - rust-lang#120518 (riscv only supports split_debuginfo=off for now) - rust-lang#120657 (Remove unused struct) - rust-lang#120661 (target: default to the medium code model on LoongArch targets) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#118960 - tvallotton:local_waker, r=Mark-Simulacrum Add LocalWaker and ContextBuilder types to core, and LocalWake trait to alloc. Implementation for rust-lang#118959.
fix: waker_getters tracking issue from 87021 for 96992. I was directed to make the fix here by this comment rust-lang/rust#118960 (comment).
…ulacrum Add LocalWaker and ContextBuilder types to core, and LocalWake trait to alloc. Implementation for rust-lang#118959.
…cuviper make LocalWaker::will_wake consistent with Waker::will_wake This mirrors rust-lang#119863 for `LocalWaker`. Looks like that got missed in the initial `LocalWaker` PR (rust-lang#118960).
…cuviper make LocalWaker::will_wake consistent with Waker::will_wake This mirrors rust-lang#119863 for `LocalWaker`. Looks like that got missed in the initial `LocalWaker` PR (rust-lang#118960).
Rollup merge of rust-lang#128882 - RalfJung:local-waker-will-wake, r=cuviper make LocalWaker::will_wake consistent with Waker::will_wake This mirrors rust-lang#119863 for `LocalWaker`. Looks like that got missed in the initial `LocalWaker` PR (rust-lang#118960).
make LocalWaker::will_wake consistent with Waker::will_wake This mirrors rust-lang/rust#119863 for `LocalWaker`. Looks like that got missed in the initial `LocalWaker` PR (rust-lang/rust#118960).
Implementation for #118959.