rust/tests
Matthias Krüger 731ce84d19
Rollup merge of #138462 - ShE3py:mut-borrow-in-loop, r=oli-obk
Dedup `&mut *` reborrow suggestion in loops

#73534 added a reborrow suggestion in loops; #127579 generalized this to generic parameters, making the suggestion triggers twice:
```rs
use std::io::Read;

fn decode_scalar(_reader: impl Read) {}
fn decode_array(reader: &mut impl Read) {
    for _ in 0.. {
        decode_scalar(reader);
    }
}
```
```
error[E0382]: use of moved value: `reader`
 --> src/lib.rs:6:23
  |
4 | fn decode_array(reader: &mut impl Read) {
  |                 ------ move occurs because `reader` has type `&mut impl Read`, which does not implement the `Copy` trait
5 |     for _ in 0.. {
  |     ------------ inside of this loop
6 |         decode_scalar(reader);
  |                       ^^^^^^ value moved here, in previous iteration of loop
  |
help: consider creating a fresh reborrow of `reader` here
  |
6 |         decode_scalar(&mut *reader);
  |                       ++++++
help: consider creating a fresh reborrow of `reader` here
  |
6 |         decode_scalar(&mut *reader);
  |                       ++++++
```
This PR removes the suggestion in loops, as it requires generic parameters anyway (i.e., the reborrow is automatic if there is no generic params).

`@rustbot` label +A-borrow-checker +A-diagnostics +A-suggestion-diagnostics +D-papercut
2025-04-03 21:18:29 +02:00
..
assembly Auto merge of #138503 - bjorn3:string_merging, r=tmiasko 2025-03-28 10:18:32 +00:00
auxiliary tests: use minicore more 2025-02-24 09:26:54 +00:00
codegen Rollup merge of #139145 - okaneco:safe_splits, r=Amanieu 2025-04-03 07:39:05 +02:00
codegen-units Remove -Zinline-in-all-cgus and clean up CGU partitioning tests 2025-01-27 23:48:47 -05:00
coverage coverage: Don't split bang-macro spans, just truncate them 2025-04-01 13:13:21 +11:00
coverage-run-rustdoc Update coverage-run-rustdoc output 2025-03-28 10:35:53 +01:00
crashes Rollup merge of #135295 - eyraudh:master, r=compiler-errors 2025-04-02 13:10:36 +11:00
debuginfo Rollup merge of #137967 - mustartt:fix-aix-test-hangs, r=workingjubilee 2025-03-11 13:30:50 +01:00
incremental Rollup merge of #139153 - compiler-errors:incr-comp-closure, r=oli-obk 2025-03-31 14:36:22 +02:00
mir-opt Auto merge of #137738 - Daniel-Aaron-Bloom:const_slice_make_iter, r=dtolnay 2025-04-03 08:57:46 +00:00
pretty Auto merge of #138492 - lcnr:rm-inline_const_pat, r=oli-obk 2025-04-01 14:20:46 +00:00
run-make Rollup merge of #139239 - jieyouxu:run-make-aux-build, r=Kobzol 2025-04-02 22:52:47 +09:00
rustdoc Correctly handle line comments in attributes and generate extern crates 2025-03-27 11:18:43 +01:00
rustdoc-gui Rollup merge of #137539 - GuillaumeGomez:copy-content-tests, r=notriddle 2025-02-25 13:07:34 +01:00
rustdoc-js Rollup merge of #134277 - notriddle:notriddle/inline-into, r=GuillaumeGomez 2024-12-16 20:00:20 +01:00
rustdoc-js-std Remove the common prelude module 2025-02-11 13:04:27 -08:00
rustdoc-json rustdoc-json: Add test for #[automatically_derived] attribute 2025-03-31 20:42:49 +00:00
rustdoc-ui compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
ui Rollup merge of #138462 - ShE3py:mut-borrow-in-loop, r=oli-obk 2025-04-03 21:18:29 +02:00
ui-fulldeps compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
COMPILER_TESTS.md