-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add a more precise error message for issue #35976 #43600
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
When trying to perform static dispatch on something which derefs to a trait object, and the target trait is not in scope, we had confusing error messages if the target method had a `Self: Sized` bound. We add a more precise error message in this case: "consider using trait ...". Fixes rust-lang#35976.
Thanks for the PR! We'll check in now and again to make sure @nikomatsakis or another reviewer gets to this soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me modulo the nit about the variable name
@@ -38,6 +38,11 @@ impl<'a, 'gcx, 'tcx> Deref for ConfirmContext<'a, 'gcx, 'tcx> { | |||
} | |||
} | |||
|
|||
pub struct ConfirmResult<'tcx> { | |||
pub callee: MethodCallee<'tcx>, | |||
pub rerun: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can we give this a more informative name? It seems that it actually means that there was an illegal sized bound, right?
@bors r=nikomatsakis |
📌 Commit e7e620d has been approved by |
Add a more precise error message for issue #35976 When trying to perform static dispatch on something which derefs to a trait object, and the target trait is not in scope, we had confusing error messages if the target method had a `Self: Sized` bound. We add a more precise error message in this case: "consider using trait ...". Fixes #35976. r? @nikomatsakis
☀️ Test successful - status-appveyor, status-travis |
Thanks for making this error better! I spent a lot of time puzzling over the current error message the last time I encountered it. |
When trying to perform static dispatch on something which derefs to a trait object, and the target trait is not in scope, we had confusing error messages if the target method had a
Self: Sized
bound. We add a more precise error message in this case: "consider using trait ...".Fixes #35976.
r? @nikomatsakis