-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Trying to concatenate strings with operator += results in an Internal Compiler Error #11344
Comments
bors
added a commit
that referenced
this issue
Jan 10, 2014
…ichton So far the following code ``` struct Foo; fn main() { let mut t = Foo; let ref b = Foo; a += *b; } ``` errors with ``` test.rs:15:3: 13:11 error: binary operation + cannot be applied to type `Foo` test.rs:15 *a += *b; ``` Since assignment-operators are no longer expanded to ```left = left OP right``` but are independents operators it should be ``` test.rs:15:3: 13:11 error: binary operation += cannot be applied to type `Foo` test.rs:15 *a += *b; ``` to make it clear that implementing Add for Foo is not gonna work. (cf issues #11143, #11344) Besides that, we also need to typecheck the rhs expression even if the operator has no implementation, or we end up with unknown types for the nodes of the rhs and an ICE later on while resolving types. (once again cf #11143 and #11344). This probably would get fixed with #5992, but in the meantime it's a confusing error to stumble upon. @pcwalton, you wrote the original code, what do you think? (closes #11143 and #11344)
Is There anyway around this? |
Closed by #11449 (wasn't listed properly in the commit message). |
@RichardlL: This bug isn't present anymore. It's correctly reporting that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code produces an internal compiler error:
Compiler output:
The text was updated successfully, but these errors were encountered: