From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/try-trait/bad-interconversion.rs | 48 ---------- src/test/ui/try-trait/bad-interconversion.stderr | 103 --------------------- src/test/ui/try-trait/option-to-result.rs | 13 --- src/test/ui/try-trait/option-to-result.stderr | 31 ------- src/test/ui/try-trait/try-as-monad.rs | 24 ----- src/test/ui/try-trait/try-on-option-diagnostics.rs | 47 ---------- .../ui/try-trait/try-on-option-diagnostics.stderr | 47 ---------- src/test/ui/try-trait/try-on-option.rs | 13 --- src/test/ui/try-trait/try-on-option.stderr | 28 ------ src/test/ui/try-trait/try-operator-custom.rs | 91 ------------------ src/test/ui/try-trait/try-operator-on-main.rs | 22 ----- src/test/ui/try-trait/try-operator-on-main.stderr | 53 ----------- src/test/ui/try-trait/try-poll.rs | 50 ---------- src/test/ui/try-trait/yeet-for-option.rs | 11 --- src/test/ui/try-trait/yeet-for-result.rs | 11 --- 15 files changed, 592 deletions(-) delete mode 100644 src/test/ui/try-trait/bad-interconversion.rs delete mode 100644 src/test/ui/try-trait/bad-interconversion.stderr delete mode 100644 src/test/ui/try-trait/option-to-result.rs delete mode 100644 src/test/ui/try-trait/option-to-result.stderr delete mode 100644 src/test/ui/try-trait/try-as-monad.rs delete mode 100644 src/test/ui/try-trait/try-on-option-diagnostics.rs delete mode 100644 src/test/ui/try-trait/try-on-option-diagnostics.stderr delete mode 100644 src/test/ui/try-trait/try-on-option.rs delete mode 100644 src/test/ui/try-trait/try-on-option.stderr delete mode 100644 src/test/ui/try-trait/try-operator-custom.rs delete mode 100644 src/test/ui/try-trait/try-operator-on-main.rs delete mode 100644 src/test/ui/try-trait/try-operator-on-main.stderr delete mode 100644 src/test/ui/try-trait/try-poll.rs delete mode 100644 src/test/ui/try-trait/yeet-for-option.rs delete mode 100644 src/test/ui/try-trait/yeet-for-result.rs (limited to 'src/test/ui/try-trait') diff --git a/src/test/ui/try-trait/bad-interconversion.rs b/src/test/ui/try-trait/bad-interconversion.rs deleted file mode 100644 index 385f5510f..000000000 --- a/src/test/ui/try-trait/bad-interconversion.rs +++ /dev/null @@ -1,48 +0,0 @@ -#![feature(control_flow_enum)] - -use std::ops::ControlFlow; - -fn result_to_result() -> Result { - Ok(Err(123_i32)?) - //~^ ERROR `?` couldn't convert the error to `u8` -} - -fn option_to_result() -> Result { - Some(3)?; - //~^ ERROR the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result` - Ok(10) -} - -fn control_flow_to_result() -> Result { - Ok(ControlFlow::Break(123)?) - //~^ ERROR the `?` operator can only be used on `Result`s in a function that returns `Result` -} - -fn result_to_option() -> Option { - Some(Err("hello")?) - //~^ ERROR the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option` -} - -fn control_flow_to_option() -> Option { - Some(ControlFlow::Break(123)?) - //~^ ERROR the `?` operator can only be used on `Option`s in a function that returns `Option` -} - -fn result_to_control_flow() -> ControlFlow { - ControlFlow::Continue(Err("hello")?) - //~^ ERROR the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow` -} - -fn option_to_control_flow() -> ControlFlow { - Some(3)?; - //~^ ERROR the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow` - ControlFlow::Break(10) -} - -fn control_flow_to_control_flow() -> ControlFlow { - ControlFlow::Break(4_u8)?; - //~^ ERROR the `?` operator in a function that returns `ControlFlow` can only be used on other `ControlFlow`s - ControlFlow::Continue(()) -} - -fn main() {} diff --git a/src/test/ui/try-trait/bad-interconversion.stderr b/src/test/ui/try-trait/bad-interconversion.stderr deleted file mode 100644 index a49630adb..000000000 --- a/src/test/ui/try-trait/bad-interconversion.stderr +++ /dev/null @@ -1,103 +0,0 @@ -error[E0277]: `?` couldn't convert the error to `u8` - --> $DIR/bad-interconversion.rs:6:20 - | -LL | fn result_to_result() -> Result { - | --------------- expected `u8` because of this -LL | Ok(Err(123_i32)?) - | ^ the trait `From` is not implemented for `u8` - | - = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait - = help: the following other types implement trait `From`: - > - > - = note: required for `Result` to implement `FromResidual>` - -error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result` - --> $DIR/bad-interconversion.rs:11:12 - | -LL | fn option_to_result() -> Result { - | -------------------------------------------- this function returns a `Result` -LL | Some(3)?; - | ^ use `.ok_or(...)?` to provide an error compatible with `Result` - | - = help: the trait `FromResidual>` is not implemented for `Result` - = help: the following other types implement trait `FromResidual`: - as FromResidual>> - as FromResidual>> - -error[E0277]: the `?` operator can only be used on `Result`s in a function that returns `Result` - --> $DIR/bad-interconversion.rs:17:31 - | -LL | fn control_flow_to_result() -> Result { - | -------------------------------------------------- this function returns a `Result` -LL | Ok(ControlFlow::Break(123)?) - | ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Result` - | - = help: the trait `FromResidual>` is not implemented for `Result` - = help: the following other types implement trait `FromResidual`: - as FromResidual>> - as FromResidual>> - -error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option` - --> $DIR/bad-interconversion.rs:22:22 - | -LL | fn result_to_option() -> Option { - | ------------------------------------ this function returns an `Option` -LL | Some(Err("hello")?) - | ^ use `.ok()?` if you want to discard the `Result` error information - | - = help: the trait `FromResidual>` is not implemented for `Option` - = help: the following other types implement trait `FromResidual`: - as FromResidual>> - as FromResidual> - -error[E0277]: the `?` operator can only be used on `Option`s in a function that returns `Option` - --> $DIR/bad-interconversion.rs:27:33 - | -LL | fn control_flow_to_option() -> Option { - | ------------------------------------------ this function returns an `Option` -LL | Some(ControlFlow::Break(123)?) - | ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Option` - | - = help: the trait `FromResidual>` is not implemented for `Option` - = help: the following other types implement trait `FromResidual`: - as FromResidual>> - as FromResidual> - -error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow` - --> $DIR/bad-interconversion.rs:32:39 - | -LL | fn result_to_control_flow() -> ControlFlow { - | -------------------------------------------------- this function returns a `ControlFlow` -LL | ControlFlow::Continue(Err("hello")?) - | ^ this `?` produces `Result`, which is incompatible with `ControlFlow` - | - = help: the trait `FromResidual>` is not implemented for `ControlFlow` - = help: the trait `FromResidual` is implemented for `ControlFlow` - -error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow` - --> $DIR/bad-interconversion.rs:37:12 - | -LL | fn option_to_control_flow() -> ControlFlow { - | ----------------------------------------------- this function returns a `ControlFlow` -LL | Some(3)?; - | ^ this `?` produces `Option`, which is incompatible with `ControlFlow` - | - = help: the trait `FromResidual>` is not implemented for `ControlFlow` - = help: the trait `FromResidual` is implemented for `ControlFlow` - -error[E0277]: the `?` operator in a function that returns `ControlFlow` can only be used on other `ControlFlow`s (with the same Break type) - --> $DIR/bad-interconversion.rs:43:29 - | -LL | fn control_flow_to_control_flow() -> ControlFlow { - | ----------------------------------------------------- this function returns a `ControlFlow` -LL | ControlFlow::Break(4_u8)?; - | ^ this `?` produces `ControlFlow`, which is incompatible with `ControlFlow` - | - = help: the trait `FromResidual>` is not implemented for `ControlFlow` - = note: unlike `Result`, there's no `From`-conversion performed for `ControlFlow` - = help: the trait `FromResidual` is implemented for `ControlFlow` - -error: aborting due to 8 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/try-trait/option-to-result.rs b/src/test/ui/try-trait/option-to-result.rs deleted file mode 100644 index 45aaf361a..000000000 --- a/src/test/ui/try-trait/option-to-result.rs +++ /dev/null @@ -1,13 +0,0 @@ -fn main(){ } - -fn test_result() -> Result<(),()> { - let a:Option<()> = Some(()); - a?;//~ ERROR the `?` operator can only be used - Ok(()) -} - -fn test_option() -> Option{ - let a:Result = Ok(5); - a?;//~ ERROR the `?` operator can only be used - Some(5) -} diff --git a/src/test/ui/try-trait/option-to-result.stderr b/src/test/ui/try-trait/option-to-result.stderr deleted file mode 100644 index fabc1ff2c..000000000 --- a/src/test/ui/try-trait/option-to-result.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result` - --> $DIR/option-to-result.rs:5:6 - | -LL | fn test_result() -> Result<(),()> { - | --------------------------------- this function returns a `Result` -LL | let a:Option<()> = Some(()); -LL | a?; - | ^ use `.ok_or(...)?` to provide an error compatible with `Result<(), ()>` - | - = help: the trait `FromResidual>` is not implemented for `Result<(), ()>` - = help: the following other types implement trait `FromResidual`: - as FromResidual>> - as FromResidual>> - -error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option` - --> $DIR/option-to-result.rs:11:6 - | -LL | fn test_option() -> Option{ - | ------------------------------- this function returns an `Option` -LL | let a:Result = Ok(5); -LL | a?; - | ^ use `.ok()?` if you want to discard the `Result` error information - | - = help: the trait `FromResidual>` is not implemented for `Option` - = help: the following other types implement trait `FromResidual`: - as FromResidual>> - as FromResidual> - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/try-trait/try-as-monad.rs b/src/test/ui/try-trait/try-as-monad.rs deleted file mode 100644 index cf09838b3..000000000 --- a/src/test/ui/try-trait/try-as-monad.rs +++ /dev/null @@ -1,24 +0,0 @@ -// run-pass - -#![feature(try_trait_v2)] - -use std::ops::Try; - -fn monad_unit(x: ::Output) -> T { - T::from_output(x) -} - -fn monad_bind, T2: Try, R>( - mx: T1, - f: impl FnOnce(::Output) -> T2) --> T2 { - let x = mx?; - f(x) -} - -fn main() { - let mx: Option = monad_unit(1); - let my = monad_bind(mx, |x| Some(x + 1)); - let mz = monad_bind(my, |x| Some(-x)); - assert_eq!(mz, Some(-2)); -} diff --git a/src/test/ui/try-trait/try-on-option-diagnostics.rs b/src/test/ui/try-trait/try-on-option-diagnostics.rs deleted file mode 100644 index 7ffa0de6c..000000000 --- a/src/test/ui/try-trait/try-on-option-diagnostics.rs +++ /dev/null @@ -1,47 +0,0 @@ -// edition:2018 - -fn main() {} - -fn a_function() -> u32 { - let x: Option = None; - x?; //~ ERROR the `?` operator - 22 -} - -fn a_closure() -> u32 { - let a_closure = || { - let x: Option = None; - x?; //~ ERROR the `?` operator - 22 - }; - a_closure() -} - -fn a_method() -> u32 { - struct S; - - impl S { - fn a_method() { - let x: Option = None; - x?; //~ ERROR the `?` operator - } - } - - S::a_method(); - 22 -} - -fn a_trait_method() -> u32 { - struct S; - trait T { - fn a_trait_method() { - let x: Option = None; - x?; //~ ERROR the `?` operator - } - } - - impl T for S { } - - S::a_trait_method(); - 22 -} diff --git a/src/test/ui/try-trait/try-on-option-diagnostics.stderr b/src/test/ui/try-trait/try-on-option-diagnostics.stderr deleted file mode 100644 index 9ee540c79..000000000 --- a/src/test/ui/try-trait/try-on-option-diagnostics.stderr +++ /dev/null @@ -1,47 +0,0 @@ -error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/try-on-option-diagnostics.rs:7:6 - | -LL | fn a_function() -> u32 { - | ---------------------- this function should return `Result` or `Option` to accept `?` -LL | let x: Option = None; -LL | x?; - | ^ cannot use the `?` operator in a function that returns `u32` - | - = help: the trait `FromResidual>` is not implemented for `u32` - -error[E0277]: the `?` operator can only be used in a closure that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/try-on-option-diagnostics.rs:14:10 - | -LL | let a_closure = || { - | -- this function should return `Result` or `Option` to accept `?` -LL | let x: Option = None; -LL | x?; - | ^ cannot use the `?` operator in a closure that returns `{integer}` - | - = help: the trait `FromResidual>` is not implemented for `{integer}` - -error[E0277]: the `?` operator can only be used in a method that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/try-on-option-diagnostics.rs:26:14 - | -LL | fn a_method() { - | ------------- this function should return `Result` or `Option` to accept `?` -LL | let x: Option = None; -LL | x?; - | ^ cannot use the `?` operator in a method that returns `()` - | - = help: the trait `FromResidual>` is not implemented for `()` - -error[E0277]: the `?` operator can only be used in a trait method that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/try-on-option-diagnostics.rs:39:14 - | -LL | fn a_trait_method() { - | ------------------- this function should return `Result` or `Option` to accept `?` -LL | let x: Option = None; -LL | x?; - | ^ cannot use the `?` operator in a trait method that returns `()` - | - = help: the trait `FromResidual>` is not implemented for `()` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/try-trait/try-on-option.rs b/src/test/ui/try-trait/try-on-option.rs deleted file mode 100644 index 8519932a6..000000000 --- a/src/test/ui/try-trait/try-on-option.rs +++ /dev/null @@ -1,13 +0,0 @@ -fn main() {} - -fn foo() -> Result { - let x: Option = None; - x?; //~ ERROR the `?` operator - Ok(22) -} - -fn bar() -> u32 { - let x: Option = None; - x?; //~ ERROR the `?` operator - 22 -} diff --git a/src/test/ui/try-trait/try-on-option.stderr b/src/test/ui/try-trait/try-on-option.stderr deleted file mode 100644 index fad6a1fe8..000000000 --- a/src/test/ui/try-trait/try-on-option.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result` - --> $DIR/try-on-option.rs:5:6 - | -LL | fn foo() -> Result { - | --------------------------- this function returns a `Result` -LL | let x: Option = None; -LL | x?; - | ^ use `.ok_or(...)?` to provide an error compatible with `Result` - | - = help: the trait `FromResidual>` is not implemented for `Result` - = help: the following other types implement trait `FromResidual`: - as FromResidual>> - as FromResidual>> - -error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/try-on-option.rs:11:6 - | -LL | fn bar() -> u32 { - | --------------- this function should return `Result` or `Option` to accept `?` -LL | let x: Option = None; -LL | x?; - | ^ cannot use the `?` operator in a function that returns `u32` - | - = help: the trait `FromResidual>` is not implemented for `u32` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/try-trait/try-operator-custom.rs b/src/test/ui/try-trait/try-operator-custom.rs deleted file mode 100644 index 45636a7fc..000000000 --- a/src/test/ui/try-trait/try-operator-custom.rs +++ /dev/null @@ -1,91 +0,0 @@ -// run-pass - -#![feature(control_flow_enum)] -#![feature(try_trait_v2)] - -use std::ops::{ControlFlow, FromResidual, Try}; - -enum MyResult { - Awesome(T), - Terrible(U) -} - -enum Never {} - -impl Try for MyResult { - type Output = U; - type Residual = MyResult; - - fn from_output(u: U) -> MyResult { - MyResult::Awesome(u) - } - - fn branch(self) -> ControlFlow { - match self { - MyResult::Awesome(u) => ControlFlow::Continue(u), - MyResult::Terrible(e) => ControlFlow::Break(MyResult::Terrible(e)), - } - } -} - -impl FromResidual> for MyResult where V: Into { - fn from_residual(x: MyResult) -> Self { - match x { - MyResult::Awesome(u) => match u {}, - MyResult::Terrible(e) => MyResult::Terrible(e.into()), - } - } -} - -type ResultResidual = Result; - -impl FromResidual> for MyResult where V: Into { - fn from_residual(x: ResultResidual) -> Self { - match x { - Ok(v) => match v {} - Err(e) => MyResult::Terrible(e.into()), - } - } -} - -impl FromResidual> for Result where V: Into { - fn from_residual(x: MyResult) -> Self { - match x { - MyResult::Awesome(u) => match u {}, - MyResult::Terrible(e) => Err(e.into()), - } - } -} - -fn f(x: i32) -> Result { - if x == 0 { - Ok(42) - } else { - let y = g(x)?; - Ok(y) - } -} - -fn g(x: i32) -> MyResult { - let _y = f(x - 1)?; - MyResult::Terrible("Hello".to_owned()) -} - -fn h() -> MyResult { - let a: Result = Err("Hello"); - let b = a?; - MyResult::Awesome(b) -} - -fn i() -> MyResult { - let a: MyResult = MyResult::Terrible("Hello"); - let b = a?; - MyResult::Awesome(b) -} - -fn main() { - assert!(f(0) == Ok(42)); - assert!(f(10) == Err("Hello".to_owned())); - let _ = h(); - let _ = i(); -} diff --git a/src/test/ui/try-trait/try-operator-on-main.rs b/src/test/ui/try-trait/try-operator-on-main.rs deleted file mode 100644 index 3b364f7e7..000000000 --- a/src/test/ui/try-trait/try-operator-on-main.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![feature(try_trait_v2)] - -use std::ops::Try; - -fn main() { - // error for a `Try` type on a non-`Try` fn - std::fs::File::open("foo")?; //~ ERROR the `?` operator can only - - // a non-`Try` type on a non-`Try` fn - ()?; //~ ERROR the `?` operator can only be applied to - //~^ ERROR the `?` operator can only be used in a function that - - // an unrelated use of `Try` - try_trait_generic::<()>(); //~ ERROR the trait bound -} - -fn try_trait_generic() -> T { - // and a non-`Try` object on a `Try` fn. - ()?; //~ ERROR the `?` operator can only be applied to values that implement `Try` - - loop {} -} diff --git a/src/test/ui/try-trait/try-operator-on-main.stderr b/src/test/ui/try-trait/try-operator-on-main.stderr deleted file mode 100644 index 7cd38e0cf..000000000 --- a/src/test/ui/try-trait/try-operator-on-main.stderr +++ /dev/null @@ -1,53 +0,0 @@ -error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/try-operator-on-main.rs:7:31 - | -LL | fn main() { - | --------- this function should return `Result` or `Option` to accept `?` -LL | // error for a `Try` type on a non-`Try` fn -LL | std::fs::File::open("foo")?; - | ^ cannot use the `?` operator in a function that returns `()` - | - = help: the trait `FromResidual>` is not implemented for `()` - -error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/try-operator-on-main.rs:10:5 - | -LL | ()?; - | ^^^ the `?` operator cannot be applied to type `()` - | - = help: the trait `Try` is not implemented for `()` - -error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/try-operator-on-main.rs:10:7 - | -LL | fn main() { - | --------- this function should return `Result` or `Option` to accept `?` -... -LL | ()?; - | ^ cannot use the `?` operator in a function that returns `()` - | - = help: the trait `FromResidual<_>` is not implemented for `()` - -error[E0277]: the trait bound `(): Try` is not satisfied - --> $DIR/try-operator-on-main.rs:14:25 - | -LL | try_trait_generic::<()>(); - | ^^ the trait `Try` is not implemented for `()` - | -note: required by a bound in `try_trait_generic` - --> $DIR/try-operator-on-main.rs:17:25 - | -LL | fn try_trait_generic() -> T { - | ^^^ required by this bound in `try_trait_generic` - -error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/try-operator-on-main.rs:19:5 - | -LL | ()?; - | ^^^ the `?` operator cannot be applied to type `()` - | - = help: the trait `Try` is not implemented for `()` - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/try-trait/try-poll.rs b/src/test/ui/try-trait/try-poll.rs deleted file mode 100644 index d42e51c74..000000000 --- a/src/test/ui/try-trait/try-poll.rs +++ /dev/null @@ -1,50 +0,0 @@ -// build-pass (FIXME(62277): could be check-pass?) - -#![allow(dead_code, unused)] - -use std::task::Poll; - -struct K; -struct E; - -fn as_result() -> Result<(), E> { - // From Result - let K = Ok::(K)?; - - // From Poll - let _: Poll = Poll::Ready::>(Ok(K))?; - - // From Poll> - let _: Poll> = Poll::Ready::>>(None)?; - - Ok(()) -} - -fn as_poll_result() -> Poll> { - // From Result - let K = Ok::(K)?; - - // From Poll - let _: Poll = Poll::Ready::>(Ok(K))?; - - // From Poll> - let _: Poll> = Poll::Ready::>>(None)?; - - Poll::Ready(Ok(())) -} - -fn as_poll_option_result() -> Poll>> { - // From Result - let K = Ok::(K)?; - - // From Poll - let _: Poll = Poll::Ready::>(Ok(K))?; - - // From Poll> - let _: Poll> = Poll::Ready::>>(None)?; - - Poll::Ready(Some(Ok(()))) -} - -fn main() { -} diff --git a/src/test/ui/try-trait/yeet-for-option.rs b/src/test/ui/try-trait/yeet-for-option.rs deleted file mode 100644 index 753fbc1de..000000000 --- a/src/test/ui/try-trait/yeet-for-option.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-pass - -#![feature(yeet_expr)] - -fn always_yeet() -> Option { - do yeet; -} - -fn main() { - assert_eq!(always_yeet(), None); -} diff --git a/src/test/ui/try-trait/yeet-for-result.rs b/src/test/ui/try-trait/yeet-for-result.rs deleted file mode 100644 index b7b113797..000000000 --- a/src/test/ui/try-trait/yeet-for-result.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-pass - -#![feature(yeet_expr)] - -fn always_yeet() -> Result { - do yeet "hello"; -} - -fn main() { - assert_eq!(always_yeet(), Err("hello".to_string())); -} -- cgit v1.2.3