about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2018-07-31 17:22:12 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2018-07-31 17:27:29 +0200
commita5a3f765eb36aee69bfdaba1f82760973b63c780 (patch)
treedc6d1485eff0d0b0895ee7aeeab8e386d2d38686 /src/rustllvm/RustWrapper.cpp
parent896113201034946c7f49c1049288665fa2a56e32 (diff)
downloadrust-a5a3f765eb36aee69bfdaba1f82760973b63c780.tar.gz
rust-a5a3f765eb36aee69bfdaba1f82760973b63c780.zip
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.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions