Commit ca31dd2
committed
Auto merge of #65572 - ecstatic-morse:mir-visitor-break, r=<try>
Return early from a MIR `Visitor`
This allows functions to return a `Result` from the `visit_*` methods on a MIR `Visitor`. Returning an `Err` will stop visitation. This PR is an exploration of an idea I floated [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Early.20return.20from.20a.20MIR.20.60Visitor.60.3F). It shouldn't land as is.
The diff for the `is_min_const_fn`change is easier to read if whitespace is ignored.
r? @nikomatsakisFile tree
3 files changed
+548
-451
lines changed- src
- librustc_mir/transform
- librustc
- mir
3 files changed
+548
-451
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
0 commit comments