rust/tests/ui/nll
Matthias Krüger 726709bca4
Rollup merge of #116960 - lqd:applied-member-constraints-scope, r=matthewjasper
Location-insensitive polonius: consider a loan escaping if an SCC has member constraints applied only

The location-insensitive analysis considered loans to escape if there were member constraints, which makes *some* sense for scopes and matches the scopes that NLL computes on all the tests.

However, polonius and NLLs differ on the fuzzed case #116657, where an SCC has member constraints but no applied ones (and is kinda surprising). The existing UI tests with member constraints impacting scopes all have some constraint applied.

This PR changes the location-insensitive analysis to consider a loan to escape if there are applied member constraints, and for extra paranoia/insurance via fuzzing and crater: actually checks the constraint's min choice is indeed a universal region as we expect. (This could be turned into a `debug_assert` and early return as a slight optimization after these periods of verification)

The 4 UI tests where member constraints are meaningful for computing scopes still pass obviously, and this also fixes #116657.

r? `@matthewjasper`
2023-10-23 16:23:52 +02:00
..
closure-requirements remove trailing dots 2023-10-08 10:06:17 +00:00
member-constraints remove trailing dots 2023-10-08 10:06:17 +00:00
polonius add non-regression test for issue 116657 2023-10-19 21:11:21 +00:00
relate_tys Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
ty-outlives remove trailing dots 2023-10-08 10:06:17 +00:00
user-annotations remove trailing dots 2023-10-08 10:06:17 +00:00
assign-while-to-immutable.rs Adjust UI tests for unit_bindings 2023-06-12 20:24:48 +08:00
borrow-use-issue-46875.rs
borrowck-thread-local-static-mut-borrow-outlives-fn.rs
borrowed-local-error.rs
borrowed-local-error.stderr
borrowed-match-issue-45045.rs
borrowed-match-issue-45045.stderr
borrowed-referent-issue-38899.rs
borrowed-referent-issue-38899.stderr
borrowed-temporary-error.rs
borrowed-temporary-error.stderr
borrowed-universal-error-2.rs
borrowed-universal-error-2.stderr
borrowed-universal-error.rs
borrowed-universal-error.stderr
cannot-move-block-spans.rs
cannot-move-block-spans.stderr
capture-mut-ref.fixed
capture-mut-ref.rs
capture-mut-ref.stderr
capture-ref-in-struct.rs
capture-ref-in-struct.stderr
closure-access-spans.rs
closure-access-spans.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
closure-borrow-spans.rs
closure-borrow-spans.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
closure-captures.rs
closure-captures.stderr
closure-malformed-projection-input-issue-102800.rs
closure-malformed-projection-input-issue-102800.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
closure-move-spans.rs
closure-move-spans.stderr
closure-use-spans.rs
closure-use-spans.stderr
closures-in-loops.rs
closures-in-loops.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
constant-thread-locals-issue-47053.rs
constant-thread-locals-issue-47053.stderr
constant.rs
continue-after-missing-main.rs
continue-after-missing-main.stderr
coroutine-distinct-lifetime.rs Rename lots of files that had generator in their name 2023-10-20 21:14:02 +00:00
coroutine-upvar-mutability.rs Rename lots of files that had generator in their name 2023-10-20 21:14:02 +00:00
coroutine-upvar-mutability.stderr Rename lots of files that had generator in their name 2023-10-20 21:14:02 +00:00
decl-macro-illegal-copy.rs
decl-macro-illegal-copy.stderr
do-not-ignore-lifetime-bounds-in-copy-proj.rs
do-not-ignore-lifetime-bounds-in-copy-proj.stderr
do-not-ignore-lifetime-bounds-in-copy.rs
do-not-ignore-lifetime-bounds-in-copy.stderr
dont-print-desugared.rs
dont-print-desugared.stderr
drop-may-dangle.rs
drop-no-may-dangle.rs
drop-no-may-dangle.stderr
empty-type-predicate-2.rs
empty-type-predicate.rs
enum-drop-access.rs
enum-drop-access.stderr
extra-unused-mut.rs s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
get_default.polonius.stderr
get_default.rs
get_default.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
guarantor-issue-46974.rs Remove FIXME about NLL diagnostic that is already improved 2023-08-06 21:20:15 +02:00
guarantor-issue-46974.stderr Remove FIXME about NLL diagnostic that is already improved 2023-08-06 21:20:15 +02:00
issue-16223.rs
issue-21114-ebfull.rs
issue-21114-kixunil.rs
issue-21232-partial-init-and-erroneous-use.rs
issue-21232-partial-init-and-erroneous-use.stderr
issue-21232-partial-init-and-use.rs
issue-21232-partial-init-and-use.stderr
issue-22323-temp-destruction.rs
issue-24535-allow-mutable-borrow-in-match-guard.rs
issue-27282-move-match-input-into-guard.rs
issue-27282-move-match-input-into-guard.stderr
issue-27282-move-ref-mut-into-guard.rs
issue-27282-move-ref-mut-into-guard.stderr
issue-27282-mutate-before-diverging-arm-1.rs
issue-27282-mutate-before-diverging-arm-1.stderr
issue-27282-mutate-before-diverging-arm-2.rs
issue-27282-mutate-before-diverging-arm-2.stderr
issue-27282-mutate-before-diverging-arm-3.rs
issue-27282-mutate-before-diverging-arm-3.stderr
issue-27282-mutation-in-guard.rs
issue-27282-mutation-in-guard.stderr
issue-27282-reborrow-ref-mut-in-guard.rs
issue-27282-reborrow-ref-mut-in-guard.stderr
issue-27583.rs
issue-27868.rs
issue-27868.stderr
issue-30104.rs
issue-30438-a.rs
issue-30438-a.stderr
issue-30438-b.rs
issue-30438-b.stderr
issue-30438-c.rs
issue-30438-c.stderr
issue-31567.rs
issue-31567.stderr
issue-32382-index-assoc-type-with-lifetime.rs
issue-42574-diagnostic-in-nested-closure.rs
issue-42574-diagnostic-in-nested-closure.stderr
issue-43058.rs
issue-45157.rs
issue-45157.stderr
issue-45696-long-live-borrows-in-boxes.rs
issue-45696-no-variant-box-recur.rs
issue-45696-scribble-on-boxed-borrow.rs
issue-45696-scribble-on-boxed-borrow.stderr
issue-46023.rs
issue-46023.stderr
issue-46036.rs
issue-46036.stderr
issue-46589.rs
issue-46589.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-47022.rs
issue-47153-generic-const.rs
issue-47388.rs
issue-47388.stderr
issue-47470.rs
issue-47470.stderr
issue-47589.rs
issue-48070.rs
issue-48179.rs
issue-48238.rs
issue-48238.stderr
issue-48623-closure.rs
issue-48623-coroutine.rs Rename lots of files that had generator in their name 2023-10-20 21:14:02 +00:00
issue-48623-coroutine.stderr Rename lots of files that had generator in their name 2023-10-20 21:14:02 +00:00
issue-48697.rs
issue-48697.stderr
issue-48803.rs
issue-48803.stderr
issue-50343.rs
issue-50461-used-mut-from-moves.rs
issue-50716-1.rs
issue-50716.rs
issue-50716.stderr
issue-51191.rs
issue-51191.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-51244.rs
issue-51244.stderr
issue-51268.rs
issue-51268.stderr
issue-51345-2.rs Change default panic handler message format. 2023-07-29 11:42:50 +02:00
issue-51351.rs
issue-51512.rs
issue-51512.stderr
issue-51770.rs
issue-52057.rs
issue-52059-report-when-borrow-and-drop-conflict.rs
issue-52059-report-when-borrow-and-drop-conflict.stderr
issue-52078.rs
issue-52086.rs
issue-52086.stderr
issue-52113.rs
issue-52113.stderr
issue-52213.rs
issue-52213.stderr
issue-52533-1.rs
issue-52533-1.stderr
issue-52534-1.rs
issue-52534-1.stderr
issue-52534-2.rs
issue-52534-2.stderr
issue-52534.rs
issue-52534.stderr
issue-52663-span-decl-captured-variable.rs
issue-52663-span-decl-captured-variable.stderr
issue-52663-trait-object.rs
issue-52663-trait-object.stderr
issue-52669.rs
issue-52669.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-52742.rs
issue-52742.stderr
issue-52992.rs
issue-53040.rs
issue-53040.stderr
issue-53119.rs Resolve vars in result from scrape_region_constraints 2023-06-05 19:40:30 +00:00
issue-53123-raw-pointer-cast.rs
issue-53570.rs
issue-53773.rs
issue-53773.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-53807.rs
issue-53807.stderr
issue-54189.rs
issue-54189.stderr
issue-54302-cases.rs
issue-54302-cases.stderr
issue-54302.rs
issue-54302.stderr
issue-54382-use-span-of-tail-of-block.rs
issue-54382-use-span-of-tail-of-block.stderr
issue-54556-niconii.rs
issue-54556-niconii.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-54556-stephaneyfx.rs
issue-54556-stephaneyfx.stderr adjust how closure/generator types and rvalues are printed 2023-09-21 22:20:58 +02:00
issue-54556-temps-in-tail-diagnostic.rs
issue-54556-temps-in-tail-diagnostic.stderr
issue-54556-used-vs-unused-tails.rs
issue-54556-used-vs-unused-tails.stderr
issue-54556-wrap-it-up.rs
issue-54556-wrap-it-up.stderr
issue-54779-anon-static-lifetime.rs
issue-54779-anon-static-lifetime.stderr
issue-54943-3.rs Adjust UI tests for unit_bindings 2023-06-12 20:24:48 +08:00
issue-54943.rs
issue-54943.stderr
issue-55288.rs
issue-55344.rs
issue-55394.rs
issue-55394.stderr
issue-55401.rs
issue-55401.stderr
issue-55511.rs
issue-55511.stderr
issue-55651.rs
issue-55825-const-fn.rs
issue-55850.rs s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
issue-55850.stderr s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
issue-57100.rs
issue-57100.stderr
issue-57265-return-type-wf-check.rs
issue-57265-return-type-wf-check.stderr
issue-57280-1-flipped.rs
issue-57280-1-flipped.stderr
issue-57280-1.rs
issue-57280.rs
issue-57642-higher-ranked-subtype.rs
issue-57642-higher-ranked-subtype.stderr
issue-57843.rs
issue-57843.stderr
issue-57960.rs
issue-57989.rs
issue-57989.stderr
issue-58053.rs
issue-58053.stderr
issue-58299.rs
issue-58299.stderr
issue-61311-normalize.rs
issue-61320-normalize.rs
issue-61424.fixed
issue-61424.rs
issue-61424.stderr
issue-62007-assign-const-index.rs
issue-62007-assign-const-index.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-62007-assign-differing-fields.rs
issue-62007-assign-differing-fields.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-63154-normalize.rs
issue-67007-escaping-data.rs
issue-67007-escaping-data.stderr
issue-68550.rs
issue-68550.stderr
issue-69114-static-mut-ty.rs
issue-69114-static-mut-ty.stderr
issue-69114-static-ty.rs
issue-69114-static-ty.stderr
issue-73159-rpit-static.rs
issue-73159-rpit-static.stderr
issue-75777.rs
issue-75777.stderr
issue-78561.rs
issue-95272.rs
issue-95272.stderr
issue-97997.rs
issue-97997.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
issue-98170.rs
issue-98170.stderr
issue-98589-closures-relate-named-regions.rs
issue-98589-closures-relate-named-regions.stderr remove trailing dots 2023-10-08 10:06:17 +00:00
issue-98693.rs
issue-98693.stderr remove trailing dots 2023-10-08 10:06:17 +00:00
issue-112604-closure-output-normalize.rs normalize closure output before relation 2023-06-15 12:49:49 +00:00
lint-no-err.rs
loan_ends_mid_block_pair.rs
loan_ends_mid_block_pair.stderr
loan_ends_mid_block_vec.rs
loan_ends_mid_block_vec.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
local-outlives-static-via-hrtb.rs
local-outlives-static-via-hrtb.stderr
lub-if.rs
lub-if.stderr
lub-match.rs
lub-match.stderr
match-cfg-fake-edges2.rs
match-cfg-fake-edges2.stderr
match-cfg-fake-edges.rs
match-cfg-fake-edges.stderr
match-guards-always-borrow.rs
match-guards-always-borrow.stderr
match-guards-partially-borrow.rs
match-guards-partially-borrow.stderr
match-on-borrowed.rs
match-on-borrowed.stderr
maybe-initialized-drop-implicit-fragment-drop.rs
maybe-initialized-drop-implicit-fragment-drop.stderr
maybe-initialized-drop-uninitialized.rs
maybe-initialized-drop-with-fragment.rs
maybe-initialized-drop-with-fragment.stderr
maybe-initialized-drop-with-uninitialized-fragments.rs
maybe-initialized-drop-with-uninitialized-fragments.stderr
maybe-initialized-drop.rs
maybe-initialized-drop.stderr
mir_check_cast_closure.rs
mir_check_cast_closure.stderr
mir_check_cast_reify.rs
mir_check_cast_reify.stderr
mir_check_cast_unsafe_fn.rs
mir_check_cast_unsafe_fn.stderr
mir_check_cast_unsize.rs
mir_check_cast_unsize.stderr
missing-universe-cause-issue-114907.rs add test for issue 114907 2023-08-30 14:10:52 +00:00
missing-universe-cause-issue-114907.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
move-errors.rs
move-errors.stderr
move-subpaths-moves-root.rs
move-subpaths-moves-root.stderr
mutating_references.rs
normalization-bounds-error.rs
normalization-bounds-error.stderr
normalization-bounds.rs
outlives-suggestion-more.rs
outlives-suggestion-more.stderr
outlives-suggestion-simple.polonius.stderr
outlives-suggestion-simple.rs
outlives-suggestion-simple.stderr
process_or_insert_default.rs
projection-return.rs
promotable-mutable-zst-doesnt-conflict.rs
promoted-bounds.rs
promoted-bounds.stderr
promoted-closure-pair.rs
promoted-closure-pair.stderr
promoted-liveness.rs
rc-loop.rs
ref-suggestion.rs
ref-suggestion.stderr
reference-carried-through-struct-field.rs
reference-carried-through-struct-field.stderr
region-ends-after-if-condition.rs
region-ends-after-if-condition.stderr
return_from_loop.rs
return_from_loop.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
return-ref-mut-issue-46557.rs
return-ref-mut-issue-46557.stderr
self-assign-ref-mut.rs
snocat-regression.rs
snocat-regression.stderr
trait-associated-constant.rs
trait-associated-constant.stderr
type-alias-free-regions.rs
type-alias-free-regions.stderr
type-check-pointer-coercions.rs
type-check-pointer-coercions.stderr
type-check-pointer-comparisons.rs
type-check-pointer-comparisons.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
type-test-universe.rs
type-test-universe.stderr
unused-mut-issue-50343.fixed
unused-mut-issue-50343.rs
unused-mut-issue-50343.stderr
vimwiki-core-regression.rs
where_clauses_in_functions.rs
where_clauses_in_functions.stderr
where_clauses_in_structs.rs
where_clauses_in_structs.stderr