-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Stabilize Option::zip #72938
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
Stabilize Option::zip #72938
Conversation
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
r? @sfackler |
156def6
to
2eb6598
Compare
@rfcbot fcp merge |
Team member @sfackler 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. |
src/libcore/option.rs
Outdated
@@ -967,7 +969,7 @@ impl<T> Option<T> { | |||
/// assert_eq!(x.zip_with(y, Point::new), Some(Point { x: 17.5, y: 42.7 })); | |||
/// assert_eq!(x.zip_with(None, Point::new), None); | |||
/// ``` | |||
#[unstable(feature = "option_zip", issue = "70086")] | |||
#[unstable(feature = "option_zip_with", issue = "70086")] |
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.
When we stabilize only a subset of a library feature, we change the name of the stabilized part, not the still unstable part. That way people only get unused feature warnings downstream, not build failures.
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 changed the stabilized feature to option_zip_option
.
🔔 This is now entering its final comment period, as per the review above. 🔔 |
r=me with the feature names swapped around as @dtolnay mentioned |
2eb6598
to
8b20928
Compare
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. |
@bors r+ |
📌 Commit 8b20928 has been approved by |
@bors rollup |
Stabilize Option::zip This PR stabilizes the following API: ```rust impl<T> Option<T> { pub fn zip<U>(self, other: Option<U>) -> Option<(T, U)>; } ``` This API has real world usage as seen in <https://grep.app/search?q=-%3E%20Option%3C%5C%28T%2C%5Cs%3FU%5C%29%3E®exp=true&filter[lang][0]=Rust>. The `zip_with` method is left unstably as this API is kinda niche and it hasn't received much usage in Rust repositories on GitHub. cc rust-lang#70086
Rollup of 10 pull requests Successful merges: - rust-lang#72707 (Use min_specialization in the remaining rustc crates) - rust-lang#72740 (On recursive ADT, provide indirection structured suggestion) - rust-lang#72879 (Miri: avoid tracking current location three times) - rust-lang#72938 (Stabilize Option::zip) - rust-lang#73086 (Rename "cyclone" to "apple-a7" per changes in upstream LLVM) - rust-lang#73104 (Example about explicit mutex dropping) - rust-lang#73139 (Add methods to go from a nul-terminated Vec<u8> to a CString) - rust-lang#73296 (Remove vestigial CI job msvc-aux.) - rust-lang#73304 (Revert heterogeneous SocketAddr PartialEq impls) - rust-lang#73331 (extend network support for HermitCore) Failed merges: r? @ghost
Stabilize Option::zip This PR stabilizes the following API: ```rust impl<T> Option<T> { pub fn zip<U>(self, other: Option<U>) -> Option<(T, U)>; } ``` This API has real world usage as seen in <https://grep.app/search?q=-%3E%20Option%3C%5C%28T%2C%5Cs%3FU%5C%29%3E®exp=true&filter[lang][0]=Rust>. The `zip_with` method is left unstably as this API is kinda niche and it hasn't received much usage in Rust repositories on GitHub. cc rust-lang#70086
Either the GitHub milestone or the stability attribute is wrong. Former says 1.45.0, latter says 1.46.0. |
This PR stabilizes the following API:
This API has real world usage as seen in https://grep.app/search?q=-%3E%20Option%3C%5C%28T%2C%5Cs%3FU%5C%29%3E®exp=true&filter[lang][0]=Rust.
The
zip_with
method is left unstably as this API is kinda nicheand it hasn't received much usage in Rust repositories on GitHub.
cc #70086