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

Stabilize iterator_repeat_with #51200

Merged
merged 1 commit into from
Jun 10, 2018
Merged

Conversation

tmccombs
Copy link
Contributor

Fixes #48169

@rust-highfive
Copy link
Collaborator

r? @aidanhs

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 30, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (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.
[00:41:45] .....................................................................i..............................
[00:41:49] ....................................................................................................
[00:41:54] ....................................................................................................
[00:42:00] ..................................................................................................i.
[00:42:03] ................iiiiiiiii...................................................
[00:42:03] 
[00:42:03] travis_fold:start:test_ui_nll
travis_time:start:test_ui_nll
Check compiletest suite=ui mode=ui compare_mode=nll (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
[00:42:50] .....................................................................i..............................
[00:42:54] ....................................................................................................
[00:42:58] ....................................................................................................
[00:43:04] ..................................................................................................i.
[00:43:07] ................iiiiiiiii...................................................
[00:43:07] 
[00:43:07]  finished in 63.865
[00:43:07] travis_fold:end:test_ui_nll

---
[01:03:37] travis_fold:start:test_stage1-core
travis_time:start:test_stage1-core
Testing core stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:03:37]    Compiling core v0.0.0 (file:///checkout/src/libcore)
[01:03:45] error[E0277]: the trait bound `std::iter::RepeatWith<[closure@libcore/../libcore/tests/iter.rs:1728:32: 1728:69 curr:_]>: std::iter::DoubleEndedIterator` is not satisfied
[01:03:45]     --> libcore/../libcore/tests/iter.rs:1729:22
[01:03:45]      |
[01:03:45] 1729 |                     .rev().take(4);
[01:03:45]      |                      ^^^ the trait `std::iter::DoubleEndedIterator` is not implemented for `std::iter::RepeatWith<[closure@libcore/../libcore/tests/iter.rs:1728:32: 1728:69 curr:_]>`
[01:03:45] 
[01:03:45] error[E0599]: no method named `take` found for type `std::iter::Rev<std::iter::RepeatWith<[closure@libcore/../libcore/tests/iter.rs:1728:32: 1728:69 curr:_]>>` in the current scope
[01:03:45]     --> libcore/../libcore/tests/iter.rs:1729:28
[01:03:45]      |
[01:03:45] 1729 |                     .rev().take(4);
[01:03:45]      |
[01:03:45]      |
[01:03:45]      = note: the method `take` exists but the following trait bounds were not satisfied:
[01:03:45]              `std::iter::Rev<std::iter::RepeatWith<[closure@libcore/../libcore/tests/iter.rs:1728:32: 1728:69 curr:_]>> : std::iter::Iterator`
[01:03:45]              `&mut std::iter::Rev<std::iter::RepeatWith<[closure@libcore/../libcore/tests/iter.rs:1728:32: 1728:69 curr:_]>> : std::iter::Iterator`
[01:03:51] error: aborting due to 2 previous errors
[01:03:51] 
[01:03:51] Some errors occurred: E0277, E0599.
[01:03:51] For more information about an error, try `rustc --explain E0277`.

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)

@kennytm kennytm added the relnotes Marks issues that should be documented in the release notes of the next release. label May 30, 2018
Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

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

Thanks for filing this! There's a minor adjustment needed.

@@ -209,7 +199,7 @@ unsafe impl<A, F: FnMut() -> A> TrustedLen for RepeatWith<F> {}
/// assert_eq!(None, pow2.next());
/// ```
#[inline]
#[unstable(feature = "iterator_repeat_with", issue = "48169")]
#[stable(feature = "iterator_repeat_with", since = "1.28.0")]
pub fn repeat_with<A, F: FnMut() -> A>(repeater: F) -> RepeatWith<F> {
Copy link
Contributor

Choose a reason for hiding this comment

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

There is some documentation re. DEI left that needs to be removed:

An iterator produced by repeat_with() is a DoubleEndedIterator. It is important to note that reversing repeat_with(f) will produce the exact same sequence as the non-reversed iterator. In other words, repeat_with(f).rev().collect::<Vec<_>>() is equivalent to repeat_with(f).collect::<Vec<_>>().

I would replace this with a note saying that it isn't DEI and to ask users who need that to come forward and file an issue explaining their use case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@kennytm
Copy link
Member

kennytm commented Jun 10, 2018

@bors r=Centril,kennytm

@bors
Copy link
Contributor

bors commented Jun 10, 2018

📌 Commit 87941b0 has been approved by Centril,kennytm

@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 Jun 10, 2018
@bors
Copy link
Contributor

bors commented Jun 10, 2018

⌛ Testing commit 87941b0 with merge c5a129e...

bors added a commit that referenced this pull request Jun 10, 2018
@bors
Copy link
Contributor

bors commented Jun 10, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: Centril,kennytm
Pushing c5a129e to master...

@bors bors merged commit 87941b0 into rust-lang:master Jun 10, 2018
@tmccombs tmccombs deleted the stable-iter-repeat-with branch August 16, 2018 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants