Add try_use_var method to cranelift-frontend.#4588
Merged
cfallin merged 4 commits intobytecodealliance:mainfrom Aug 4, 2022
Merged
Add try_use_var method to cranelift-frontend.#4588cfallin merged 4 commits intobytecodealliance:mainfrom
try_use_var method to cranelift-frontend.#4588cfallin merged 4 commits intobytecodealliance:mainfrom
Conversation
- Unlike `use_var`, this method does not panic if the variable has not been defined before use
afonso360
reviewed
Aug 3, 2022
Contributor
|
Should we do something similar to |
Contributor
Author
That makes sense to me. |
- Also implement Error for error enums.
cfallin
reviewed
Aug 3, 2022
Member
cfallin
left a comment
There was a problem hiding this comment.
Thanks! Looks good overall and this is a nice API improvement.
My main comment below is in the Display impls -- we should be able to use the write! convenience macro so we don't have to unroll what the format string would have done by hand. With that cleaned up, I'd be happy to merge this.
cfallin
reviewed
Aug 4, 2022
cfallin
approved these changes
Aug 4, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please ensure that the following steps are all taken care of before submitting
the PR.