-
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
libstd: Add unwrap_or and unwrap_or_handle to Result #13475
Conversation
I believe the current idea with the |
Oh, hm. Does anybody remember why we kept |
Well, I r+'d based on existing standards. |
@brson I think |
@sfackler Yeah that sounds reasonable. I don't recall why we removed the |
In the old implementation, all methods required a |
It might make more sense to mirror `Option`'s `unwrap_or_else` but I've left it as `handle` as it feels more explicit about the signature difference.
…, r=flodiebold fix: Test all generic args for trait when finding matching impl Addresses rust-lang/rust-analyzer#13463 (comment) When finding matching impl for a trait method, we've been testing the unifiability of self type. However, there can be multiple impl of a trait for the same type with different generic arguments for the trait. This patch takes it into account and tests the unifiability of all type arguments for the trait (the first being the self type) thus enables rust-analyzer to find the correct impl even in such cases.
It might make more sense to mirror
Option
'sunwrap_or_else
but I've left it ashandle
as it feels more explicit about the signature difference.