-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Confusing error when using CoercePointee #134846
Comments
I just learned of this issue. Thoughts @dingxiangfei2009? Could we utilize the traits from #136107 to emit better errors? |
@Darksonn honestly I was pondering about this problem yesterday but I wasn't aware of this ticket that was filed. The check can definitely be performed with the new trait. The next step I will need to look into, is to devise a method to suppress the errors when checks with CoercePointee have failed. Or I suspect the better way could be, when the coherence check for DispatchFromDyn and CoerceUnsize is initiated, the check would attempt to determine if a CoercePointee is indeed to be derived on the target and present the error with the correct wording intended for CoercePointee accordingly. I will start with this approach first. |
Fixed by #137289 |
@compiler-errors assuming this is indeed adequately resolved. |
The code above currently fails with:
|
Error message could still use some work. If y'all have a better way to phrase "{type} must be a pointer that can be unsized {in some param T}" then lemme know, and I can tweak it further. |
Code
Current output
Desired output
Rationale and extra context
No response
Other cases
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: