Use structured suggestion for bad Fn traits

This commit is contained in:
Esteban Küber 2019-12-13 08:22:58 -08:00
parent 66ea471f9d
commit 8d316a5a67
5 changed files with 40 additions and 20 deletions

View file

@ -38,11 +38,10 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje
--> $DIR/feature-gate-unboxed-closures-manual-impls.rs:9:6
|
LL | impl Fn<()> for Foo {
| ^^^^^^
| ^^^^^^ help: use parenthetical notation instead: `Fn() -> ()`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29625
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
= help: use parenthetical notation instead: `Fn(Foo, Bar) -> Baz`
error[E0229]: associated type bindings are not allowed here
--> $DIR/feature-gate-unboxed-closures-manual-impls.rs:15:6
@ -54,21 +53,19 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje
--> $DIR/feature-gate-unboxed-closures-manual-impls.rs:21:6
|
LL | impl FnMut<()> for Bar {
| ^^^^^^^^^
| ^^^^^^^^^ help: use parenthetical notation instead: `FnMut() -> ()`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29625
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
= help: use parenthetical notation instead: `Fn(Foo, Bar) -> Baz`
error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change
--> $DIR/feature-gate-unboxed-closures-manual-impls.rs:27:6
|
LL | impl FnOnce<()> for Baz {
| ^^^^^^^^^^
| ^^^^^^^^^^ help: use parenthetical notation instead: `FnOnce() -> ()`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29625
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
= help: use parenthetical notation instead: `Fn(Foo, Bar) -> Baz`
error: aborting due to 8 previous errors

View file

@ -11,11 +11,10 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje
--> $DIR/feature-gate-unboxed-closures.rs:5:6
|
LL | impl FnOnce<(u32, u32)> for Test {
| ^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `FnOnce(u32, u32) -> ()`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29625
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
= help: use parenthetical notation instead: `Fn(Foo, Bar) -> Baz`
error: aborting due to 2 previous errors

View file

@ -2,11 +2,10 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje
--> $DIR/issue-23024.rs:9:39
|
LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3));
| ^^
| ^^ help: use parenthetical notation instead: `Fn() -> ()`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29625
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
= help: use parenthetical notation instead: `Fn(Foo, Bar) -> Baz`
error[E0107]: wrong number of type arguments: expected 1, found 0
--> $DIR/issue-23024.rs:9:39

View file

@ -2,21 +2,19 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje
--> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:3:17
|
LL | fn bar1(x: &dyn Fn<(), Output=()>) {
| ^^
| ^^ help: use parenthetical notation instead: `Fn() -> ()`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29625
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
= help: use parenthetical notation instead: `Fn(Foo, Bar) -> Baz`
error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change
--> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:7:28
|
LL | fn bar2<T>(x: &T) where T: Fn<()> {
| ^^
| ^^ help: use parenthetical notation instead: `Fn() -> ()`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29625
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
= help: use parenthetical notation instead: `Fn(Foo, Bar) -> Baz`
error: aborting due to 2 previous errors