Skip to content
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 a range argument to vec.extract_if #133265

Merged
merged 4 commits into from
Dec 18, 2024
Merged

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Nov 20, 2024

tracking issue: #43244

This adds the range argument requested in #43244 (comment)

@rustbot
Copy link
Collaborator

rustbot commented Nov 20, 2024

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 20, 2024
@rust-log-analyzer

This comment has been minimized.

/// ```
/// #![feature(extract_if)]
/// let mut items = vec![0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2, 1, 2];
/// let ones = items.extract_if(7.., |x| *x == 1).collect::<Vec<_>>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change one of the first few 0s to 1 to indicate they don't get extracted (out of range)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, I wanted to show the "I have a prefix that I know doesn't contain those things, so I can skip them" use.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@cuviper cuviper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

The FCP finished -- do you want to go ahead and add the stabilization too?

library/alloc/tests/vec.rs Outdated Show resolved Hide resolved
@tgross35
Copy link
Contributor

tgross35 commented Dec 6, 2024

r? @cuviper (sorry, I didn't realize this was assigned to me)

The FCP finished -- do you want to go ahead and add the stabilization too?

Since this is a pretty significant API and implementation change, maybe it would be good to hold off for a couple of weeks? In case anyone using this API unstably has feedback after the change (I doubt it, but doesn't hurt).

@rustbot rustbot assigned cuviper and unassigned tgross35 Dec 6, 2024
@the8472
Copy link
Member Author

the8472 commented Dec 6, 2024

Changing and stabilizing in the same PR doesn't seem ideal to me either, especially when the change happened parallel to the FCP. I think it should bake a few days at least.

@cuviper
Copy link
Member

cuviper commented Dec 6, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Dec 6, 2024

📌 Commit 414acda has been approved by cuviper

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 6, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Dec 7, 2024
Add a range argument to vec.extract_if

tracking issue: rust-lang#43244

This adds the range argument requested in rust-lang#43244 (comment)
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 7, 2024
…kingjubilee

Rollup of 11 pull requests

Successful merges:

 - rust-lang#131669 (lint: change help for pointers to dyn types in FFI)
 - rust-lang#133265 (Add a range argument to vec.extract_if)
 - rust-lang#133733 ( compiletest: show the difference between the normalized output and the actual output for lines which didn't match)
 - rust-lang#133955 (Pass the arch rather than full target name to windows_registry::find_tool)
 - rust-lang#133967 ([AIX] Pass -bnoipath when adding rust upstream dynamic crates)
 - rust-lang#133976 (Removed Unnecessary Spaces From RELEASES.md)
 - rust-lang#133980 ([AIX] Remove option "-n" from AIX "ln" command)
 - rust-lang#133987 (Define acronym for thread local storage)
 - rust-lang#133992 (Actually walk into lifetimes and attrs in `EarlyContextAndPass`)
 - rust-lang#133993 (Fix: typo in E0751 error explanation)
 - rust-lang#133996 (Move most tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 7, 2024
…kingjubilee

Rollup of 11 pull requests

Successful merges:

 - rust-lang#131669 (lint: change help for pointers to dyn types in FFI)
 - rust-lang#133265 (Add a range argument to vec.extract_if)
 - rust-lang#133733 ( compiletest: show the difference between the normalized output and the actual output for lines which didn't match)
 - rust-lang#133955 (Pass the arch rather than full target name to windows_registry::find_tool)
 - rust-lang#133967 ([AIX] Pass -bnoipath when adding rust upstream dynamic crates)
 - rust-lang#133976 (Removed Unnecessary Spaces From RELEASES.md)
 - rust-lang#133980 ([AIX] Remove option "-n" from AIX "ln" command)
 - rust-lang#133987 (Define acronym for thread local storage)
 - rust-lang#133992 (Actually walk into lifetimes and attrs in `EarlyContextAndPass`)
 - rust-lang#133993 (Fix: typo in E0751 error explanation)
 - rust-lang#133996 (Move most tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 7, 2024
…kingjubilee

Rollup of 11 pull requests

Successful merges:

 - rust-lang#131669 (lint: change help for pointers to dyn types in FFI)
 - rust-lang#133265 (Add a range argument to vec.extract_if)
 - rust-lang#133733 ( compiletest: show the difference between the normalized output and the actual output for lines which didn't match)
 - rust-lang#133955 (Pass the arch rather than full target name to windows_registry::find_tool)
 - rust-lang#133967 ([AIX] Pass -bnoipath when adding rust upstream dynamic crates)
 - rust-lang#133976 (Removed Unnecessary Spaces From RELEASES.md)
 - rust-lang#133980 ([AIX] Remove option "-n" from AIX "ln" command)
 - rust-lang#133987 (Define acronym for thread local storage)
 - rust-lang#133992 (Actually walk into lifetimes and attrs in `EarlyContextAndPass`)
 - rust-lang#133993 (Fix: typo in E0751 error explanation)
 - rust-lang#133996 (Move most tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 7, 2024
…kingjubilee

Rollup of 11 pull requests

Successful merges:

 - rust-lang#131669 (lint: change help for pointers to dyn types in FFI)
 - rust-lang#133265 (Add a range argument to vec.extract_if)
 - rust-lang#133733 ( compiletest: show the difference between the normalized output and the actual output for lines which didn't match)
 - rust-lang#133955 (Pass the arch rather than full target name to windows_registry::find_tool)
 - rust-lang#133967 ([AIX] Pass -bnoipath when adding rust upstream dynamic crates)
 - rust-lang#133976 (Removed Unnecessary Spaces From RELEASES.md)
 - rust-lang#133980 ([AIX] Remove option "-n" from AIX "ln" command)
 - rust-lang#133987 (Define acronym for thread local storage)
 - rust-lang#133992 (Actually walk into lifetimes and attrs in `EarlyContextAndPass`)
 - rust-lang#133993 (Fix: typo in E0751 error explanation)
 - rust-lang#133996 (Move most tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs`)

r? `@ghost`
`@rustbot` modify labels: rollup
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Dec 8, 2024
Add a range argument to vec.extract_if

tracking issue: rust-lang#43244

This adds the range argument requested in rust-lang#43244 (comment)
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 8, 2024
…kingjubilee

Rollup of 5 pull requests

Successful merges:

 - rust-lang#131669 (lint: change help for pointers to dyn types in FFI)
 - rust-lang#133184 (wasi/fs: Improve stopping condition for <ReadDir as Iterator>::next)
 - rust-lang#133265 (Add a range argument to vec.extract_if)
 - rust-lang#133456 (Add licenses + Run `cargo update`)
 - rust-lang#133767 (Add more info on type/trait mismatches for different crate versions)

Failed merges:

 - rust-lang#133522 (Don't suggest restricting bound with unstable traits on stable and mention it's unstable on nightly)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Dec 8, 2024

☔ The latest upstream changes (presumably #133522) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 16, 2024
…llaumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#134111 (Fix `--nocapture` for run-make tests)
 - rust-lang#134202 (Remove `rustc::existing_doc_keyword` lint)
 - rust-lang#134314 (Make sure to use normalized ty for unevaluated const in default struct value)
 - rust-lang#134329 (Add m68k_target_feature)
 - rust-lang#134342 (crashes: more tests)
 - rust-lang#134354 (Handle fndef rendering together with signature rendering)

Failed merges:

 - rust-lang#133265 (Add a range argument to vec.extract_if)

r? `@ghost`
`@rustbot` modify labels: rollup
@cuviper
Copy link
Member

cuviper commented Dec 16, 2024

I think you forgot the "extraxt" typo fix when you rebased.

@the8472
Copy link
Member Author

the8472 commented Dec 16, 2024

Indeed, fixed.

@bors r=cuviper

@bors
Copy link
Contributor

bors commented Dec 16, 2024

📌 Commit 44790c4 has been approved by cuviper

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 16, 2024
jhpratt added a commit to jhpratt/rust that referenced this pull request Dec 17, 2024
Add a range argument to vec.extract_if

tracking issue: rust-lang#43244

This adds the range argument requested in rust-lang#43244 (comment)
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 17, 2024
Rollup of 9 pull requests

Successful merges:

 - rust-lang#133265 (Add a range argument to vec.extract_if)
 - rust-lang#134202 (Remove `rustc::existing_doc_keyword` lint)
 - rust-lang#134354 (Handle fndef rendering together with signature rendering)
 - rust-lang#134365 (Rename `rustc_mir_build::build` to `builder`)
 - rust-lang#134368 (Use links to edition guide for edition migrations)
 - rust-lang#134388 (Update books)
 - rust-lang#134397 (rustc_borrowck: Suggest changing `&raw const` to `&raw mut` if applicable)
 - rust-lang#134398 (AIX: add alignment info for test)
 - rust-lang#134400 (Fix some comments related to upvars handling)

Failed merges:

 - rust-lang#134399 (Do not do if ! else, use unnegated cond and swap the branches instead)

r? `@ghost`
`@rustbot` modify labels: rollup
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Dec 17, 2024
Add a range argument to vec.extract_if

tracking issue: rust-lang#43244

This adds the range argument requested in rust-lang#43244 (comment)
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Dec 17, 2024
Add a range argument to vec.extract_if

tracking issue: rust-lang#43244

This adds the range argument requested in rust-lang#43244 (comment)
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 18, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133265 (Add a range argument to vec.extract_if)
 - rust-lang#133801 (Promote powerpc64le-unknown-linux-musl to tier 2 with host tools)
 - rust-lang#134323 (coverage: Dismantle `map_data.rs` by moving its responsibilities elsewhere)
 - rust-lang#134378 (An octuple of polonius fact generation cleanups)
 - rust-lang#134408 (Regression test for RPIT inheriting lifetime from projection)
 - rust-lang#134423 (bootstrap: use specific-purpose ui test path for `test_valid` self-test)
 - rust-lang#134426 (Fix typo in uint_macros.rs)

Failed merges:

 - rust-lang#133103 (Pass FnAbi to find_mir_or_eval_fn)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 938742e into rust-lang:master Dec 18, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants