Skip to content

Commit 70f76a4

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 4007d4e + 20ce01d commit 70f76a4

File tree

3 files changed

+561
-467
lines changed

3 files changed

+561
-467
lines changed

src/librustc/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#![feature(thread_local)]
5151
#![feature(trace_macros)]
5252
#![feature(trusted_len)]
53+
#![feature(try_trait)]
5354
#![feature(vec_remove_item)]
5455
#![feature(stmt_expr_attributes)]
5556
#![feature(integer_atomics)]

0 commit comments

Comments
 (0)