Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/util.rs')
| -rw-r--r-- | crates/hir-ty/src/next_solver/util.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/hir-ty/src/next_solver/util.rs b/crates/hir-ty/src/next_solver/util.rs index 7e40e3c17d..e384ac4552 100644 --- a/crates/hir-ty/src/next_solver/util.rs +++ b/crates/hir-ty/src/next_solver/util.rs @@ -723,3 +723,15 @@ pub(crate) fn clauses_as_obligations<'db>( recursion_depth: 0, }) } + +/// Copied from +/// <https://github.com/jdonszelmann/rust/blob/180725cff61d00dd1b9c35fc720a8befaec5d46b/compiler/rustc_middle/src/ty/context/impl_interner.rs#L534-L541> +#[macro_export] +macro_rules! ret { + ($e: expr) => { + match $e.branch() { + ::std::ops::ControlFlow::Break(b) => return R::from_residual(b), + ::std::ops::ControlFlow::Continue(()) => {} + } + }; +} |