3 // Demonstrates what's needed to make use of `?` in const contexts.
6 #![feature(try_trait_v2)]
7 #![feature(const_trait_impl)]
10 use std::ops::{ControlFlow, FromResidual, Try};
15 impl const FromResidual<Error> for TryMe {
16 fn from_residual(residual: Error) -> Self {
21 impl const Try for TryMe {
23 type Residual = Error;
24 fn from_output(output: Self::Output) -> Self {
27 fn branch(self) -> ControlFlow<Self::Residual, Self::Output> {
28 ControlFlow::Break(Error)
32 const fn t() -> TryMe {