diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-06-14 21:36:25 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-06-15 08:57:20 -0700 |
| commit | e857696cf8c3b4a4381d00424f165c10f93a9ebd (patch) | |
| tree | 0da7c7f3617583ad133b881c0fffab9df5c94ab9 /src/test/ui/closures | |
| parent | bb8674837a9cc5225020e07fc3f164762bb4c11c (diff) | |
| download | rust-e857696cf8c3b4a4381d00424f165c10f93a9ebd.tar.gz rust-e857696cf8c3b4a4381d00424f165c10f93a9ebd.zip | |
Tweak "non-primitive cast" error
- Suggest borrowing expression if it would allow cast to work. - Suggest using `<Type>::from(<expr>)` when appropriate. - Minor tweak to `;` typo suggestion. Partily address #47136.
Diffstat (limited to 'src/test/ui/closures')
| -rw-r--r-- | src/test/ui/closures/closure-no-fn-3.stderr | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/test/ui/closures/closure-no-fn-3.stderr b/src/test/ui/closures/closure-no-fn-3.stderr index ab6056b6547..4b3b4be798f 100644 --- a/src/test/ui/closures/closure-no-fn-3.stderr +++ b/src/test/ui/closures/closure-no-fn-3.stderr @@ -2,9 +2,7 @@ error[E0605]: non-primitive cast: `[closure@$DIR/closure-no-fn-3.rs:6:27: 6:37 b --> $DIR/closure-no-fn-3.rs:6:27 | LL | let baz: fn() -> u8 = (|| { b }) as fn() -> u8; - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + | ^^^^^^^^^^^^^^^^^^^^^^^^ invalid cast error: aborting due to previous error |
