Skip to content

You can't compare &mut i32 with &i32, but you can compare &i32 with &mut i32 #65589

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

Closed
Duddino opened this issue Oct 19, 2019 · 4 comments
Closed
Labels
A-type-system Area: Type system C-feature-request Category: A feature request, i.e: not implemented / a PR. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@Duddino
Copy link

Duddino commented Oct 19, 2019

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=11d3a2fe6f9ec8544d3f64917b99f913

@Centril Centril added T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. A-type-system Area: Type system labels Oct 19, 2019
@Centril
Copy link
Contributor

Centril commented Oct 19, 2019

Maybe this can be fixed by adding another impl? Not sure if this is typeck's fault or the lack of an impl...

@ecstatic-morse
Copy link
Contributor

ecstatic-morse commented Oct 19, 2019

Both impls already exist for PartialEq but not PartialOrd.

@Duddino
Copy link
Author

Duddino commented Oct 19, 2019

I can try adding impl for PartialOrd (as soon as I get back home) and if it fixes this I will make a PR

@inquisitivecrystal
Copy link
Contributor

Per #87328, it looks like this can't be solved backwards compatibly. I think a fix might require a change to the coercion rules. In any case, closing this issue.

@inquisitivecrystal inquisitivecrystal removed their assignment Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system C-feature-request Category: A feature request, i.e: not implemented / a PR. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants