-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Stabilize Poll::is_ready
and is_pending
as const
#76227
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Insta-stabilize the methods `is_ready` and `is_pending` of `Poll`. Possible because of the recent stabilization of const control flow. Also adds a test for these methods in a const context.
r? @shepmaster (rust_highfive has picked a reviewer for you, use r? to override) |
src/test/ui/consts/std/poll.rs
Outdated
|
||
const IS_PENDING : bool = POLL.is_pending(); | ||
assert!(IS_PENDING); | ||
} |
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.
Hm, why are we using a UI test for this, especially a run-pass
one? I would think that these integrated tests are much costlier than standard #[test]
tests, as well as much harder to debug. Linking a whole separate executable to check two const methods of stdlib is an overkill.
I would suggest testing similar things by unit or integrated #[test]
tests in core
or std
itself.
It might also be a good idea to sift through existing test suite for stdlib tests which can be moved to unit tests.
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.
Hm, yeah, we already have a bunch of tests like this...
I've opened https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/UI.20tests.20for.20stdlib for discussion, it might be that I am missing some context here of course.
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.
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.
Sounds good, I'll have a look later today
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.
Tests are moved 👍
r? @Amanieu Same deal as #76198 (comment) ? |
r? @KodrAus |
Team member @KodrAus has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@bors r+ |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
Did this get added to the queue correctly? |
@bors r=KodrAus |
📌 Commit 5e80c65 has been approved by |
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Rollup of 19 pull requests Successful merges: - rust-lang#76097 (Stabilize hint::spin_loop) - rust-lang#76227 (Stabilize `Poll::is_ready` and `is_pending` as const) - rust-lang#78065 (make concurrency helper more pleasant to read) - rust-lang#78570 (Remove FIXME comment in print_type_sizes ui test suite) - rust-lang#78572 (Use SOCK_CLOEXEC and accept4() on more platforms.) - rust-lang#78658 (Add a tool to run `x.py` from any subdirectory) - rust-lang#78706 (Fix run-make tests running when LLVM is disabled) - rust-lang#78728 (Constantify `UnsafeCell::into_inner` and related) - rust-lang#78775 (Bump Rustfmt and RLS) - rust-lang#78788 (Correct unsigned equivalent of isize to be usize) - rust-lang#78811 (Make some std::io functions `const`) - rust-lang#78828 (use single char patterns for split() (clippy::single_char_pattern)) - rust-lang#78841 (Small cleanup in `TypeFoldable` derive macro) - rust-lang#78842 (Honor the rustfmt setting in config.toml) - rust-lang#78843 (Less verbose debug logging from inlining integrator) - rust-lang#78852 (Convert a bunch of intra-doc links) - rust-lang#78860 (rustc_resolve: Use `#![feature(format_args_capture)]`) - rust-lang#78861 (typo and formatting) - rust-lang#78865 (Don't fire `CONST_ITEM_MUTATION` lint when borrowing a deref) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Insta-stabilize the methods
is_ready
andis_pending
ofstd::task::Poll
as const, in the same way as PR#76198.Possible because of the recent stabilization of const control flow.
Part of #76225.