-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Bad error message with Self in inner function #12796
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
Comments
Can you provide the code that triggers the assertion as well? Ideally minimized as well, but we can attempt to do that as well. |
Here's a minimized (probably not minimal) non-working example:
|
I'll check whether I can reduce it furtherly. |
When I changed the third type of |
Updating title to ICE message. |
Now it's even shorter:
|
I just hit this. Oddly, in my original code, the ICE was actually " |
Updating, this is no longer an ICE but rather just a pretty bad error message. |
The example code still give bad error message above, but the problem is actually a different one today. |
BTW, no need to reopen this issue, #24968 already cover the new problem. |
chore: change str_ref_to_string to str_ref_to_owned `ToString` is implemented by many different types than `&str`, and represents a serialization into string data. The fact that said data is returned as owned, is an implementation detail resulting from the lack of a parameter for a pre-allocated buffer. If merely copying borrowed string data to owned string data is all that is desired, `ToOwned` is a much better choice, because if the user later refactors the code such that the input is no longer an `&str`, then they will get a compiler error instead of a mysterious runtime-behavioral change.
Updated example
Original issue
I have no idea where this came from, so here's a stacktrace.
The text was updated successfully, but these errors were encountered: