rust/src/test/ui/borrowck
bors 78ec12df02 Auto merge of #53045 - pnkfelix:issue-53026-migrate-never-looser-than-ast-borrowck, r=estebank
Fix NLL migration mode so that reports region errors when necessary.

The code here was trying to be clever, and say "lets not report diagnostics when we 'know' NLL will report an error about them in the future."

The problem is that in migration mode, when no error was reported here, the NLL error that we "knew" was coming was downgraded to a warning (!).

Thus causing #53026

(I hope it is the only instance of such a scenario, but we will see.)

Anyway, this PR fixes that by only doing the "clever" skipping of region error reporting when we are not in migration mode. As noted in the FIXME, I'm not really thrilled with this band-aid, but it is small enough to be back-ported easily if that is necessary.

Rather than make a separate test for issue 53026, I just took the test that uncovered this in a first place, and extended it (via our revisions system) to explicitly show all three modes in action: AST-borrowck, NLL, and NLL migration mode.

(To be honest I hope not to have to add such revisions to many tests. Instead I hope to adopt some sort of new `compare-mode` for either borrowck=migrate or for the 2018 edition as a whole.)

Fix #53026
2018-08-06 12:00:12 +00:00
..
borrowck-box-insensitivity.nll.stderr Fix erroneous error note when using field after move 2018-06-22 18:23:33 -03:00
borrowck-box-insensitivity.rs Be ambiguous when type cannot be properly mentioned 2018-01-02 19:49:38 -08:00
borrowck-box-insensitivity.stderr update tests 2018-03-14 00:53:24 +01:00
borrowck-closures-two-mut.rs remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
borrowck-closures-two-mut.stderr Update tests for new spans for nll errors involving closures 2018-08-03 23:00:27 +01:00
borrowck-escaping-closure-error-1.nll.stderr Update tests for new spans for nll errors involving closures 2018-08-03 23:00:27 +01:00
borrowck-escaping-closure-error-1.rs Remove NOTE/HELP annotations from UI tests 2017-12-14 23:26:39 +03:00
borrowck-escaping-closure-error-1.stderr update tests 2018-03-14 00:53:24 +01:00
borrowck-escaping-closure-error-2.nll.stderr Update tests for new spans for nll errors involving closures 2018-08-03 23:00:27 +01:00
borrowck-escaping-closure-error-2.rs Remove NOTE/HELP annotations from UI tests 2017-12-14 23:26:39 +03:00
borrowck-escaping-closure-error-2.stderr update tests 2018-03-14 00:53:24 +01:00
borrowck-feature-nll-overrides-migrate.edition.stderr Incorporate edition flag testing into tests of -Z borrowck=migrate. 2018-07-26 14:59:00 +02:00
borrowck-feature-nll-overrides-migrate.rs Incorporate edition flag testing into tests of -Z borrowck=migrate. 2018-07-26 14:59:00 +02:00
borrowck-feature-nll-overrides-migrate.zflag.stderr Incorporate edition flag testing into tests of -Z borrowck=migrate. 2018-07-26 14:59:00 +02:00
borrowck-in-static.nll.stderr Add specific message when moving from upvars in a non-FnOnce closure 2018-07-21 18:40:46 +01:00
borrowck-in-static.rs Remove NOTE/HELP annotations from UI tests 2017-12-14 23:26:39 +03:00
borrowck-in-static.stderr update tests 2018-03-14 00:53:24 +01:00
borrowck-migrate-to-nll.edition.stderr Incorporate edition flag testing into tests of -Z borrowck=migrate. 2018-07-26 14:59:00 +02:00
borrowck-migrate-to-nll.rs Incorporate edition flag testing into tests of -Z borrowck=migrate. 2018-07-26 14:59:00 +02:00
borrowck-migrate-to-nll.zflag.stderr Incorporate edition flag testing into tests of -Z borrowck=migrate. 2018-07-26 14:59:00 +02:00
borrowck-move-error-with-note.nll.stderr NLL: On "cannot move out of type" error, print original source before rewrite. 2018-07-31 17:27:29 +02:00
borrowck-move-error-with-note.rs Remove NOTE/HELP annotations from UI tests 2017-12-14 23:26:39 +03:00
borrowck-move-error-with-note.stderr update tests 2018-03-14 00:53:24 +01:00
borrowck-move-out-of-vec-tail.nll.stderr NLL: On "cannot move out of type" error, print original source before rewrite. 2018-07-31 17:27:29 +02:00
borrowck-move-out-of-vec-tail.rs Remove NOTE/HELP annotations from UI tests 2017-12-14 23:26:39 +03:00
borrowck-move-out-of-vec-tail.stderr update tests 2018-03-14 00:53:24 +01:00
borrowck-reinit.rs Update tests for -Zborrowck-mir -> -Zborrowck=mode migration 2017-11-26 16:39:15 +01:00
borrowck-reinit.stderr update tests 2018-03-14 00:53:24 +01:00
borrowck-report-with-custom-diagnostic.nll.stderr rust-lang/rust#51025: improve test robustness so that they work under NLL too. 2018-05-25 13:00:51 +02:00
borrowck-report-with-custom-diagnostic.rs rust-lang/rust#51025: improve test robustness so that they work under NLL too. 2018-05-25 13:00:51 +02:00
borrowck-report-with-custom-diagnostic.stderr rust-lang/rust#51025: improve test robustness so that they work under NLL too. 2018-05-25 13:00:51 +02:00
borrowck-slice-pattern-element-loan.rs fix for issue #8636 2018-07-05 11:34:10 +01:00
borrowck-slice-pattern-element-loan.stderr fix for issue #8636 2018-07-05 11:34:10 +01:00
borrowck-vec-pattern-nesting.nll.stderr NLL: On "cannot move out of type" error, print original source before rewrite. 2018-07-31 17:27:29 +02:00
borrowck-vec-pattern-nesting.rs Drive-by: Make assignment conflict tests in borrowck-vec-pattern-nesting.rs robust for NLL. 2018-06-06 22:42:27 +02:00
borrowck-vec-pattern-nesting.stderr Update the expected error output to reflect changes in this PR. 2018-06-06 22:42:27 +02:00
immutable-arg.rs Modify message to match label 2018-01-10 11:41:12 -08:00
immutable-arg.stderr Update the existing UI tests to reflect diagnostic changes in NLL. 2018-06-19 19:41:48 +02:00
issue-7573.nll.stderr Fallback to general error handling in ICE cases. 2018-07-22 12:53:55 +01:00
issue-7573.rs Tweak wording and spans of closure lifetime errors 2018-01-19 13:28:43 -08:00
issue-7573.stderr Update UI tests 2018-02-26 20:24:42 +03:00
issue-41962.rs Fix erroneous error note when using field after move 2018-06-22 18:23:33 -03:00
issue-41962.stderr Update tests that use -Z borrowck=compare or #[feature(nll)] to accmmodate diagnostic change. 2018-07-31 14:36:50 +02:00
issue-45983.ast.stderr An attempt to fix NLL migration mode so that reports region errors when necessary. 2018-08-04 00:12:15 +02:00
issue-45983.migrate.stderr An attempt to fix NLL migration mode so that reports region errors when necessary. 2018-08-04 00:12:15 +02:00
issue-45983.nll.stderr An attempt to fix NLL migration mode so that reports region errors when necessary. 2018-08-04 00:12:15 +02:00
issue-45983.rs An attempt to fix NLL migration mode so that reports region errors when necessary. 2018-08-04 00:12:15 +02:00
issue-51117.nll.stderr change PointerKind::Implicit to a note 2018-05-31 10:17:51 -04:00
issue-51117.rs change PointerKind::Implicit to a note 2018-05-31 10:17:51 -04:00
issue-51117.stderr change PointerKind::Implicit to a note 2018-05-31 10:17:51 -04:00
issue-51348-multi-ref-mut-in-guard.rs Regression test for the bug. 2018-07-26 15:15:19 +02:00
issue-51415.nll.stderr NLL: On "cannot move out of type" error, print original source before rewrite. 2018-07-31 17:27:29 +02:00
issue-51415.rs use pat_ty_adjusted from expr_use_visitor to type of arguments 2018-06-21 14:32:52 -04:00
issue-51415.stderr use pat_ty_adjusted from expr_use_visitor to type of arguments 2018-06-21 14:32:52 -04:00
issue-52967-edition-2018-needs-two-phase-borrows.rs When we turn on NLL migration in the 2018 edition, we need two-phase borrows too! 2018-08-02 13:51:13 +02:00
mut-borrow-in-loop.nll.stderr consolidate and use find_sub_region_live_at for everything 2018-07-25 06:38:21 +03:00
mut-borrow-in-loop.rs Merge cfail and ui tests into ui tests 2017-11-24 11:32:35 +01:00
mut-borrow-in-loop.stderr update tests 2018-03-14 00:53:24 +01:00
mut-borrow-of-mut-ref.nll.stderr Update tests for new NLL mutability errors 2018-07-20 20:01:15 +01:00
mut-borrow-of-mut-ref.rs Suggest not mutably borrowing a mutable reference 2018-06-01 23:17:10 +02:00
mut-borrow-of-mut-ref.stderr Suggest not mutably borrowing a mutable reference 2018-06-01 23:17:10 +02:00
mut-borrow-outside-loop.nll.stderr Errors are more specific in cases where borrows are used in future iterations of loops. 2018-08-01 17:42:15 +02:00
mut-borrow-outside-loop.rs rust-lang/rust#51025: improve test robustness so that they work under NLL too. 2018-05-25 13:00:51 +02:00
mut-borrow-outside-loop.stderr rust-lang/rust#51025: improve test robustness so that they work under NLL too. 2018-05-25 13:00:51 +02:00
mutability-errors.nll.stderr Update tests for new NLL mutability errors 2018-07-20 20:01:15 +01:00
mutability-errors.rs Update tests for new NLL mutability errors 2018-07-20 20:01:15 +01:00
mutability-errors.stderr Update tests for new NLL mutability errors 2018-07-20 20:01:15 +01:00
promote-ref-mut-in-let-issue-46557.nll.stderr update error messages -- in some cases maybe we should investigate 2018-08-03 08:31:17 +02:00
promote-ref-mut-in-let-issue-46557.rs also check let arms and nested patterns for mutable borrows 2018-06-01 10:06:02 -04:00
promote-ref-mut-in-let-issue-46557.stderr also check let arms and nested patterns for mutable borrows 2018-06-01 10:06:02 -04:00
regions-bound-missing-bound-in-impl.rs Also point to free named region on lifetime errors 2018-06-28 11:12:44 -07:00
regions-bound-missing-bound-in-impl.stderr Also point to free named region on lifetime errors 2018-06-28 11:12:44 -07:00
regions-escape-bound-fn-2.nll.stderr Improved closure errors. 2018-07-22 12:49:35 +01:00
regions-escape-bound-fn-2.rs Move diagnostic logic to its own module 2018-01-15 11:12:25 -08:00
regions-escape-bound-fn-2.stderr Update UI tests 2018-02-26 20:24:02 +03:00
regions-escape-bound-fn.nll.stderr Improved closure errors. 2018-07-22 12:49:35 +01:00
regions-escape-bound-fn.rs Move diagnostic logic to its own module 2018-01-15 11:12:25 -08:00
regions-escape-bound-fn.stderr Update UI tests 2018-02-26 20:24:02 +03:00
regions-escape-unboxed-closure.nll.stderr Improved closure errors. 2018-07-22 12:49:35 +01:00
regions-escape-unboxed-closure.rs Move diagnostic logic to its own module 2018-01-15 11:12:25 -08:00
regions-escape-unboxed-closure.stderr Update UI tests 2018-02-26 20:24:02 +03:00
two-phase-method-receivers.rs remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
two-phase-multi-mut.rs Add test from #49736 2018-04-06 15:00:45 -04:00
two-phase-multi-mut.stderr Update tests that use -Z borrowck=compare or #[feature(nll)] to accmmodate diagnostic change. 2018-07-31 14:36:50 +02:00
two-phase-multiple-activations.rs remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
unboxed-closures-move-upvar-from-non-once-ref-closure.nll.stderr Add specific message when moving from upvars in a non-FnOnce closure 2018-07-21 18:40:46 +01:00
unboxed-closures-move-upvar-from-non-once-ref-closure.rs Remove NOTE/HELP annotations from UI tests 2017-12-14 23:26:39 +03:00
unboxed-closures-move-upvar-from-non-once-ref-closure.stderr update tests 2018-03-14 00:53:24 +01:00