about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/basic.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-30 20:12:53 +0000
committerbors <bors@rust-lang.org>2023-11-30 20:12:53 +0000
commit87e1447aadaa2899ff6ccabe1fa669eb50fb60a1 (patch)
tree6556da6e4267c7783ad7b91f0487302d0b42ad53 /tests/rustdoc-js-std/basic.js
parent00796255c2796914c9640c1eef8dae522af0b8cc (diff)
parent25c75bc156a0491906c8f2bfa39d09eacb536a26 (diff)
downloadrust-87e1447aadaa2899ff6ccabe1fa669eb50fb60a1.tar.gz
rust-87e1447aadaa2899ff6ccabe1fa669eb50fb60a1.zip
Auto merge of #117805 - estebank:arg-fn-mismatch, r=petrochenkov
On Fn arg mismatch for a fn path, suggest a closure

When encountering a fn call that has a path to another fn being passed in, where an `Fn` impl is expected, and the arguments differ, suggest wrapping the argument with a closure with the appropriate arguments.

The last `help` is new:

```
error[E0631]: type mismatch in function arguments
  --> $DIR/E0631.rs:9:9
   |
LL |     fn f(_: u64) {}
   |     ------------ found signature defined here
...
LL |     foo(f);
   |     --- ^ expected due to this
   |     |
   |     required by a bound introduced by this call
   |
   = note: expected function signature `fn(usize) -> _`
              found function signature `fn(u64) -> _`
note: required by a bound in `foo`
  --> $DIR/E0631.rs:3:11
   |
LL | fn foo<F: Fn(usize)>(_: F) {}
   |           ^^^^^^^^^ required by this bound in `foo`
help: consider wrapping the function in a closure
   |
LL |     foo(|arg0: usize| f(/* u64 */));
   |         +++++++++++++  +++++++++++
```
Diffstat (limited to 'tests/rustdoc-js-std/basic.js')
0 files changed, 0 insertions, 0 deletions