-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Replace uses of Result, in which Err variant contains non-error type, with custom enums #93194
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
r? @lcnr |
These APIs were defined with
I guess here we mostly use it to return whatever the function name suggests in the |
To simplify reviewing I think it would be better to split up the PR into multiple commits or even multiple PRs, one for each new Regarding However, |
} | ||
|
||
impl<'tcx, Tag: Provenance> ImmediateOrMPlace<'tcx, Tag> { | ||
pub fn get_mplace(self) -> MPlaceTy<'tcx, Tag> { |
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.
Maybe unwrap_mplace
would be better? At least it indicates that this might panic.
How about something like |
☔ The latest upstream changes (presumably #94286) made this pull request unmergeable. Please resolve the merge conflicts. |
i think that's good enough, though at this point using |
@b-naber |
There are some functions that use Result::Err to return some value that isn't an error. I found these a little confusing, especially in contexts in which we have nested Result types.