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

Stabilise vec::remove_item #67727

Merged
merged 4 commits into from
Jan 7, 2020
Merged

Conversation

Dylan-DPC-zz
Copy link

Closes #40062

r? @alexcrichton

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 30, 2019
@Dylan-DPC-zz
Copy link
Author

Dylan-DPC-zz commented Dec 30, 2019

uggh some git mess up.. let me fix it :D

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-12-30T11:52:57.3794755Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-30T11:52:57.9798645Z ##[command]git config gc.auto 0
2019-12-30T11:52:57.9806083Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-30T11:52:57.9810360Z ##[command]git config --get-all http.proxy
2019-12-30T11:52:57.9813549Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67727/merge:refs/remotes/pull/67727/merge
---
2019-12-30T11:56:06.6577270Z warning: /checkout/src/tools/miri/Cargo.toml: the cargo feature `default-run` is now stable and is no longer necessary to be listed in the manifest
2019-12-30T11:56:06.6864413Z error: failed to resolve patches for `https://github.com/rust-lang/cargo`
2019-12-30T11:56:06.6864547Z 
2019-12-30T11:56:06.6864904Z Caused by:
2019-12-30T11:56:06.6865655Z   patch for `cargo` in `https://github.com/rust-lang/cargo` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
2019-12-30T11:56:06.6878552Z Build completed unsuccessfully in 0:00:16
2019-12-30T11:56:06.6940106Z Makefile:67: recipe for target 'prepare' failed
2019-12-30T11:56:06.6940281Z make: *** [prepare] Error 1
2019-12-30T11:56:07.6958444Z Command failed. Attempt 2/5:
2019-12-30T11:56:07.6958444Z Command failed. Attempt 2/5:
2019-12-30T11:56:07.7881745Z warning: /checkout/src/tools/miri/Cargo.toml: the cargo feature `default-run` is now stable and is no longer necessary to be listed in the manifest
2019-12-30T11:56:07.8177745Z error: failed to resolve patches for `https://github.com/rust-lang/cargo`
2019-12-30T11:56:07.8178422Z 
2019-12-30T11:56:07.8178756Z Caused by:
2019-12-30T11:56:07.8179597Z   patch for `cargo` in `https://github.com/rust-lang/cargo` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
2019-12-30T11:56:07.8190647Z Build completed unsuccessfully in 0:00:00
2019-12-30T11:56:07.8242731Z Makefile:67: recipe for target 'prepare' failed
2019-12-30T11:56:07.8242847Z make: *** [prepare] Error 1
2019-12-30T11:56:09.8261624Z Command failed. Attempt 3/5:
2019-12-30T11:56:09.8261624Z Command failed. Attempt 3/5:
2019-12-30T11:56:09.9173682Z warning: /checkout/src/tools/miri/Cargo.toml: the cargo feature `default-run` is now stable and is no longer necessary to be listed in the manifest
2019-12-30T11:56:09.9464899Z error: failed to resolve patches for `https://github.com/rust-lang/cargo`
2019-12-30T11:56:09.9464976Z 
2019-12-30T11:56:09.9465041Z Caused by:
2019-12-30T11:56:09.9465896Z   patch for `cargo` in `https://github.com/rust-lang/cargo` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
2019-12-30T11:56:09.9474402Z Build completed unsuccessfully in 0:00:00
2019-12-30T11:56:09.9522089Z Makefile:67: recipe for target 'prepare' failed
2019-12-30T11:56:09.9522208Z make: *** [prepare] Error 1
2019-12-30T11:56:12.9545471Z Command failed. Attempt 4/5:
2019-12-30T11:56:12.9545471Z Command failed. Attempt 4/5:
2019-12-30T11:56:13.0469125Z warning: /checkout/src/tools/miri/Cargo.toml: the cargo feature `default-run` is now stable and is no longer necessary to be listed in the manifest
2019-12-30T11:56:13.0758046Z error: failed to resolve patches for `https://github.com/rust-lang/cargo`
2019-12-30T11:56:13.0758121Z 
2019-12-30T11:56:13.0758176Z Caused by:
2019-12-30T11:56:13.0758662Z   patch for `cargo` in `https://github.com/rust-lang/cargo` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
2019-12-30T11:56:13.0765989Z Build completed unsuccessfully in 0:00:00
2019-12-30T11:56:13.0814502Z Makefile:67: recipe for target 'prepare' failed
2019-12-30T11:56:13.0814590Z make: *** [prepare] Error 1
2019-12-30T11:56:17.0828603Z Command failed. Attempt 5/5:
2019-12-30T11:56:17.0828603Z Command failed. Attempt 5/5:
2019-12-30T11:56:17.1781843Z warning: /checkout/src/tools/miri/Cargo.toml: the cargo feature `default-run` is now stable and is no longer necessary to be listed in the manifest
2019-12-30T11:56:17.2083677Z error: failed to resolve patches for `https://github.com/rust-lang/cargo`
2019-12-30T11:56:17.2083763Z 
2019-12-30T11:56:17.2083857Z Caused by:
2019-12-30T11:56:17.2084483Z   patch for `cargo` in `https://github.com/rust-lang/cargo` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
2019-12-30T11:56:17.2094793Z Build completed unsuccessfully in 0:00:00
2019-12-30T11:56:17.2141632Z Makefile:67: recipe for target 'prepare' failed
2019-12-30T11:56:17.2141754Z make: *** [prepare] Error 1
2019-12-30T11:56:17.2149440Z The command has failed after 5 attempts.
2019-12-30T11:56:17.2149440Z The command has failed after 5 attempts.
2019-12-30T11:56:17.2149577Z == clock drift check ==
2019-12-30T11:56:17.2160483Z   local time: Mon Dec 30 11:56:17 UTC 2019
2019-12-30T11:56:17.2443381Z   network time: Mon, 30 Dec 2019 11:56:17 GMT
2019-12-30T11:56:17.2443568Z == end clock drift check ==
2019-12-30T11:56:28.4335215Z 
2019-12-30T11:56:28.4449135Z ##[error]Bash exited with code '1'.
2019-12-30T11:56:28.4481621Z ##[section]Starting: Checkout
2019-12-30T11:56:28.4483444Z ==============================================================================
2019-12-30T11:56:28.4483504Z Task         : Get sources
2019-12-30T11:56:28.4483553Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@jonas-schievink jonas-schievink added the relnotes Marks issues that should be documented in the release notes of the next release. label Dec 30, 2019
@jonas-schievink jonas-schievink added this to the 1.42 milestone Dec 30, 2019
@Centril Centril added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Dec 30, 2019
Copy link
Contributor

@jfrimmel jfrimmel left a comment

Choose a reason for hiding this comment

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

I'm pretty sure, that the new test doesn't work in the current form 😄

src/liballoc/tests/vec.rs Outdated Show resolved Hide resolved
src/liballoc/tests/vec.rs Outdated Show resolved Hide resolved
src/liballoc/tests/vec.rs Outdated Show resolved Hide resolved
src/liballoc/tests/vec.rs Outdated Show resolved Hide resolved
@rust-lang rust-lang deleted a comment from rust-highfive Dec 31, 2019
@Dylan-DPC-zz
Copy link
Author

@jfrimmel ye you right :D had a gcc issue so just went with the tests in blind form waiting for the CI to tell me what's wrong :P fixed everything now. Thanks for the review

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-12-31T06:52:12.8216044Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-31T06:52:12.8397746Z ##[command]git config gc.auto 0
2019-12-31T06:52:12.8469638Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-31T06:52:12.8524814Z ##[command]git config --get-all http.proxy
2019-12-31T06:52:12.8658826Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67727/merge:refs/remotes/pull/67727/merge

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@Dylan-DPC-zz
Copy link
Author

spurious...

@bors retry

@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 31, 2019
@Dylan-DPC-zz
Copy link
Author

@bors try

@bors
Copy link
Contributor

bors commented Dec 31, 2019

⌛ Trying commit 73ba2540a4fbc617d4e2a40e69c2c17fc6f2e4bf with merge 4e459c65afc2d20e94fcfa4ba6b68bccccca098e...

@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 31, 2019
@bors
Copy link
Contributor

bors commented Dec 31, 2019

☀️ Try build successful - checks-azure
Build commit: 4e459c65afc2d20e94fcfa4ba6b68bccccca098e (4e459c65afc2d20e94fcfa4ba6b68bccccca098e)

@timvermeulen
Copy link
Contributor

Many people suggested in the tracking issue to have this method take a &U with T: PartialEq<U> instead of a &T, shouldn't this be implemented before we stabilize this? In particular, this doesn't compile at the moment:

let mut vec = vec![String::from("foo")];
vec.remove_item("foo");
//              ^^^^^ expected struct `std::string::String`, found `str`

@Dylan-DPC-zz
Copy link
Author

Created a new PR that made that change. Blocked on #67873

@Dylan-DPC-zz Dylan-DPC-zz added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 4, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jan 6, 2020
…partial, r=Amanieu

change remove to have a PartialEq bound

Addresses [comment](rust-lang#67727 (comment)).

References rust-lang#40062

r? @Amanieu
@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Jan 6, 2020
@bors
Copy link
Contributor

bors commented Jan 6, 2020

📌 Commit 6bec8e9 has been approved by alexcrichton

@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 Jan 6, 2020
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-01-06T15:09:16.3887441Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-06T15:09:16.4089777Z ##[command]git config gc.auto 0
2020-01-06T15:09:16.4165842Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-06T15:09:16.4224476Z ##[command]git config --get-all http.proxy
2020-01-06T15:09:16.4386734Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67727/merge:refs/remotes/pull/67727/merge
---
2020-01-06T16:03:47.9903483Z .................................................................................................... 1500/9477
2020-01-06T16:03:53.8423549Z .................................................................................................... 1600/9477
2020-01-06T16:03:58.7239245Z .................................................................................................... 1700/9477
2020-01-06T16:04:08.0724491Z .................................................................................................... 1800/9477
2020-01-06T16:04:16.2894378Z .i.................................................................................................. 1900/9477
2020-01-06T16:04:22.9996130Z .........................................................................................iiiii...... 2000/9477
2020-01-06T16:04:45.1315284Z .................................................................................................... 2200/9477
2020-01-06T16:04:47.5066117Z .................................................................................................... 2300/9477
2020-01-06T16:04:49.9167588Z .................................................................................................... 2400/9477
2020-01-06T16:04:55.8792120Z .................................................................................................... 2500/9477
---
2020-01-06T16:07:54.6626609Z .....................i...............i.............................................................. 4900/9477
2020-01-06T16:08:04.3762681Z .................................................................................................... 5000/9477
2020-01-06T16:08:10.3836770Z ..................................................................i................................. 5100/9477
2020-01-06T16:08:18.3516155Z .................................................................................................... 5200/9477
2020-01-06T16:08:26.0114108Z .................................ii.ii...........i.................................................. 5300/9477
2020-01-06T16:08:35.3921262Z .................................................................................................... 5500/9477
2020-01-06T16:08:45.2430103Z .................................................................................................... 5600/9477
2020-01-06T16:08:52.7261967Z .................i.................................................................................. 5700/9477
2020-01-06T16:08:59.1248214Z .................................................................................................... 5800/9477
2020-01-06T16:08:59.1248214Z .................................................................................................... 5800/9477
2020-01-06T16:09:11.1488143Z .................................................................................................... 5900/9477
2020-01-06T16:09:23.0418440Z .......ii...i..ii...........i....................................................................... 6000/9477
2020-01-06T16:09:40.7638902Z .................................................................................................... 6200/9477
2020-01-06T16:09:48.5356576Z .................................................................................................... 6300/9477
2020-01-06T16:09:48.5356576Z .................................................................................................... 6300/9477
2020-01-06T16:10:02.6514263Z ..................................i..ii............................................................. 6400/9477
2020-01-06T16:10:23.8052838Z .................................................................................................... 6600/9477
2020-01-06T16:10:25.9740637Z .........i.......................................................................................... 6700/9477
2020-01-06T16:10:28.4240401Z .................................................................................................... 6800/9477
2020-01-06T16:10:31.0829847Z .........i.......................................................................................... 6900/9477
---
2020-01-06T16:12:08.9567430Z .................................................................................................... 7500/9477
2020-01-06T16:12:13.0601849Z .................................................................................................... 7600/9477
2020-01-06T16:12:18.2396419Z .................................................................................................... 7700/9477
2020-01-06T16:12:28.8536409Z .................................................................................................... 7800/9477
2020-01-06T16:12:37.2361113Z .............................................iiii................................................... 7900/9477
2020-01-06T16:12:52.0672397Z .................................................................................................... 8100/9477
2020-01-06T16:12:58.6182976Z .................................................................................................... 8200/9477
2020-01-06T16:13:14.0010464Z .................................................................................................... 8300/9477
2020-01-06T16:13:21.6208889Z .................................................................................................... 8400/9477
---
2020-01-06T16:15:44.5857093Z  finished in 6.667
2020-01-06T16:15:44.6035963Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-06T16:15:44.7589020Z 
2020-01-06T16:15:44.7589272Z running 166 tests
2020-01-06T16:15:47.9903679Z iiii......i........ii..iiii...i....i...........i............i..i..................i....i............ 100/166
2020-01-06T16:15:50.2034806Z i.i.i...iii..iiiiiii.......................iii............ii......
2020-01-06T16:15:50.2035583Z 
2020-01-06T16:15:50.2042033Z  finished in 5.600
2020-01-06T16:15:50.2222774Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-06T16:15:50.3808490Z 
---
2020-01-06T16:15:52.3161564Z  finished in 2.094
2020-01-06T16:15:52.3334349Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-06T16:15:52.4862711Z 
2020-01-06T16:15:52.4862963Z running 9 tests
2020-01-06T16:15:52.4863735Z iiiiiiiii
2020-01-06T16:15:52.4864126Z 
2020-01-06T16:15:52.4868798Z  finished in 0.153
2020-01-06T16:15:52.5039040Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-06T16:15:52.6680798Z 
---
2020-01-06T16:16:12.4817298Z  finished in 19.977
2020-01-06T16:16:12.5011114Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-06T16:16:12.6697124Z 
2020-01-06T16:16:12.6698015Z running 124 tests
2020-01-06T16:16:38.1776843Z .iiiii..ii.....i..i...i..i.i.i..i..i..iii....ii.ii....ii..........iiii..........i.....i..ii.......ii 100/124
2020-01-06T16:16:42.5052979Z .i.iii.....iiiiii.....ii
2020-01-06T16:16:42.5054414Z 
2020-01-06T16:16:42.5058511Z  finished in 30.004
2020-01-06T16:16:42.5065218Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-06T16:16:42.5066111Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2020-01-06T16:27:23.9416502Z   local time: Mon Jan  6 16:27:23 UTC 2020
2020-01-06T16:27:24.2387723Z   network time: Mon, 06 Jan 2020 16:27:24 GMT
2020-01-06T16:27:24.2392159Z == end clock drift check ==
2020-01-06T16:27:25.7163648Z 
2020-01-06T16:27:25.7285013Z ##[error]Bash exited with code '1'.
2020-01-06T16:27:25.7326927Z ##[section]Starting: Checkout
2020-01-06T16:27:25.7328911Z ==============================================================================
2020-01-06T16:27:25.7328993Z Task         : Get sources
2020-01-06T16:27:25.7329046Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexcrichton
Copy link
Member

@bors: r-

(CI failures)

@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 Jan 6, 2020
@Dylan-DPC-zz
Copy link
Author

ye forgot to remove 1 feature gate.. pushing it now :)

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jan 6, 2020

📌 Commit 503d06b has been approved by alexcrichton

@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 Jan 6, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jan 6, 2020
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 7, 2020
bors added a commit that referenced this pull request Jan 7, 2020
Rollup of 13 pull requests

Successful merges:

 - #67566 (Add an unstable conversion from thread ID to u64)
 - #67671 (Account for `type X = impl Trait;` in lifetime suggestion)
 - #67727 (Stabilise vec::remove_item)
 - #67877 (Omit underscore constants from rustdoc)
 - #67880 (Handle multiple error fix suggestions carefuly)
 - #67898 (Improve hygiene of `newtype_index`)
 - #67908 (rustdoc: HTML escape const values)
 - #67909 (Fix ICE in const pretty printing and resolve FIXME)
 - #67929 (Formatting an example for method Vec.retain)
 - #67934 (Clean up E0178 explanation)
 - #67936 (fire "non_camel_case_types" for associated types)
 - #67943 (Missing module std in example.)
 - #67962 (Update books)

Failed merges:

r? @ghost
@bors bors merged commit 503d06b into rust-lang:master Jan 7, 2020
@kornelski
Copy link
Contributor

Please don't stabilise it without fixing the name!

Please don't call it just remove_item, as this is the same name as in other languages that can remove item from an array by presenting an item from the same array. Rust's version can't do that due to borrow checker and it's a trap for users.

@Centril Centril removed the relnotes Marks issues that should be documented in the release notes of the next release. label Jan 10, 2020
@Centril Centril removed this from the 1.42 milestone Jan 10, 2020
tesuji added a commit to tesuji/rustc that referenced this pull request Jan 11, 2020
…item, r=alexcrichton"

This reverts commit 4ed415b, reversing
changes made to 3cce950.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 11, 2020
Centril added a commit to Centril/rust that referenced this pull request Jan 12, 2020
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-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking issue for Vec::remove_item