]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #63833 - estebank:suggest-closure-call, r=petrochenkov
authorMazdak Farrokhzad <twingoow@gmail.com>
Sun, 25 Aug 2019 00:45:01 +0000 (02:45 +0200)
committerGitHub <noreply@github.com>
Sun, 25 Aug 2019 00:45:01 +0000 (02:45 +0200)
Suggest calling closure with resolved return type when appropriate

Follow up to #63337. CC #63100.

```
error[E0308]: mismatched types
  --> $DIR/fn-or-tuple-struct-without-args.rs:46:20
   |
LL |     let closure = || 42;
   |                   -- closure defined here
LL |     let _: usize = closure;
   |                    ^^^^^^^
   |                    |
   |                    expected usize, found closure
   |                    help: use parentheses to call this closure: `closure()`
   |
   = note: expected type `usize`
              found type `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]`
```


Trivial merge