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

Const Compare for Tuples #104125

Merged
merged 2 commits into from
Nov 9, 2022
Merged

Conversation

onestacked
Copy link
Contributor

@onestacked onestacked commented Nov 7, 2022

Makes the impls for Tuples of ~const PartialEq types also PartialEq, impls for Tuples of ~const PartialOrd types also PartialOrd, for Tuples of ~const Ord types also Ord.

behind the #![feature(const_cmp)] gate.

Do not merge before #104113 is merged because I want to use this feature to clean up the new test that I added there.

r? @fee1-dead

@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 7, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 7, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@onestacked
Copy link
Contributor Author

@rustbot label +T-libs-api -T-libs

@rustbot rustbot added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 7, 2022
@fee1-dead
Copy link
Member

You should clean up #104113 now.

@onestacked
Copy link
Contributor Author

You should clean up #104113 now.

Done

Comment on lines 71 to 75
// FIXME(const_cmp_tuple)
let test_one = test_fn(one);
assert!(test_one.0 == 1);
assert!(test_one.1 == 1);
assert!(test_one.2 == 1);
assert!(test_one == (1, 1, 1));

let test_two = test_fn_mut(two);
assert!(test_two.0 == 1);
assert!(test_two.1 == 1);
assert!(test_two == (2, 2));
Copy link
Member

Choose a reason for hiding this comment

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

These asserts don't work unless you put them in a const item, const _: () = {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are in const fn main()

Copy link
Member

Choose a reason for hiding this comment

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

they don't work that way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahh right that only checks that i builds

@fee1-dead
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 9, 2022

📌 Commit b6c05eb has been approved by fee1-dead

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 Nov 9, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Nov 9, 2022
…r=fee1-dead

Const Compare for Tuples

Makes the impls for Tuples of ~const `PartialEq` types also `PartialEq`, impls for Tuples of ~const `PartialOrd` types also `PartialOrd`, for Tuples of ~const `Ord` types also `Ord`.

behind the `#![feature(const_cmp)]` gate.

~~Do not merge before rust-lang#104113 is merged because I want to use this feature to clean up the new test that I added there.~~

r? `@fee1-dead`
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 9, 2022
Rollup of 7 pull requests

Successful merges:

 - rust-lang#103570 (Stabilize integer logarithms)
 - rust-lang#103694 (Add documentation examples for `pointer::mask`)
 - rust-lang#103919 (Unescaping cleanups)
 - rust-lang#103933 (Promote {aarch64,i686,x86_64}-unknown-uefi to Tier 2)
 - rust-lang#103952 (Don't intra linkcheck reference)
 - rust-lang#104111 (rustdoc: Add mutable to the description)
 - rust-lang#104125 (Const Compare for Tuples)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 9, 2022
…r=fee1-dead

Const Compare for Tuples

Makes the impls for Tuples of ~const `PartialEq` types also `PartialEq`, impls for Tuples of ~const `PartialOrd` types also `PartialOrd`, for Tuples of ~const `Ord` types also `Ord`.

behind the `#![feature(const_cmp)]` gate.

~~Do not merge before rust-lang#104113 is merged because I want to use this feature to clean up the new test that I added there.~~

r? ```@fee1-dead```
@bors bors merged commit 062f2fc into rust-lang:master Nov 9, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 9, 2022
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
…r=fee1-dead

Const Compare for Tuples

Makes the impls for Tuples of ~const `PartialEq` types also `PartialEq`, impls for Tuples of ~const `PartialOrd` types also `PartialOrd`, for Tuples of ~const `Ord` types also `Ord`.

behind the `#![feature(const_cmp)]` gate.

~~Do not merge before rust-lang#104113 is merged because I want to use this feature to clean up the new test that I added there.~~

r? ``@fee1-dead``
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
Rollup of 7 pull requests

Successful merges:

 - rust-lang#103570 (Stabilize integer logarithms)
 - rust-lang#103694 (Add documentation examples for `pointer::mask`)
 - rust-lang#103919 (Unescaping cleanups)
 - rust-lang#103933 (Promote {aarch64,i686,x86_64}-unknown-uefi to Tier 2)
 - rust-lang#103952 (Don't intra linkcheck reference)
 - rust-lang#104111 (rustdoc: Add mutable to the description)
 - rust-lang#104125 (Const Compare for Tuples)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@onestacked onestacked deleted the const_cmp_tuples branch February 4, 2023 16:29
@fee1-dead fee1-dead added the PG-const-traits Project group: Const traits label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PG-const-traits Project group: Const traits 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.

4 participants