diff options
Diffstat (limited to 'src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs')
-rw-r--r-- | src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs b/src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs deleted file mode 100644 index d302dc99b..000000000 --- a/src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs +++ /dev/null @@ -1,23 +0,0 @@ -struct S; -struct Y; - -trait Trait {} - -impl Trait for Y {} - -fn foo() -> impl Trait { - if true { - S - } else { - Y //~ ERROR `if` and `else` have incompatible types - } -} - -fn bar() -> impl Trait { - match true { - true => S, - false => Y, //~ ERROR `match` arms have incompatible types - } -} - -fn main() {} |