diff options
| author | Michael Goulet <michael@errs.io> | 2023-05-18 01:52:56 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-05-18 01:53:01 +0000 |
| commit | 3db2bcf4ebb08f7fbe3de7fded45e96639ca3e68 (patch) | |
| tree | b5ee059ffd2f4866cd937e23548df74b6e277bad /tests/ui/unsized | |
| parent | 795fdf7d619b06ad508e2bd537ef5a4f9d5d4298 (diff) | |
| download | rust-3db2bcf4ebb08f7fbe3de7fded45e96639ca3e68.tar.gz rust-3db2bcf4ebb08f7fbe3de7fded45e96639ca3e68.zip | |
Remove return type sized check hack from hir typeck
Diffstat (limited to 'tests/ui/unsized')
| -rw-r--r-- | tests/ui/unsized/box-instead-of-dyn-fn.rs | 1 | ||||
| -rw-r--r-- | tests/ui/unsized/box-instead-of-dyn-fn.stderr | 24 |
2 files changed, 2 insertions, 23 deletions
diff --git a/tests/ui/unsized/box-instead-of-dyn-fn.rs b/tests/ui/unsized/box-instead-of-dyn-fn.rs index 2fa741bc1c5..321c2ebf5a1 100644 --- a/tests/ui/unsized/box-instead-of-dyn-fn.rs +++ b/tests/ui/unsized/box-instead-of-dyn-fn.rs @@ -8,7 +8,6 @@ fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> dyn Fn() + 'a { move || println!("{a}") } else { Box::new(move || println!("{}", b)) - //~^ ERROR `if` and `else` have incompatible types } } diff --git a/tests/ui/unsized/box-instead-of-dyn-fn.stderr b/tests/ui/unsized/box-instead-of-dyn-fn.stderr index c29043c038c..6087f5c5465 100644 --- a/tests/ui/unsized/box-instead-of-dyn-fn.stderr +++ b/tests/ui/unsized/box-instead-of-dyn-fn.stderr @@ -1,22 +1,3 @@ -error[E0308]: `if` and `else` have incompatible types - --> $DIR/box-instead-of-dyn-fn.rs:10:9 - | -LL | / if a % 2 == 0 { -LL | | move || println!("{a}") - | | ----------------------- - | | | - | | the expected closure - | | expected because of this -LL | | } else { -LL | | Box::new(move || println!("{}", b)) - | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found `Box<[closure@box-instead-of-dyn-fn.rs:10:18]>` -LL | | -LL | | } - | |_____- `if` and `else` have incompatible types - | - = note: expected closure `[closure@$DIR/box-instead-of-dyn-fn.rs:8:9: 8:16]` - found struct `Box<[closure@$DIR/box-instead-of-dyn-fn.rs:10:18: 10:25]>` - error[E0746]: return type cannot have an unboxed trait object --> $DIR/box-instead-of-dyn-fn.rs:5:56 | @@ -35,7 +16,6 @@ LL | if a % 2 == 0 { LL ~ Box::new(move || println!("{a}")) | -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0308, E0746. -For more information about an error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0746`. |
