-
Notifications
You must be signed in to change notification settings - Fork 182
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
Use ControlFlow
in Visitor
#645
Conversation
} else { | ||
self.combine(op()) | ||
/// An copy of the unstable `std::ops::ControlFlow` for use in Chalk visitors. | ||
pub enum ControlFlow<B, C = ()> { |
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.
Perhaps this type should be #[must_use]
?
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.
FYI, this was also suggested in rust-lang/rust#78182 (comment) so I had opened rust-lang/rust#78202, but that PR didn't gather much attention.
☔ The latest upstream changes (presumably #648) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
9e763bd
to
c3d0a61
Compare
📌 Commit c3d0a61 has been approved by |
☀️ Test successful - checks-actions |
This PR (almost) resolves one of the differences between rustc's
TypeVisitor
and chalk'sVisitor
by adopting rustc's design withstd::ops::ControlFlow
.However as
std::ops::ControlFlow
is still unstable, this PR defines a duplicate ofControlFlow
inchalk_ir
along with atry_break!
macro which behaves liketry!
.