rust/src/test/ui/moves
bors 6dc08b909b Auto merge of #87998 - nneonneo:master, r=oli-obk
Avoid spurious "previous iteration of loop" errors

Only follow backwards edges during `get_moved_indexes` if the move path is definitely initialized at loop entry. Otherwise, the error occurred prior to the loop, so we ignore the backwards edges to avoid generating misleading "value moved here, in previous iteration of loop" errors.

This patch also slightly improves the analysis of inits, including `NonPanicPathOnly` initializations (which are ignored by `drop_flag_effects::for_location_inits`). This is required for the definite initialization analysis, but may also help find certain skipped reinits in rare cases.

Patch passes all non-ignored src/test/ui testcases.

Fixes #72649.
2021-09-30 13:23:09 +00:00
..
issue-46099-move-in-macro.rs Fix spurious 'value moved here in previous iteration of loop' messages 2020-06-21 21:27:34 -04:00
issue-46099-move-in-macro.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
issue-72649-uninit-in-loop.rs Fix issue #72649: avoid spurious "previous iteration of loop" errors. 2021-09-09 00:11:29 -06:00
issue-72649-uninit-in-loop.stderr Fix issue #72649: avoid spurious "previous iteration of loop" errors. 2021-09-09 00:11:29 -06:00
issue-75904-move-closure-loop.rs Point to a move-related span when pointing to closure upvars 2020-08-26 02:11:01 -04:00
issue-75904-move-closure-loop.stderr Point to a move-related span when pointing to closure upvars 2020-08-26 02:11:01 -04:00
move-1-unique.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-2-unique.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-2.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-3-unique.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-4-unique.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-4.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-arg-2-unique.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-arg-2.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-arg.rs
move-deref-coercion.rs Note when a a move/borrow error is caused by a deref coercion 2020-09-10 20:56:20 -04:00
move-deref-coercion.stderr Note when a a move/borrow error is caused by a deref coercion 2020-09-10 20:56:20 -04:00
move-fn-self-receiver.rs Explain method-call move errors in loops 2021-01-08 14:37:07 -05:00
move-fn-self-receiver.stderr Use larger span for adjustments on method calls 2021-09-25 10:00:41 -05:00
move-guard-same-consts.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-guard-same-consts.stderr Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-in-guard-1.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-in-guard-1.stderr Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-in-guard-2.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-in-guard-2.stderr Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-into-dead-array-1.rs
move-into-dead-array-1.stderr
move-into-dead-array-2.rs
move-into-dead-array-2.stderr
move-nullary-fn.rs
move-out-of-array-1.rs
move-out-of-array-1.stderr
move-out-of-array-ref.rs
move-out-of-array-ref.stderr
move-out-of-field.rs
move-out-of-slice-1.rs
move-out-of-slice-1.stderr
move-out-of-slice-2.rs Make tidy happy 2020-10-27 14:45:34 -03:00
move-out-of-slice-2.stderr Add unsized_locals to INCOMPLETE_FEATURES list 2020-10-27 14:45:28 -03:00
move-out-of-tuple-field.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
move-out-of-tuple-field.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
move-scalar.rs
moves-based-on-type-access-to-field.rs
moves-based-on-type-access-to-field.stderr Change wording of note 2021-01-08 14:57:35 -05:00
moves-based-on-type-block-bad.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
moves-based-on-type-block-bad.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-capture-clause-bad.rs
moves-based-on-type-capture-clause-bad.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-capture-clause.rs
moves-based-on-type-cyclic-types-issue-4821.rs Be consistent when describing a move as a 'partial' in diagnostics 2020-08-08 14:21:04 -04:00
moves-based-on-type-cyclic-types-issue-4821.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
moves-based-on-type-distribute-copy-over-paren.rs pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-distribute-copy-over-paren.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-exprs.rs
moves-based-on-type-exprs.stderr Change wording of note 2021-01-08 14:57:35 -05:00
moves-based-on-type-match-bindings.rs pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-match-bindings.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-move-out-of-closure-env-issue-1965.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
moves-based-on-type-move-out-of-closure-env-issue-1965.stderr Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
moves-based-on-type-no-recursive-stack-closure.rs Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
moves-based-on-type-no-recursive-stack-closure.stderr Modify structured suggestion output 2021-08-11 09:46:24 +00:00
moves-based-on-type-tuple.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
moves-based-on-type-tuple.stderr Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
moves-sru-moved-field.rs Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
moves-sru-moved-field.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00