diff options
| author | bors <bors@rust-lang.org> | 2025-04-08 22:51:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-04-08 22:51:10 +0000 |
| commit | de5b8a4c77618d8ae8e8ea0e4b787917c32e9305 (patch) | |
| tree | e4749c89ec0510c575525fdfbfdad43f2775a8ff /tests/ui/moves/nested-loop-moved-value-wrong-continue.rs | |
| parent | d4f880f8ce832cd7560bb2f1ebc34f967055ffd7 (diff) | |
| parent | 1cbf8b56afa6262c48d929b3b369d114c37f4124 (diff) | |
Auto merge of #139536 - matthiaskrgr:rollup-j6goald, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #139476 (rm `RegionInferenceContext::var_infos`) - #139485 (compiletest: Stricter parsing for diagnostic kinds) - #139491 (Update books) - #139500 (document panic behavior of Vec::resize and Vec::resize_with) - #139501 (Fix stack overflow in exhaustiveness due to recursive HIR opaque hidden types) - #139504 (add missing word in doc comment) - #139509 (clean: remove Deref<Target=RegionKind> impl for Region and use `.kind()`) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/moves/nested-loop-moved-value-wrong-continue.rs')
| -rw-r--r-- | tests/ui/moves/nested-loop-moved-value-wrong-continue.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/ui/moves/nested-loop-moved-value-wrong-continue.rs b/tests/ui/moves/nested-loop-moved-value-wrong-continue.rs index 0235b291df5..87800d314ed 100644 --- a/tests/ui/moves/nested-loop-moved-value-wrong-continue.rs +++ b/tests/ui/moves/nested-loop-moved-value-wrong-continue.rs @@ -9,6 +9,8 @@ fn foo() { //~| NOTE inside of this loop //~| HELP consider moving the expression out of the loop //~| NOTE in this expansion of desugaring of `for` loop + //~| NOTE + //~| NOTE baz.push(foo); //~^ NOTE value moved here //~| HELP consider cloning the value @@ -30,17 +32,19 @@ fn main() { for foo in foos { //~^ NOTE this reinitialization might get skipped //~| NOTE move occurs because `foo` has type `String` + //~| NOTE for bar in &bars { //~^ NOTE inside of this loop //~| HELP consider moving the expression out of the loop //~| NOTE in this expansion of desugaring of `for` loop + //~| NOTE if foo == *bar { baz.push(foo); //~^ NOTE value moved here //~| HELP consider cloning the value continue; //~^ NOTE verify that your loop breaking logic is correct - //~| NOTE this `continue` advances the loop at line 33 + //~| NOTE this `continue` advances the loop at line 36 } } qux.push(foo); |
