rust/src/test/ui/borrowck
Felix S. Klock II a5a3f765eb NLL: On "cannot move out of type" error, print original source before rewrite.
* Arguably this change is sometimes injecting noise into the output
   (namely in the cases where the suggested rewrite is inline with the
   suggestion and we end up highlighting the original source code).
   I would not be opposed to something more aggressive/dynamic, like
   revising the suggestion code to automatically print the original
   source when necessary (e.g. when the error does not have a span
   that includes the span of the suggestion).

 * Also, as another note on this change: The doc comment for `Diagnostic::span_suggestion`
   says:
    /// The message
    ///
    /// * should not end in any punctuation (a `:` is added automatically)
    /// * should not be a question
    /// * should not contain any parts like "the following", "as shown"

   but the `:` is *not* added when the emitted line appears
   out-of-line relative to the suggestion. I find that to be an
   unfortunate UI experience.

----

As a drive-by fix, also changed code to combine multiple suggestions
for a pattern into a single multipart suggestion (which vastly
improves user experience IMO).

----

Includes the updates to expected NLL diagnostics.
2018-07-31 17:27:29 +02: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 remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
borrowck-escaping-closure-error-1.nll.stderr Don't match on region kinds when reporting NLL errors 2018-07-23 20:54:09 +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 Don't match on region kinds when reporting NLL errors 2018-07-23 20:54:09 +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 Use better spans for dummy accesses used in matches 2018-07-26 22:06:12 +01:00
issue-45983.nll.stderr Improved closure errors. 2018-07-22 12:49:35 +01:00
issue-45983.rs Move diagnostic logic to its own module 2018-01-15 11:12:25 -08:00
issue-45983.stderr Update UI tests 2018-02-26 20:24:02 +03: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
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 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.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 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.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 Add test from #49736 2018-04-06 15:00:45 -04: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