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 order methods for homogeneous 2-tuple #119326

Closed
wants to merge 1 commit into from

Conversation

henrispriet
Copy link
Contributor

I added some niche methods for homogeneous 2-tuples.
I'd be glad to hear any improvements for the docs.
I wasn't sure what to put for the stability attribute, so if anyone can help me with that too, it'd be much appreciated!

@rustbot
Copy link
Collaborator

rustbot commented Dec 26, 2023

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

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@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 Dec 26, 2023
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=henrispriet
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_dbb4e65f-6989-4866-8693-6e67b4559fb7
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=830ff91407fbc80e24474e016a92db1d1ccde9d3
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_dbb4e65f-6989-4866-8693-6e67b4559fb7
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_dbb4e65f-6989-4866-8693-6e67b4559fb7
GITHUB_TRIGGERING_ACTOR=henrispriet
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/119326/merge
GITHUB_WORKFLOW_SHA=830ff91407fbc80e24474e016a92db1d1ccde9d3
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
............................FFF...

failures:

---- library/core/src/tuple.rs - tuple::(T,T)::order (line 14) stdout ----
error: cannot find macro `asssert_eq` in this scope
##[error]  --> library/core/src/tuple.rs:24:1
   |
13 | asssert_eq!(c, d);
   | ^^^^^^^^^^ help: a macro with a similar name exists: `assert_eq`
  ::: /checkout/library/core/src/macros/mod.rs:36:1
   |
36 | macro_rules! assert_eq {
   | ---------------------- similarly named macro `assert_eq` defined here
   | ---------------------- similarly named macro `assert_eq` defined here

error: aborting due to 1 previous error

Couldn't compile the test.
---- library/core/src/tuple.rs - tuple::(T,T)::order_by (line 43) stdout ----
error: cannot find macro `asssert_eq` in this scope
##[error]  --> library/core/src/tuple.rs:51:1
   |
11 | asssert_eq!(a.len(), b.len());
   | ^^^^^^^^^^ help: a macro with a similar name exists: `assert_eq`
  ::: /checkout/library/core/src/macros/mod.rs:36:1
   |
36 | macro_rules! assert_eq {
   | ---------------------- similarly named macro `assert_eq` defined here
   | ---------------------- similarly named macro `assert_eq` defined here

error: aborting due to 1 previous error

Couldn't compile the test.
---- library/core/src/tuple.rs - tuple::(T,T)::order_by_key (line 67) stdout ----
error: cannot find macro `asssert_eq` in this scope
##[error]  --> library/core/src/tuple.rs:75:1
   |
11 | asssert_eq!(a.len(), b.len());
   | ^^^^^^^^^^ help: a macro with a similar name exists: `assert_eq`
  ::: /checkout/library/core/src/macros/mod.rs:36:1
   |
36 | macro_rules! assert_eq {
   | ---------------------- similarly named macro `assert_eq` defined here
   | ---------------------- similarly named macro `assert_eq` defined here

error[E0308]: mismatched types
##[error] --> library/core/src/tuple.rs:72:55
  |
8 | let (short, long) = (&mut a, &mut b).order_by_key(|v| v.len());
  |                                                       ^^^^^^^ expected `&_`, found `usize`
  = note: expected reference `&_`
                  found type `usize`
help: try removing the method call
  |
  |
8 - let (short, long) = (&mut a, &mut b).order_by_key(|v| v.len());
8 + let (short, long) = (&mut a, &mut b).order_by_key(|v| v);

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
For more information about this error, try `rustc --explain E0308`.
Couldn't compile the test.

failures:
    library/core/src/tuple.rs - tuple::(T,T)::order (line 14)
    library/core/src/tuple.rs - tuple::(T,T)::order_by (line 43)
    library/core/src/tuple.rs - tuple::(T,T)::order_by_key (line 67)
test result: FAILED. 4213 passed; 3 failed; 42 ignored; 0 measured; 0 filtered out; finished in 128.51s


error: doctest failed, to rerun pass `-p core --doc`
  local time: Tue Dec 26 19:15:32 UTC 2023
  network time: Tue, 26 Dec 2023 19:15:32 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@Noratrieb
Copy link
Member

Thank you for the PR! This PR contains a public library API change, which should follow the proper process: https://std-dev-guide.rust-lang.org/development/feature-lifecycle.html

@henrispriet
Copy link
Contributor Author

Thank you for the PR! This PR contains a public library API change, which should follow the proper process: https://std-dev-guide.rust-lang.org/development/feature-lifecycle.html

My bad! Will do!

@henrispriet
Copy link
Contributor Author

Turns out something like this is already being worked on (#115939), oops 😅

@henrispriet henrispriet deleted the tuple-order branch December 27, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants