Skip to content

Commit

Permalink
Rollup merge of rust-lang#121256 - Jarcho:visitor2, r=oli-obk
Browse files Browse the repository at this point in the history
Allow AST and HIR visitors to return `ControlFlow`

Alternative to rust-lang#108598.

Since rust-lang/libs-team#187 was rejected, this implements our own version of the `Try` trait (`VisitorResult`) and the `try` macro (`try_visit`). Since this change still allows visitors to return `()`, no changes have been made to the existing ones. They can be done in a separate PR.
  • Loading branch information
saethlin committed Feb 20, 2024
2 parents 5c14f75 + 864cee3 commit ef2b714
Show file tree
Hide file tree
Showing 6 changed files with 959 additions and 769 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
#![allow(internal_features)]
#![feature(rustdoc_internals)]
#![feature(associated_type_bounds)]
#![feature(associated_type_defaults)]
#![feature(box_patterns)]
#![feature(if_let_guard)]
#![feature(let_chains)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(never_type)]
#![feature(negative_impls)]
#![feature(stmt_expr_attributes)]

Expand Down

0 comments on commit ef2b714

Please sign in to comment.