-
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
Binary operator LHS type is fixed instead of being subtyped #45425
Comments
eddyb
changed the title
LHS type is fixed instead of being subtyped
Binary operator LHS type is fixed instead of being subtyped
Oct 21, 2017
Old issue that duplicates this one #32008 |
This was referenced Oct 21, 2017
Closed
bors
added a commit
that referenced
this issue
Nov 1, 2017
rustc_typeck: use subtyping on the LHS of binops. Fixes #45425. r? @nikomatsakis
jturner314
added a commit
to jturner314/ndarray
that referenced
this issue
May 10, 2018
Rust 1.23 fixed the original issue (rust-ndarray#103) that required `'b` to be added. (See rust-lang/rust#32008, rust-lang/rust#45425, and rust-lang/rust#45435 for the relevant Rust issues/PRs.)
jturner314
added a commit
to jturner314/ndarray
that referenced
this issue
Jun 13, 2018
Rust 1.23 fixed the original issue (rust-ndarray#103) that required `'b` to be added. (See rust-lang/rust#32008, rust-lang/rust#45425, and rust-lang/rust#45435 for the relevant Rust issues/PRs.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This started with a Stack Overflow question which boiled down to:
Complete error
Some poking around found some workarounds:
If we say that the input references can be unified to the same
lifetime, it works:
If we say that
'b
outlives'a
, it works:If we say that we can have two different lifetimes in the operator, it works:
If we directly call the
Rem::rem
method, it works:If we dereference and re-reference, it works:
I poked @eddyb for further explanation why the original case didn't work. Our tidied IRC conversation:
The text was updated successfully, but these errors were encountered: