From 246f239d9f40f633160f0c18f87a20922d4e77bb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:06:37 +0200 Subject: Merging debian version 1.65.0+dfsg1-2. Signed-off-by: Daniel Baumann --- ...boxed-trait-objects-instead-of-impl-trait.fixed | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.fixed (limited to 'src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.fixed') diff --git a/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.fixed b/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.fixed new file mode 100644 index 000000000..f30feaed0 --- /dev/null +++ b/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.fixed @@ -0,0 +1,28 @@ +// run-rustfix + +#![allow(dead_code)] + +struct S; +struct Y; + +trait Trait {} + +impl Trait for S {} +impl Trait for Y {} + +fn foo() -> Box { + if true { + Box::new(S) + } else { + Box::new(Y) //~ ERROR `if` and `else` have incompatible types + } +} + +fn bar() -> Box { + match true { + true => Box::new(S), + false => Box::new(Y), //~ ERROR `match` arms have incompatible types + } +} + +fn main() {} -- cgit v1.2.3