-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Derive Hash
for rustc_public types
#145018
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
Conversation
compiler/rustc_public/src/ty.rs
Outdated
@@ -255,7 +255,17 @@ pub struct Placeholder<T> { | |||
pub bound: T, | |||
} | |||
|
|||
#[derive(Clone, Copy, PartialEq, Eq, Serialize)] | |||
impl<T: std::hash::Hash> std::hash::Hash for Placeholder<T> { |
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.
Why isn't this also derived? If it's deriving Eq
and PartialEq
, it should almost certainly be deriving Hash
too.
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.
Sorry, my bad! I didn't realize the derive macro could handle generics. Just fixed this now
@rustbot ready |
Sounds good to me; these things that are already @bors r+ rollup |
…h, r=scottmcm Derive `Hash` for rustc_public types This derives `Hash` for the rustc_public versions of `Rvalue`, `Place`, `Span`, and all the types they contain. As far as I can tell, the internal versions of all these types already implement `Hash`, so it would be helpful if the public versions implemented it too!
Rollup of 8 pull requests Successful merges: - #144705 (compiler-builtins: plumb LSE support for aarch64 on linux/gnu when optimized-compiler-builtins not enabled) - #144857 (Port `#[allow_internal_unsafe]` to the new attribute system) - #144900 (Stabilize `unsigned_signed_diff` feature) - #144903 (Rename `begin_panic_handler` to `panic_handler`) - #144974 (compiler-builtins subtree update) - #145004 (Couple of minor cleanups) - #145007 (Fix build/doc/test of error index generator) - #145018 (Derive `Hash` for rustc_public types) r? `@ghost` `@rustbot` modify labels: rollup
…h, r=scottmcm Derive `Hash` for rustc_public types This derives `Hash` for the rustc_public versions of `Rvalue`, `Place`, `Span`, and all the types they contain. As far as I can tell, the internal versions of all these types already implement `Hash`, so it would be helpful if the public versions implemented it too!
…h, r=scottmcm Derive `Hash` for rustc_public types This derives `Hash` for the rustc_public versions of `Rvalue`, `Place`, `Span`, and all the types they contain. As far as I can tell, the internal versions of all these types already implement `Hash`, so it would be helpful if the public versions implemented it too!
Rollup of 9 pull requests Successful merges: - #144705 (compiler-builtins: plumb LSE support for aarch64 on linux/gnu when optimized-compiler-builtins not enabled) - #144857 (Port `#[allow_internal_unsafe]` to the new attribute system) - #144900 (Stabilize `unsigned_signed_diff` feature) - #144903 (Rename `begin_panic_handler` to `panic_handler`) - #144974 (compiler-builtins subtree update) - #145007 (Fix build/doc/test of error index generator) - #145018 (Derive `Hash` for rustc_public types) - #145045 (doc(library): Fix Markdown in `Iterator::by_ref`) - #145046 (Fix doc comment of File::try_lock and File::try_lock_shared) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #145018 - AlexanderPortland:rustc-public-hash, r=scottmcm Derive `Hash` for rustc_public types This derives `Hash` for the rustc_public versions of `Rvalue`, `Place`, `Span`, and all the types they contain. As far as I can tell, the internal versions of all these types already implement `Hash`, so it would be helpful if the public versions implemented it too!
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144705 (compiler-builtins: plumb LSE support for aarch64 on linux/gnu when optimized-compiler-builtins not enabled) - rust-lang/rust#144857 (Port `#[allow_internal_unsafe]` to the new attribute system) - rust-lang/rust#144900 (Stabilize `unsigned_signed_diff` feature) - rust-lang/rust#144903 (Rename `begin_panic_handler` to `panic_handler`) - rust-lang/rust#144974 (compiler-builtins subtree update) - rust-lang/rust#145007 (Fix build/doc/test of error index generator) - rust-lang/rust#145018 (Derive `Hash` for rustc_public types) - rust-lang/rust#145045 (doc(library): Fix Markdown in `Iterator::by_ref`) - rust-lang/rust#145046 (Fix doc comment of File::try_lock and File::try_lock_shared) r? `@ghost` `@rustbot` modify labels: rollup
This derives
Hash
for the rustc_public versions ofRvalue
,Place
,Span
, and all the types they contain. As far as I can tell, the internal versions of all these types already implementHash
, so it would be helpful if the public versions implemented it too!