Skip to content

Commit ca31dd2

Browse files
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? @nikomatsakis
2 parents f39205b + ef7bd53 commit ca31dd2

File tree

3 files changed

+548
-451
lines changed

3 files changed

+548
-451
lines changed

src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#![feature(thread_local)]
5252
#![feature(trace_macros)]
5353
#![feature(trusted_len)]
54+
#![feature(try_trait)]
5455
#![feature(vec_remove_item)]
5556
#![feature(stmt_expr_attributes)]
5657
#![feature(integer_atomics)]

0 commit comments

Comments
 (0)