rust/tests/ui/borrowck
bors ec2b311914 Auto merge of #116733 - compiler-errors:alias-liveness-but-this-time-sound, r=aliemjay
Consider alias bounds when computing liveness in NLL (but this time sound hopefully)

This is a revival of #116040, except removing the changes to opaque lifetime captures check to make sure that we're not triggering any unsoundness due to the lack of general existential regions and the currently-existing `ReErased` hack we use instead.

r? `@aliemjay` -- I appreciate you pointing out the unsoundenss in the previous iteration of this PR, and I'd like to hear that you're happy with this iteration of this PR before this goes back into FCP :>

Fixes #116794 as well

---

(mostly copied from #116040 and reworked slightly)

# Background

Right now, liveness analysis in NLL is a bit simplistic. It simply walks through all of the regions of a type and marks them as being live at points. This is problematic in the case of aliases, since it requires that we mark **all** of the regions in their args[^1] as live, leading to bugs like #42940.

In reality, we may be able to deduce that fewer regions are allowed to be present in the projected type (or "hidden type" for opaques) via item bounds or where clauses, and therefore ideally, we should be able to soundly require fewer regions to be live in the alias.

For example:
```rust
trait Captures<'a> {}
impl<T> Captures<'_> for T {}

fn capture<'o>(_: &'o mut ()) -> impl Sized + Captures<'o> + 'static {}

fn test_two_mut(mut x: ()) {
    let _f1 = capture(&mut x);
    let _f2 = capture(&mut x);
    //~^ ERROR cannot borrow `x` as mutable more than once at a time
}
```

In the example above, we should be able to deduce from the `'static` bound on `capture`'s opaque that even though `'o` is a captured region, it *can never* show up in the opaque's hidden type, and can soundly be ignored for liveness purposes.

# The Fix

We apply a simple version of RFC 1214's `OutlivesProjectionEnv` and `OutlivesProjectionTraitDef` rules to NLL's `make_all_regions_live` computation.

Specifically, when we encounter an alias type, we:
1. Look for a unique outlives bound in the param-env or item bounds for that alias. If there is more than one unique region, bail, unless any of the outlives bound's regions is `'static`, and in that case, prefer `'static`. If we find such a unique region, we can mark that outlives region as live and skip walking through the args of the opaque.
2. Otherwise, walk through the alias's args recursively, as we do today.

## Limitation: Multiple choices

This approach has some limitations. Firstly, since liveness doesn't use the same type-test logic as outlives bounds do, we can't really try several options when we're faced with a choice.

If we encounter two unique outlives regions in the param-env or bounds, we simply fall back to walking the opaque via its args. I expect this to be mostly mitigated by the special treatment of `'static`, and can be fixed in a forwards-compatible by a more sophisticated analysis in the future.

## Limitation: Opaque hidden types

Secondly, we do not employ any of these rules when considering whether the regions captured by a hidden type are valid. That causes this code (cc #42940) to fail:

```rust
trait Captures<'a> {}
impl<T> Captures<'_> for T {}

fn a() -> impl Sized + 'static {
    b(&vec![])
}

fn b<'o>(_: &'o Vec<i32>) -> impl Sized + Captures<'o> + 'static {}
```

We need to have existential regions to avoid [unsoundness](https://github.com/rust-lang/rust/pull/116040#issuecomment-1751628189) when an opaque captures a region which is not represented in its own substs but which outlives a region that does.

## Read more

Context: https://github.com/rust-lang/rust/pull/115822#issuecomment-1731153952 (for the liveness case)
More context: https://github.com/rust-lang/rust/issues/42940#issuecomment-455198309 (for the opaque capture case, which this does not fix)

[^1]: except for bivariant region args in opaques, which will become less relevant when we move onto edition 2024 capture semantics for opaques.
2023-10-29 18:42:02 +00:00
..
alias-liveness Flesh out tests more 2023-10-17 01:26:46 +00:00
access-mode-in-closures.rs
access-mode-in-closures.stderr
anonymous-region-in-apit.rs
anonymous-region-in-apit.stderr
assign_mutable_fields.rs
assign_mutable_fields.stderr
assign-never-type.rs
async-reference-generality.rs Bless tests. 2023-09-23 13:47:30 +00:00
bindings-after-at-or-patterns-slice-patterns-box-patterns.rs
bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
borrow-immutable-upvar-mutation-impl-trait.rs
borrow-immutable-upvar-mutation-impl-trait.stderr
borrow-immutable-upvar-mutation.rs
borrow-immutable-upvar-mutation.stderr
borrow-raw-address-of-borrowed.rs
borrow-raw-address-of-borrowed.stderr
borrow-raw-address-of-deref-mutability-ok.rs
borrow-raw-address-of-deref-mutability.rs
borrow-raw-address-of-deref-mutability.stderr tweak "make mut" spans when assigning to locals 2023-05-05 22:40:04 +12:00
borrow-raw-address-of-mutability-ok.rs
borrow-raw-address-of-mutability.rs
borrow-raw-address-of-mutability.stderr
borrow-tuple-fields.rs
borrow-tuple-fields.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-access-permissions.rs
borrowck-access-permissions.stderr tweak "make mut" spans when assigning to locals 2023-05-05 22:40:04 +12:00
borrowck-and-init.rs
borrowck-and-init.stderr
borrowck-anon-fields-struct.rs
borrowck-anon-fields-struct.stderr
borrowck-anon-fields-tuple.rs
borrowck-anon-fields-tuple.stderr
borrowck-anon-fields-variant.rs
borrowck-anon-fields-variant.stderr
borrowck-argument.rs
borrowck-argument.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-assign-comp-idx.rs
borrowck-assign-comp-idx.stderr
borrowck-assign-comp.rs
borrowck-assign-comp.stderr
borrowck-assign-to-andmut-in-aliasable-loc.rs
borrowck-assign-to-andmut-in-aliasable-loc.stderr tweak "make mut" spans (No. 3) 2023-05-05 22:40:05 +12:00
borrowck-assign-to-andmut-in-borrowed-loc.rs
borrowck-assign-to-andmut-in-borrowed-loc.stderr
borrowck-assign-to-constants.rs
borrowck-assign-to-constants.stderr
borrowck-assign-to-subfield.rs
borrowck-assignment-to-static-mut.rs
borrowck-auto-mut-ref-to-immut-var.rs
borrowck-auto-mut-ref-to-immut-var.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-autoref-3261.rs
borrowck-autoref-3261.stderr
borrowck-bad-nested-calls-free.rs
borrowck-bad-nested-calls-free.stderr
borrowck-bad-nested-calls-move.rs
borrowck-bad-nested-calls-move.stderr
borrowck-binding-mutbl.rs
borrowck-block-uninit.rs
borrowck-block-uninit.stderr
borrowck-borrow-from-expr-block.rs
borrowck-borrow-from-owned-ptr.rs
borrowck-borrow-from-owned-ptr.stderr
borrowck-borrow-from-stack-variable.rs
borrowck-borrow-from-stack-variable.stderr
borrowck-borrow-from-temporary.rs
borrowck-borrow-from-temporary.stderr
borrowck-borrow-immut-deref-of-box-as-mut.rs
borrowck-borrow-immut-deref-of-box-as-mut.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs
borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr tweak "make mut" spans (No. 3) 2023-05-05 22:40:05 +12:00
borrowck-borrow-mut-object-twice.rs
borrowck-borrow-mut-object-twice.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-borrow-of-mut-base-ptr-safe.rs
borrowck-borrow-overloaded-auto-deref.rs
borrowck-borrow-overloaded-auto-deref.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-borrow-overloaded-deref.rs
borrowck-borrow-overloaded-deref.stderr
borrowck-borrowed-uniq-rvalue-2.rs
borrowck-borrowed-uniq-rvalue-2.stderr Account for macros when suggesting a new let binding 2023-07-28 14:44:03 +00:00
borrowck-borrowed-uniq-rvalue.fixed
borrowck-borrowed-uniq-rvalue.rs
borrowck-borrowed-uniq-rvalue.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-box-sensitivity.rs
borrowck-break-uninit-2.rs
borrowck-break-uninit-2.stderr
borrowck-break-uninit.rs
borrowck-break-uninit.stderr
borrowck-closures-mut-and-imm.rs
borrowck-closures-mut-and-imm.stderr
borrowck-closures-mut-of-imm.rs
borrowck-closures-mut-of-imm.stderr
borrowck-closures-mut-of-mut.rs
borrowck-closures-mut-of-mut.stderr
borrowck-closures-slice-patterns-ok.rs Rename drop_ref lint to dropping_references 2023-05-21 14:16:41 +02:00
borrowck-closures-slice-patterns.rs
borrowck-closures-slice-patterns.stderr
borrowck-closures-two-imm.rs
borrowck-closures-two-mut-fail.rs
borrowck-closures-two-mut-fail.stderr
borrowck-closures-two-mut.rs
borrowck-closures-two-mut.stderr
borrowck-closures-unique-imm.rs
borrowck-closures-unique-imm.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-closures-unique.rs
borrowck-closures-unique.stderr
borrowck-closures-use-after-free.rs
borrowck-closures-use-after-free.stderr
borrowck-consume-unsize-vec.rs
borrowck-consume-unsize-vec.stderr
borrowck-consume-upcast-box.rs
borrowck-consume-upcast-box.stderr
borrowck-describe-lvalue.rs
borrowck-describe-lvalue.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-drop-from-guard.rs
borrowck-drop-from-guard.stderr
borrowck-escaping-closure-error-1.rs
borrowck-escaping-closure-error-1.stderr
borrowck-escaping-closure-error-2.rs
borrowck-escaping-closure-error-2.stderr
borrowck-field-sensitivity-rpass.rs Rename drop_copy lint to dropping_copy_types 2023-05-21 13:37:32 +02:00
borrowck-field-sensitivity.rs
borrowck-field-sensitivity.stderr
borrowck-fixed-length-vecs.rs
borrowck-fn-in-const-a.rs
borrowck-fn-in-const-a.stderr
borrowck-fn-in-const-c.rs
borrowck-fn-in-const-c.stderr
borrowck-for-loop-correct-cmt-for-pattern.rs
borrowck-for-loop-correct-cmt-for-pattern.stderr
borrowck-for-loop-head-linkage.rs
borrowck-for-loop-head-linkage.stderr
borrowck-for-loop-uninitialized-binding.rs
borrowck-for-loop-uninitialized-binding.stderr
borrowck-freeze-frozen-mut.rs
borrowck-if-no-else.rs
borrowck-if-no-else.stderr
borrowck-if-with-else.rs
borrowck-if-with-else.stderr
borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs
borrowck-imm-ref-to-mut-rec-field-issue-3162-c.stderr
borrowck-in-static.rs
borrowck-in-static.stderr
borrowck-init-in-called-fn-expr.rs
borrowck-init-in-called-fn-expr.stderr
borrowck-init-in-fn-expr.rs
borrowck-init-in-fn-expr.stderr
borrowck-init-in-fru.rs
borrowck-init-in-fru.stderr
borrowck-init-op-equal.rs
borrowck-init-op-equal.stderr
borrowck-init-plus-equal.rs
borrowck-init-plus-equal.stderr
borrowck-insert-during-each.rs
borrowck-insert-during-each.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-issue-2657-1.rs
borrowck-issue-2657-1.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-issue-2657-2.fixed
borrowck-issue-2657-2.rs
borrowck-issue-2657-2.stderr
borrowck-issue-14498.rs
borrowck-issue-14498.stderr tweak "make mut" spans when assigning to locals 2023-05-05 22:40:04 +12:00
borrowck-issue-48962.rs
borrowck-issue-48962.stderr
borrowck-lend-args.rs
borrowck-lend-flow-if.rs
borrowck-lend-flow-if.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-lend-flow-loop.rs
borrowck-lend-flow-loop.stderr
borrowck-lend-flow-match.rs
borrowck-lend-flow-match.stderr
borrowck-lend-flow.rs
borrowck-lend-flow.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-loan-blocks-move-cc.rs
borrowck-loan-blocks-move-cc.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-loan-blocks-move.rs
borrowck-loan-blocks-move.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-loan-blocks-mut-uniq.rs
borrowck-loan-blocks-mut-uniq.stderr
borrowck-loan-in-overloaded-op.rs
borrowck-loan-in-overloaded-op.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-loan-of-static-data-issue-27616.rs
borrowck-loan-of-static-data-issue-27616.stderr
borrowck-loan-rcvr-overloaded-op.rs
borrowck-loan-rcvr-overloaded-op.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-loan-rcvr.rs
borrowck-loan-rcvr.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-loan-vec-content.rs
borrowck-loan-vec-content.stderr
borrowck-local-borrow-outlives-fn.rs
borrowck-local-borrow-outlives-fn.stderr
borrowck-local-borrow-with-panic-outlives-fn.rs
borrowck-local-borrow-with-panic-outlives-fn.stderr
borrowck-local-borrow.rs
borrowck-macro-interaction-issue-6304.rs
borrowck-match-already-borrowed.rs
borrowck-match-already-borrowed.stderr
borrowck-match-binding-is-assignment.rs
borrowck-match-binding-is-assignment.stderr
borrowck-move-by-capture-ok.rs
borrowck-move-by-capture.rs
borrowck-move-by-capture.stderr
borrowck-move-error-with-note.fixed
borrowck-move-error-with-note.rs
borrowck-move-error-with-note.stderr
borrowck-move-from-subpath-of-borrowed-path.rs
borrowck-move-from-subpath-of-borrowed-path.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-move-from-unsafe-ptr.rs
borrowck-move-from-unsafe-ptr.stderr
borrowck-move-in-irrefut-pat.rs
borrowck-move-in-irrefut-pat.stderr
borrowck-move-moved-value-into-closure.rs
borrowck-move-moved-value-into-closure.stderr
borrowck-move-mut-base-ptr.rs
borrowck-move-mut-base-ptr.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-move-out-from-array-match.rs Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
borrowck-move-out-from-array-match.stderr Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
borrowck-move-out-from-array-no-overlap-match.rs Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
borrowck-move-out-from-array-no-overlap.rs
borrowck-move-out-from-array-use-match.rs Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
borrowck-move-out-from-array-use-match.stderr Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
borrowck-move-out-from-array-use-no-overlap-match.rs Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
borrowck-move-out-from-array-use-no-overlap.rs
borrowck-move-out-from-array-use.rs
borrowck-move-out-from-array-use.stderr
borrowck-move-out-from-array.rs
borrowck-move-out-from-array.stderr
borrowck-move-out-of-overloaded-auto-deref.rs
borrowck-move-out-of-overloaded-auto-deref.stderr Don't use method span on clone suggestion 2023-07-10 20:09:28 +00:00
borrowck-move-out-of-overloaded-deref.rs
borrowck-move-out-of-overloaded-deref.stderr
borrowck-move-out-of-static-item.rs
borrowck-move-out-of-static-item.stderr
borrowck-move-out-of-struct-with-dtor.fixed
borrowck-move-out-of-struct-with-dtor.rs
borrowck-move-out-of-struct-with-dtor.stderr
borrowck-move-out-of-tuple-struct-with-dtor.fixed
borrowck-move-out-of-tuple-struct-with-dtor.rs
borrowck-move-out-of-tuple-struct-with-dtor.stderr
borrowck-move-out-of-vec-tail.rs
borrowck-move-out-of-vec-tail.stderr
borrowck-move-subcomponent.rs
borrowck-move-subcomponent.stderr
borrowck-multiple-borrows-interior-boxes.rs
borrowck-multiple-captures.rs
borrowck-multiple-captures.stderr
borrowck-mut-addr-of-imm-var.rs
borrowck-mut-addr-of-imm-var.stderr
borrowck-mut-borrow-linear-errors.rs
borrowck-mut-borrow-linear-errors.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-mut-borrow-of-mut-base-ptr.rs
borrowck-mut-borrow-of-mut-base-ptr.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-mut-slice-of-imm-vec.rs
borrowck-mut-slice-of-imm-vec.stderr
borrowck-mut-uniq.rs
borrowck-mut-vec-as-imm-slice.rs
borrowck-mutate-in-guard.rs
borrowck-mutate-in-guard.stderr
borrowck-no-cycle-in-exchange-heap.rs
borrowck-no-cycle-in-exchange-heap.stderr
borrowck-object-lifetime.rs
borrowck-object-lifetime.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-or-init.rs
borrowck-or-init.stderr
borrowck-overloaded-call.rs
borrowck-overloaded-call.stderr
borrowck-overloaded-index-and-overloaded-deref.rs
borrowck-overloaded-index-and-overloaded-deref.stderr
borrowck-overloaded-index-autoderef.rs
borrowck-overloaded-index-autoderef.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-overloaded-index-move-from-vec.rs
borrowck-overloaded-index-move-from-vec.stderr
borrowck-overloaded-index-move-index.rs
borrowck-overloaded-index-move-index.stderr
borrowck-overloaded-index-ref-index.rs
borrowck-overloaded-index-ref-index.stderr
borrowck-partial-reinit-1.rs
borrowck-partial-reinit-1.stderr
borrowck-partial-reinit-2.rs
borrowck-partial-reinit-2.stderr
borrowck-partial-reinit-3.rs
borrowck-partial-reinit-3.stderr
borrowck-partial-reinit-4.rs
borrowck-partial-reinit-4.stderr
borrowck-pat-enum.rs
borrowck-pat-reassign-binding.rs
borrowck-pat-reassign-binding.stderr
borrowck-pat-reassign-no-binding.rs
borrowck-reborrow-from-mut.rs
borrowck-reborrow-from-mut.stderr tweak "make mut" spans (No. 3) 2023-05-05 22:40:05 +12:00
borrowck-reborrow-from-shorter-lived-andmut.rs
borrowck-reborrow-from-shorter-lived-andmut.stderr
borrowck-ref-mut-of-imm.rs
borrowck-ref-mut-of-imm.stderr
borrowck-reinit.rs
borrowck-reinit.stderr
borrowck-report-with-custom-diagnostic.rs
borrowck-report-with-custom-diagnostic.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-return-variable-on-stack-via-clone.rs
borrowck-return-variable-on-stack-via-clone.stderr
borrowck-return.rs
borrowck-return.stderr
borrowck-rvalues-mutable.rs
borrowck-scope-of-deref-issue-4666.rs
borrowck-slice-pattern-element-loan-array-no-overlap.rs
borrowck-slice-pattern-element-loan-array.rs
borrowck-slice-pattern-element-loan-array.stderr
borrowck-slice-pattern-element-loan-rpass.rs
borrowck-slice-pattern-element-loan-slice-no-overlap.rs
borrowck-slice-pattern-element-loan-slice.rs
borrowck-slice-pattern-element-loan-slice.stderr
borrowck-static-item-in-fn.rs
borrowck-storage-dead.rs
borrowck-storage-dead.stderr
borrowck-struct-update-with-dtor.rs
borrowck-struct-update-with-dtor.stderr
borrowck-swap-mut-base-ptr.rs
borrowck-swap-mut-base-ptr.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-thread-local-static-borrow-outlives-fn.rs
borrowck-thread-local-static-borrow-outlives-fn.stderr Tweak the post-order for multi-successor blocks 2023-05-21 17:48:36 -07:00
borrowck-trait-lifetime.rs
borrowck-unary-move.rs
borrowck-unary-move.stderr
borrowck-unboxed-closures.rs
borrowck-unboxed-closures.stderr
borrowck-uninit-after-item.rs
borrowck-uninit-after-item.stderr
borrowck-uninit-field-access.rs
borrowck-uninit-field-access.stderr
borrowck-uninit-in-assignop.rs
borrowck-uninit-in-assignop.stderr
borrowck-uninit-ref-chain.rs
borrowck-uninit-ref-chain.stderr
borrowck-uninit.rs
borrowck-uninit.stderr
borrowck-union-borrow-nested.rs
borrowck-union-borrow-nested.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-union-borrow.rs
borrowck-union-borrow.stderr
borrowck-union-move-assign.rs
borrowck-union-move-assign.stderr
borrowck-union-move.rs
borrowck-union-move.stderr
borrowck-union-uninitialized.rs
borrowck-union-uninitialized.stderr
borrowck-uniq-via-lend.rs
borrowck-uniq-via-lend.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-uniq-via-ref.rs
borrowck-univariant-enum.rs
borrowck-unsafe-static-mutable-borrows.rs
borrowck-unused-mut-locals.rs
borrowck-use-in-index-lvalue.rs
borrowck-use-in-index-lvalue.stderr
borrowck-use-mut-borrow-rpass.rs Rename drop_copy lint to dropping_copy_types 2023-05-21 13:37:32 +02:00
borrowck-use-mut-borrow.rs
borrowck-use-mut-borrow.stderr
borrowck-use-uninitialized-in-cast-trait.rs
borrowck-use-uninitialized-in-cast-trait.stderr
borrowck-use-uninitialized-in-cast.rs
borrowck-use-uninitialized-in-cast.stderr
borrowck-vec-pattern-element-loan.rs
borrowck-vec-pattern-element-loan.stderr
borrowck-vec-pattern-loan-from-mut.rs
borrowck-vec-pattern-loan-from-mut.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-vec-pattern-move-tail.rs
borrowck-vec-pattern-move-tail.stderr
borrowck-vec-pattern-nesting.rs Remove DesugaringKind::Replace. 2023-05-25 17:40:46 +00:00
borrowck-vec-pattern-nesting.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-vec-pattern-tail-element-loan.rs
borrowck-vec-pattern-tail-element-loan.stderr
borrowck-while-break.rs
borrowck-while-break.stderr
borrowck-while-cond.rs
borrowck-while-cond.stderr
borrowck-while.rs
borrowck-while.stderr
clone-span-on-try-operator.fixed Don't use method span on clone suggestion 2023-07-10 20:09:28 +00:00
clone-span-on-try-operator.rs Don't use method span on clone suggestion 2023-07-10 20:09:28 +00:00
clone-span-on-try-operator.stderr Don't use method span on clone suggestion 2023-07-10 20:09:28 +00:00
copy-suggestion-region-vid.rs fix the issue of shorthand in suggest_cloning 2023-07-14 07:12:38 +08:00
copy-suggestion-region-vid.stderr fix the issue of shorthand in suggest_cloning 2023-07-14 07:12:38 +08:00
disallow-possibly-uninitialized.rs
disallow-possibly-uninitialized.stderr
do-not-suggest-adding-move-when-closure-is-already-marked-as-move.rs
do-not-suggest-adding-move-when-closure-is-already-marked-as-move.stderr
drop-in-loop.rs
drop-in-loop.stderr
fsu-moves-and-copies.rs
immut-function-arguments.rs
immut-function-arguments.stderr
immutable-arg.rs
immutable-arg.stderr
index-mut-help-with-impl.rs
index-mut-help-with-impl.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
index-mut-help.rs
index-mut-help.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-7573.rs
issue-7573.stderr
issue-10876.rs
issue-11493.fixed
issue-11493.rs
issue-11493.stderr
issue-17263.rs
issue-17545.rs
issue-17545.stderr
issue-17718-static-move.rs
issue-17718-static-move.stderr
issue-20801.rs
issue-20801.stderr
issue-23338-params-outlive-temps-of-body.rs
issue-24267-flow-exit.rs
issue-24267-flow-exit.stderr
issue-25793.rs
issue-25793.stderr
issue-28934.rs
issue-29166.rs
issue-31287-drop-in-guard.rs
issue-31287-drop-in-guard.stderr
issue-33819.rs
issue-33819.stderr
issue-36082.fixed
issue-36082.rs
issue-36082.stderr
issue-41962.rs
issue-41962.stderr
issue-42344.rs
issue-42344.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-45199.rs Remove DesugaringKind::Replace. 2023-05-25 17:40:46 +00:00
issue-45199.stderr Remove DesugaringKind::Replace. 2023-05-25 17:40:46 +00:00
issue-45983.rs
issue-45983.stderr
issue-46095.rs
issue-46471.rs
issue-46471.stderr
issue-47215-ice-from-drop-elab.rs
issue-47215-ice-from-drop-elab.stderr
issue-47646.rs
issue-47646.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-51117.rs
issue-51117.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-51301.rs
issue-51301.stderr
issue-51348-multi-ref-mut-in-guard.rs
issue-51415.fixed
issue-51415.rs
issue-51415.stderr
issue-52713-bug.rs
issue-52713-bug.stderr
issue-52967-edition-2018-needs-two-phase-borrows.rs
issue-53432-nested-closure-outlives-borrowed-value.rs
issue-53432-nested-closure-outlives-borrowed-value.stderr adjust how closure/generator types and rvalues are printed 2023-09-21 22:20:58 +02:00
issue-54499-field-mutation-marks-mut-as-used.rs
issue-54499-field-mutation-marks-mut-as-used.stderr
issue-54499-field-mutation-of-moved-out-with-mut.rs
issue-54499-field-mutation-of-moved-out-with-mut.stderr
issue-54499-field-mutation-of-moved-out.rs
issue-54499-field-mutation-of-moved-out.stderr
issue-54499-field-mutation-of-never-init.rs
issue-54499-field-mutation-of-never-init.stderr
issue-54597-reject-move-out-of-borrow-via-pat.rs
issue-54597-reject-move-out-of-borrow-via-pat.stderr
issue-55492-borrowck-migrate-scans-parents.rs
issue-55492-borrowck-migrate-scans-parents.stderr
issue-55552-ascribe-wildcard-to-structured-pattern.rs
issue-58776-borrowck-scans-children.rs
issue-58776-borrowck-scans-children.stderr
issue-62007-assign-box.rs
issue-62007-assign-field.rs
issue-62107-match-arm-scopes.rs Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
issue-62107-match-arm-scopes.stderr Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
issue-62387-suggest-iter-mut-2.fixed suggest iter_mut() where trying to modify elements from .iter() 2023-09-07 00:20:38 +08:00
issue-62387-suggest-iter-mut-2.rs suggest iter_mut() where trying to modify elements from .iter() 2023-09-07 00:20:38 +08:00
issue-62387-suggest-iter-mut-2.stderr suggest iter_mut() where trying to modify elements from .iter() 2023-09-07 00:20:38 +08:00
issue-62387-suggest-iter-mut.fixed suggest iter_mut() where trying to modify elements from .iter() 2023-09-07 00:20:38 +08:00
issue-62387-suggest-iter-mut.rs suggest iter_mut() where trying to modify elements from .iter() 2023-09-07 00:20:38 +08:00
issue-62387-suggest-iter-mut.stderr suggest iter_mut() where trying to modify elements from .iter() 2023-09-07 00:20:38 +08:00
issue-64453.rs
issue-64453.stderr
issue-69789-iterator-mut-suggestion.rs
issue-69789-iterator-mut-suggestion.stderr
issue-70919-drop-in-loop.rs
issue-71546.rs
issue-80772.rs
issue-81365-1.rs
issue-81365-1.stderr
issue-81365-2.rs
issue-81365-2.stderr
issue-81365-3.rs
issue-81365-3.stderr
issue-81365-4.rs
issue-81365-4.stderr
issue-81365-5.rs
issue-81365-5.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-81365-6.rs
issue-81365-6.stderr
issue-81365-7.rs
issue-81365-7.stderr
issue-81365-8.rs
issue-81365-8.stderr
issue-81365-9.rs
issue-81365-9.stderr
issue-81365-10.rs
issue-81365-10.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-81365-11.rs
issue-81365-11.stderr
issue-81899.rs
issue-81899.stderr adjust how closure/generator types and rvalues are printed 2023-09-21 22:20:58 +02:00
issue-82032.rs
issue-82032.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-82126-mismatched-subst-and-hir.rs s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
issue-82126-mismatched-subst-and-hir.stderr s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
issue-82462.rs
issue-82462.stderr
issue-83309-ice-immut-in-for-loop.rs
issue-83309-ice-immut-in-for-loop.stderr
issue-83760.rs
issue-83760.stderr
issue-83924.fixed
issue-83924.rs
issue-83924.stderr
issue-85581.rs
issue-85581.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-85765-closure.rs use maybe_body_owned_by for closure 2023-07-14 07:12:35 +08:00
issue-85765-closure.stderr use maybe_body_owned_by for closure 2023-07-14 07:12:35 +08:00
issue-85765.rs
issue-85765.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-87456-point-to-closure.rs
issue-87456-point-to-closure.stderr
issue-88434-minimal-example.rs
issue-88434-minimal-example.stderr adjust how closure/generator types and rvalues are printed 2023-09-21 22:20:58 +02:00
issue-88434-removal-index-should-be-less.rs
issue-88434-removal-index-should-be-less.stderr adjust how closure/generator types and rvalues are printed 2023-09-21 22:20:58 +02:00
issue-91206.rs
issue-91206.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-92015.rs
issue-92015.stderr
issue-92157.rs rustc_hir_analysis: add a helper to check function the signature mismatches 2023-09-19 18:15:23 +02:00
issue-92157.stderr rustc_hir_analysis: add a helper to check function the signature mismatches 2023-09-19 18:15:23 +02:00
issue-93078.rs
issue-93078.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-93093.rs
issue-93093.stderr
issue-95079-missing-move-in-nested-closure.fixed
issue-95079-missing-move-in-nested-closure.rs
issue-95079-missing-move-in-nested-closure.stderr adjust how closure/generator types and rvalues are printed 2023-09-21 22:20:58 +02:00
issue-101119.rs
issue-101119.stderr
issue-102209.rs
issue-102209.stderr
issue-103095.rs
issue-103250.rs
issue-103250.stderr
issue-103624.rs
issue-103624.stderr
issue-104639-lifetime-order.rs
issue-109271-pass-self-into-closure.fixed
issue-109271-pass-self-into-closure.rs
issue-109271-pass-self-into-closure.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-111554.rs Don't suggest changing {ImmRef,MutRef} implicit self to be mutable 2023-05-29 13:11:03 +08:00
issue-111554.stderr Don't suggest changing {ImmRef,MutRef} implicit self to be mutable 2023-05-29 13:11:03 +08:00
issue-114374-invalid-help-fmt-args.rs Remove the unhelpful let binding diag comes from FormatArguments 2023-08-23 12:35:00 +08:00
issue-114374-invalid-help-fmt-args.stderr Remove the unhelpful let binding diag comes from FormatArguments 2023-08-23 12:35:00 +08:00
issue-115259-suggest-iter-mut.fixed suggest iter_mut() where trying to modify elements from .iter() 2023-09-07 00:20:38 +08:00
issue-115259-suggest-iter-mut.rs suggest iter_mut() where trying to modify elements from .iter() 2023-09-07 00:20:38 +08:00
issue-115259-suggest-iter-mut.stderr suggest iter_mut() where trying to modify elements from .iter() 2023-09-07 00:20:38 +08:00
kindck-implicit-close-over-mut-var.rs
lazy-init.rs
let_underscore_temporary.rs Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
let_underscore_temporary.stderr Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
many-mutable-borrows.rs
many-mutable-borrows.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
move-error-in-promoted-2.rs
move-error-in-promoted-2.stderr
move-error-in-promoted.rs
move-error-in-promoted.stderr
move-error-snippets-ext.rs
move-error-snippets.rs
move-error-snippets.stderr
move-from-union-field-issue-66500.rs
move-from-union-field-issue-66500.stderr
move-in-pattern-mut-in-loop.rs
move-in-pattern-mut-in-loop.stderr
move-in-pattern-mut.rs
move-in-pattern-mut.stderr
move-in-pattern.fixed
move-in-pattern.rs
move-in-pattern.stderr
move-in-static-initializer-issue-38520.rs
move-in-static-initializer-issue-38520.stderr
mut-borrow-in-loop-2.fixed
mut-borrow-in-loop-2.rs
mut-borrow-in-loop-2.stderr
mut-borrow-in-loop.rs
mut-borrow-in-loop.stderr
mut-borrow-of-mut-ref.rs
mut-borrow-of-mut-ref.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
mut-borrow-outside-loop.rs
mut-borrow-outside-loop.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
mutability-errors.rs
mutability-errors.stderr tweak "make mut" spans (No. 3) 2023-05-05 22:40:05 +12:00
or-patterns.rs
or-patterns.stderr
promote-ref-mut-in-let-issue-46557.rs
promote-ref-mut-in-let-issue-46557.stderr
reassignment_immutable_fields_overlapping.rs
reassignment_immutable_fields_overlapping.stderr
reassignment_immutable_fields_twice.rs
reassignment_immutable_fields_twice.stderr
reassignment_immutable_fields.rs
reassignment_immutable_fields.stderr
reborrow-sugg-move-then-borrow.rs
reborrow-sugg-move-then-borrow.stderr
regions-bound-missing-bound-in-impl.rs
regions-bound-missing-bound-in-impl.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
regions-escape-bound-fn-2.rs
regions-escape-bound-fn-2.stderr
regions-escape-bound-fn.rs
regions-escape-bound-fn.stderr
regions-escape-unboxed-closure.rs
regions-escape-unboxed-closure.stderr
return-local-binding-from-desugaring.rs
return-local-binding-from-desugaring.stderr
slice-index-bounds-check-invalidation.rs
slice-index-bounds-check-invalidation.stderr
suggest-as-ref-on-mut-closure.rs
suggest-as-ref-on-mut-closure.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
suggest-assign-rvalue.rs
suggest-assign-rvalue.stderr
suggest-local-var-double-mut.rs
suggest-local-var-double-mut.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
suggest-local-var-for-vector.rs
suggest-local-var-for-vector.stderr Improve spans for indexing expressions 2023-08-04 13:17:39 +02:00
suggest-local-var-imm-and-mut.rs
suggest-local-var-imm-and-mut.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
suggest-lt-on-ty-alias-w-generics.rs
suggest-lt-on-ty-alias-w-generics.stderr
suggest-mut-iterator.fixed Suggest mutable borrow on read only for-loop that should be mutable 2023-08-23 21:46:18 +00:00
suggest-mut-iterator.rs Suggest mutable borrow on read only for-loop that should be mutable 2023-08-23 21:46:18 +00:00
suggest-mut-iterator.stderr Suggest mutable borrow on read only for-loop that should be mutable 2023-08-23 21:46:18 +00:00
suggest-storing-local-var-for-vector.rs
suggest-storing-local-var-for-vector.stderr Improve spans for indexing expressions 2023-08-04 13:17:39 +02:00
tainted-promoteds.rs Leave promoteds untainted by errors when borrowck fails 2023-04-30 23:57:47 +02:00
tainted-promoteds.stderr Leave promoteds untainted by errors when borrowck fails 2023-04-30 23:57:47 +02:00
two-phase-across-loop.rs
two-phase-across-loop.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
two-phase-activation-sharing-interference.nll_target.stderr
two-phase-activation-sharing-interference.rs
two-phase-allow-access-during-reservation.nll_target.stderr
two-phase-allow-access-during-reservation.rs
two-phase-baseline.rs
two-phase-bin-ops.rs
two-phase-cannot-nest-mut-self-calls.rs
two-phase-cannot-nest-mut-self-calls.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
two-phase-control-flow-split-before-activation.rs
two-phase-method-receivers.rs
two-phase-multi-mut.rs
two-phase-multi-mut.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
two-phase-multiple-activations.rs
two-phase-nonrecv-autoref.base.stderr Improve spans for indexing expressions 2023-08-04 13:17:39 +02:00
two-phase-nonrecv-autoref.rs
two-phase-reservation-sharing-interference-2.rs
two-phase-reservation-sharing-interference-2.stderr
two-phase-reservation-sharing-interference.nll_target.stderr
two-phase-reservation-sharing-interference.rs
two-phase-sneaky.rs
two-phase-sneaky.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
two-phase-surprise-no-conflict.rs
two-phase-surprise-no-conflict.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
unboxed-closures-move-upvar-from-non-once-ref-closure.fixed
unboxed-closures-move-upvar-from-non-once-ref-closure.rs
unboxed-closures-move-upvar-from-non-once-ref-closure.stderr Don't use method span on clone suggestion 2023-07-10 20:09:28 +00:00