diff options
Diffstat (limited to 'tests/ui/fn')
| -rw-r--r-- | tests/ui/fn/issue-80179.stderr | 21 | ||||
| -rw-r--r-- | tests/ui/fn/suggest-return-closure.stderr | 30 | ||||
| -rw-r--r-- | tests/ui/fn/suggest-return-future.stderr | 22 |
3 files changed, 45 insertions, 28 deletions
diff --git a/tests/ui/fn/issue-80179.stderr b/tests/ui/fn/issue-80179.stderr index f5d6c44db75..95158da3cff 100644 --- a/tests/ui/fn/issue-80179.stderr +++ b/tests/ui/fn/issue-80179.stderr @@ -2,21 +2,26 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/issue-80179.rs:10:24 | LL | fn returns_fn_ptr() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `fn() -> i32` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL - fn returns_fn_ptr() -> _ { +LL + fn returns_fn_ptr() -> fn() -> i32 { + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/issue-80179.rs:18:25 | LL | fn returns_closure() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl Fn() -> i32` + | ^ not allowed in type signatures | = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html +help: replace with an appropriate return type + | +LL - fn returns_closure() -> _ { +LL + fn returns_closure() -> impl Fn() -> i32 { + | error: aborting due to 2 previous errors diff --git a/tests/ui/fn/suggest-return-closure.stderr b/tests/ui/fn/suggest-return-closure.stderr index 1860d1ca5d9..0639c23c75a 100644 --- a/tests/ui/fn/suggest-return-closure.stderr +++ b/tests/ui/fn/suggest-return-closure.stderr @@ -2,34 +2,40 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/suggest-return-closure.rs:1:17 | LL | fn fn_once() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl FnOnce()` + | ^ not allowed in type signatures | = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html +help: replace with an appropriate return type + | +LL - fn fn_once() -> _ { +LL + fn fn_once() -> impl FnOnce() { + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/suggest-return-closure.rs:13:16 | LL | fn fn_mut() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl FnMut(char)` + | ^ not allowed in type signatures | = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html +help: replace with an appropriate return type + | +LL - fn fn_mut() -> _ { +LL + fn fn_mut() -> impl FnMut(char) { + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/suggest-return-closure.rs:33:13 | LL | fn fun() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl Fn() -> i32` + | ^ not allowed in type signatures | = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html +help: replace with an appropriate return type + | +LL - fn fun() -> _ { +LL + fn fun() -> impl Fn() -> i32 { + | error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/suggest-return-closure.rs:24:9 diff --git a/tests/ui/fn/suggest-return-future.stderr b/tests/ui/fn/suggest-return-future.stderr index a4c8b5d8c4b..7c097e50671 100644 --- a/tests/ui/fn/suggest-return-future.stderr +++ b/tests/ui/fn/suggest-return-future.stderr @@ -2,19 +2,25 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/suggest-return-future.rs:7:13 | LL | fn foo() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl Future<Output = i32>` + | ^ not allowed in type signatures + | +help: replace with an appropriate return type + | +LL - fn foo() -> _ { +LL + fn foo() -> impl Future<Output = i32> { + | error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/suggest-return-future.rs:15:13 | LL | fn bar() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl Future<Output = i32>` + | ^ not allowed in type signatures + | +help: replace with an appropriate return type + | +LL - fn bar() -> _ { +LL + fn bar() -> impl Future<Output = i32> { + | error: aborting due to 2 previous errors |
