Skip to content

Commit

Permalink
Auto merge of #65572 - ecstatic-morse:mir-visitor-break, r=<try>
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Nov 2, 2019
2 parents f39205b + ef7bd53 commit ca31dd2
Show file tree
Hide file tree
Showing 3 changed files with 548 additions and 451 deletions.
1 change: 1 addition & 0 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#![feature(thread_local)]
#![feature(trace_macros)]
#![feature(trusted_len)]
#![feature(try_trait)]
#![feature(vec_remove_item)]
#![feature(stmt_expr_attributes)]
#![feature(integer_atomics)]
Expand Down
Loading

0 comments on commit ca31dd2

Please sign in to comment.