mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00

``` error: expected `{closure@...}` to return `Ret`, but it returns `Other` ``` instead of ``` error: expected `{closure@...}` to be a closure that returns `Ret`, but it returns `Other` ```
14 lines
286 B
Rust
14 lines
286 B
Rust
fn foo(items: &mut Vec<u8>) {
|
|
items.sort();
|
|
}
|
|
|
|
fn bar() -> impl Iterator<Item = i32> {
|
|
//~^ ERROR expected `foo` to return `i32`, but it returns `()` [E0271]
|
|
let mut x: Vec<Vec<u8>> = vec![vec![0, 2, 1], vec![5, 4, 3]];
|
|
x.iter_mut().map(foo)
|
|
}
|
|
|
|
fn main() {
|
|
bar();
|
|
}
|