-
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
==
operator does not support subtyping
#27949
Comments
(Ignore this; the comment was completely off-base.) |
/cc @rust-lang/lang |
==
operator does not support subtyping
I've taken the liberty of renaming the issue to be more precise. The problem is that the |
Triage: no change |
The linked playground in the issue compiles fine now; all that is left to do is to add a compile-pass test for it. |
As detailed in the test comment, this was specifically fixed by 1a7fb7d. |
Test that binop subtyping in rustc_typeck fixes rust-lang#27949
Test that binop subtyping in rustc_typeck fixes rust-lang#27949
Rollup of 10 pull requests Successful merges: - #55632 (Deny the `overflowing_literals` lint for all editions) - #58687 (Reduce Miri Code Repetition like `(n << amt) >> amt`) - #58690 (Reduce a Code Repetition like `(n << amt) >> amt`) - #58718 (Apply docs convention: Replace # Unsafety with # Safety in docs) - #58719 (librustc_codegen_llvm: #![deny(elided_lifetimes_in_paths)]) - #58720 (librustc_codegen_ssa: #![deny(elided_lifetimes_in_paths)]) - #58722 (librustc_typeck: deny(elided_lifetimes_in_paths)) - #58723 (librustc: deny(elided_lifetimes_in_paths)) - #58725 (Test that binop subtyping in rustc_typeck fixes #27949) - #58727 (bootstrap: deny(rust_2018_idioms)) Failed merges: r? @ghost
Here's an example showing this behavior:
(https://play.rust-lang.org/?gist=c7b5d06f19fd345eef91)
Errors with:
Using
impl <'a, 'b> std::cmp::PartialEq<Input<'b>> for Input<'a>
works, but it is confusing why the below allows lifetime elision while the above doesn't. I would think it would make sense for the rust compiler to merge the minimum of two lifetimes ('a
and'b
) automatically when using==
if PartialEq is only implemented for one shared lifetime.The text was updated successfully, but these errors were encountered: