-
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
Kind checker is not aware of bounds on overloaded operators #2587
Comments
The problem seems to be here (in kind.rs):
In the test case for #2548, the self argument is in last-use position, so this code doesn't count it as a copy. In cases of overloaded operators that require a copy bound, I'm not sure the last-use optimization is legal. |
this will require more temporaries, but is probably less magical. also, it means that borrowck matches trans better, so fewer crashes. bonus. Finally, stop warning about implicit copies when we are actually borrowing. Also, one test (vec-res-add) stopped failing due to #2587, and hence I added an xfail-test. Fixes #3217, #2977, #3067
Reproduced again. I'll work on it. |
Here is the general sketch of a test case for this:
However, you have to rewrite it to use (1) overloaded operators, not function calls and (2) actual types :) |
add josh instructions This explains how to sync Miri changes to and from rustc.
add josh instructions This explains how to sync Miri changes to and from rustc.
This leads to us copying things we shouldn't when the impl has a copy bound.
The text was updated successfully, but these errors were encountered: