rust/tests
Stuart Cook 907076c3dd
Rollup merge of #144558 - estebank:issue-68119, r=lcnr
Point at the `Fn()` or `FnMut()` bound that coerced a closure, which caused a move error

When encountering a move error involving a closure because the captured value isn't `Copy`, and the obligation comes from a bound on a type parameter that requires `Fn` or `FnMut`, we point at it and explain that an `FnOnce` wouldn't cause the move error.

```
error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure
  --> f111.rs:15:25
   |
14 | fn do_stuff(foo: Option<Foo>) {
   |             ---  ----------- move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait
   |             |
   |             captured outer variable
15 |     require_fn_trait(|| async {
   |                      -- ^^^^^ `foo` is moved here
   |                      |
   |                      captured by this `Fn` closure
16 |         if foo.map_or(false, |f| f.foo()) {
   |            --- variable moved due to use in coroutine
   |
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
  --> f111.rs:12:53
   |
12 | fn require_fn_trait<F: Future<Output = ()>>(_: impl Fn() -> F) {}
   |                                                     ^^^^^^^^^
help: consider cloning the value if the performance cost is acceptable
   |
16 |         if foo.clone().map_or(false, |f| f.foo()) {
   |               ++++++++
```

Fix rust-lang/rust#68119, by pointing at `Fn` and `FnMut` bounds involved in move errors.
2025-08-11 12:21:08 +10:00
..
assembly-llvm Auto merge of #145210 - Zalathar:rollup-dm4reb2, r=Zalathar 2025-08-10 14:17:41 +00:00
auxiliary So many test updates x_x 2025-07-20 10:15:14 -07:00
codegen-llvm Rollup merge of #145064 - okaneco:saturating_sub_regression_tests, r=nikic 2025-08-10 15:43:53 -04:00
codegen-units Auto merge of #142893 - Mark-Simulacrum:no-const-collect, r=oli-obk 2025-06-27 12:57:05 +00:00
coverage coverage: Remove all unstable support for MC/DC instrumentation 2025-08-06 22:38:52 +10:00
coverage-run-rustdoc
crashes Rollup merge of #143093 - lqd:polonius-pre-alpha, r=jackh726 2025-08-10 19:45:46 +10:00
debuginfo Revert "Embed GDB pretty printers in rlibs and dylibs" 2025-08-06 18:00:58 +00:00
incremental Bless incremental tests. 2025-07-13 13:50:01 +00:00
mir-opt Rollup merge of #144883 - scottmcm:remove-unneeded-drop_in_place, r=nnethercote 2025-08-09 13:58:44 +10:00
pretty expand: Micro-optimize prelude injection 2025-07-28 17:35:09 +03:00
run-make Rollup merge of #145112 - dpaoliello:raw-dylib-link-ordinal, r=jieyouxu 2025-08-10 19:45:50 +10:00
rustdoc rustdoc: fix caching of intra-doc links on reexports 2025-08-05 15:34:51 -05:00
rustdoc-gui Add GUI regression test for tooltips i icons 2025-08-04 19:17:08 +02:00
rustdoc-js Rollup merge of #145100 - GuillaumeGomez:rank-doc-alias-lower, r=lolbinarycat 2025-08-09 13:58:52 +10:00
rustdoc-js-std Rollup merge of #141658 - lolbinarycat:rustdoc-search-stability-rank-138067, r=GuillaumeGomez 2025-08-09 13:58:42 +10:00
rustdoc-json rustdoc-json: Move #[macro_export] from Other to it's own variant 2025-07-30 19:57:32 +00:00
rustdoc-ui Print thread ID in panic message if thread name is unknown 2025-08-06 23:59:47 +00:00
ui Rollup merge of #144558 - estebank:issue-68119, r=lcnr 2025-08-11 12:21:08 +10:00
ui-fulldeps remove P 2025-08-09 15:47:01 +08:00
COMPILER_TESTS.md