diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
commit | a4b7ed7a42c716ab9f05e351f003d589124fd55d (patch) | |
tree | b620cd3f223850b28716e474e80c58059dca5dd4 /src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.rs | |
parent | Adding upstream version 1.67.1+dfsg1. (diff) | |
download | rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip |
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.rs')
-rw-r--r-- | src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.rs | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.rs b/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.rs deleted file mode 100644 index fa7664a83..000000000 --- a/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.rs +++ /dev/null @@ -1,101 +0,0 @@ -fn foo() -> impl std::fmt::Display { - if false { - return 0i32; - } - 1u32 //~ ERROR mismatched types -} - -fn bar() -> impl std::fmt::Display { - if false { - return 0i32; - } else { - return 1u32; //~ ERROR mismatched types - } -} - -fn baz() -> impl std::fmt::Display { - if false { - return 0i32; - } else { - 1u32 //~ ERROR mismatched types - } -} - -fn qux() -> impl std::fmt::Display { - if false { - 0i32 - } else { - 1u32 //~ ERROR `if` and `else` have incompatible types - } -} - -fn bat() -> impl std::fmt::Display { - match 13 { - 0 => return 0i32, - _ => 1u32, //~ ERROR mismatched types - } -} - -fn can() -> impl std::fmt::Display { - match 13 { //~ ERROR mismatched types - 0 => return 0i32, - 1 => 1u32, - _ => 2u32, - } -} - -fn cat() -> impl std::fmt::Display { - match 13 { - 0 => { - return 0i32; - } - _ => { - 1u32 //~ ERROR mismatched types - } - } -} - -fn dog() -> impl std::fmt::Display { - match 13 { - 0 => 0i32, - 1 => 1u32, //~ ERROR `match` arms have incompatible types - _ => 2u32, - } -} - -fn hat() -> dyn std::fmt::Display { //~ ERROR return type cannot have an unboxed trait object - match 13 { - 0 => { - return 0i32; - } - _ => { - 1u32 - } - } -} - -fn pug() -> dyn std::fmt::Display { //~ ERROR return type cannot have an unboxed trait object - match 13 { - 0 => 0i32, - 1 => 1u32, //~ ERROR `match` arms have incompatible types - _ => 2u32, - } -} - -fn man() -> dyn std::fmt::Display { //~ ERROR return type cannot have an unboxed trait object - if false { - 0i32 - } else { - 1u32 //~ ERROR `if` and `else` have incompatible types - } -} - -fn apt() -> impl std::fmt::Display { - if let Some(42) = Some(42) { - 0i32 - } else { - 1u32 //~ ERROR `if` and `else` have incompatible types - } -} - -fn main() {} |