-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Const Compare for Tuples #104125
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
@rustbot label +T-libs-api -T-libs |
You should clean up #104113 now. |
2cdff1e
to
4f5c6a5
Compare
Done |
src/test/ui/consts/fn_trait_refs.rs
Outdated
// 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)); |
There was a problem hiding this comment.
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 _: () = {}
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
4f5c6a5
to
721b443
Compare
721b443
to
b6c05eb
Compare
@bors r+ rollup |
…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`
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
…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```
…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``
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
Makes the impls for Tuples of ~const
PartialEq
types alsoPartialEq
, impls for Tuples of ~constPartialOrd
types alsoPartialOrd
, for Tuples of ~constOrd
types alsoOrd
.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