Skip to content

Conversation

Kerollmops
Copy link
Contributor

@Kerollmops Kerollmops commented Jun 17, 2018

This PR propose to add two new methods to the slice, the group_by and group_by_mut. These two will provide a way to iterate over non-overlapping sub-slices of a base slice that are separated by the predicate given by the user (e.g. Partial::eq, |a, b| a.abs() < b.abs()).

An RFC has already been opened.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

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

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:04:58] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:58] tidy error: /checkout/src/libcore/slice/mod.rs:3963: line longer than 100 chars
[00:05:00] some tidy checks failed
[00:05:00] 
[00:05:00] 
[00:05:00] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:05:00] 
[00:05:00] 
[00:05:00] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:05:00] Build completed unsuccessfully in 0:01:48
[00:05:00] Build completed unsuccessfully in 0:01:48
[00:05:00] make: *** [tidy] Error 1
[00:05:00] Makefile:79: recipe for target 'tidy' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0f3df89c
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:0f682dde:start=1529235001557376032,finish=1529235001566097635,duration=8721603
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00e62ed2
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:101bc604
$ dmesg | grep -i kill

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 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 Jun 17, 2018
@rust-highfive
Copy link
Contributor

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.
[01:18:05] ....................................................................................................
[01:18:20] ....................................................................................................
[01:18:36] ....................................................................................................
[01:18:50] ....................................................................................................
[01:19:10] ..........................F.........................................................................
[01:19:27] failures:
[01:19:27] 
[01:19:27] ---- slice/mod.rs - slice::[T]::group_by_mut (line 848) stdout ----
[01:19:27] error[E0308]: mismatched types
[01:19:27] error[E0308]: mismatched types
[01:19:27]   --> slice/mod.rs:855:1
[01:19:27]    |
[01:19:27] 10 | assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
[01:19:27]    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
[01:19:27]    |
[01:19:27]    = note: expected type `std::option::Option<&mut [{integer}]>`
[01:19:27]               found type `std::option::Option<&[{integer}]>`
[01:19:27] 
[01:19:27] error[E0308]: mismatched types
[01:19:27]   --> slice/mod.rs:856:1
[01:19:27]    |
[01:19:27]    |
[01:19:27] 11 | assert_eq!(iter.next(), Some(&[3, 3][..]));
[01:19:27]    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
[01:19:27]    |
[01:19:27]    = note: expected type `std::option::Option<&mut [{integer}]>`
[01:19:27]               found type `std::option::Option<&[{integer}]>`
[01:19:27] 
[01:19:27] error[E0308]: mismatched types
[01:19:27]   --> slice/mod.rs:857:1
[01:19:27]    |
[01:19:27]    |
[01:19:27] 12 | assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
[01:19:27]    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
[01:19:/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release
59904 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/build
59488 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps
56708 ./obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu
56704 ./obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release

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)

@TimNN TimNN added A-allocators Area: Custom and system allocators and removed A-allocators Area: Custom and system allocators labels Jun 26, 2018
@pietroalbini
Copy link
Member

Closing this until the RFC is merged. When the RFC will be merged this will be reopened.

@pietroalbini pietroalbini added S-blocked-closed and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Jul 9, 2018
@jyn514 jyn514 added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-blocked-closed labels Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-blocked Status: Blocked on something else such as an RFC or other implementation work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants