-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
remove StructuralEq trait #116167
remove StructuralEq trait #116167
Conversation
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in compiler/rustc_codegen_gcc cc @antoyo Changes to the code generated for builtin derived traits. cc @nnethercote Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
@compiler-errors you said you'd have opinions/questions about this one. :) |
This comment has been minimized.
This comment has been minimized.
1af7985
to
a9f5190
Compare
Some changes occurred in compiler/rustc_codegen_gcc cc @antoyo Changes to the code generated for builtin derived traits. cc @nnethercote Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
I agree that I am a bit unsure whether this makes sense as a transition step. If we allow all types implementing Given that we currently try to use constants of all allowed types for exhaustiveness checking, allowing more types by removing the "derives |
Hm, that's fair. We could do what the comment on |
Marking as blocked on rust-lang/lang-team#220. |
☔ The latest upstream changes (presumably #116260) made this pull request unmergeable. Please resolve the merge conflicts. |
rust-lang/rfcs#3535 motivates why we don't need the |
039a468
to
d25bee7
Compare
This comment has been minimized.
This comment has been minimized.
d25bee7
to
26b113b
Compare
☔ The latest upstream changes (presumably #119088) made this pull request unmergeable. Please resolve the merge conflicts. |
26b113b
to
0df7810
Compare
@lcnr @cjgillot with rust-lang/rfcs#3535 having been accepted, I think this should be ready to go? |
remove StructuralEq trait The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more. One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust rust-lang#115893 to check for `Eq`, and rule out float matching for good. Fixes rust-lang#115881
💥 Test timed out |
@bors retry timeout |
remove StructuralEq trait The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more. One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust rust-lang#115893 to check for `Eq`, and rule out float matching for good. Fixes rust-lang#115881
💥 Test timed out |
@bors retry timeout |
☀️ Test successful - checks-actions |
Finished benchmarking commit (dd2559e): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 662.586s -> 663.451s (0.13%) |
remove StructuralEq trait The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more. One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust rust-lang#115893 to check for `Eq`, and rule out float matching for good. Fixes rust-lang#115881
remove StructuralEq trait The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more. One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust rust-lang#115893 to check for `Eq`, and rule out float matching for good. Fixes rust-lang#115881
remove StructuralEq trait The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more. One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust rust-lang#115893 to check for `Eq`, and rule out float matching for good. Fixes rust-lang#115881
The documentation given for the trait is outdated: all function pointers implement
PartialEq
andEq
these days. So theStructuralEq
trait doesn't really seem to have any reason to exist any more.One side-effect of this PR is that we allow matching on some consts that do not implement
Eq
. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require anEq
instance. If we want to requireEq
we should adjust #115893 to check forEq
, and rule out float matching for good.Fixes #115881