about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-08-01 10:13:06 +0200
committerGitHub <noreply@github.com>2018-08-01 10:13:06 +0200
commit14546cd5010b57735a76e1fa420405cb36092963 (patch)
tree05851b759f93030348e7d0e47c3955c64747865e /src/rustllvm/RustWrapper.cpp
parentac2b3c37123ef4407ccf50888e1cc21dbbac7e57 (diff)
parenta5a3f765eb36aee69bfdaba1f82760973b63c780 (diff)
downloadrust-14546cd5010b57735a76e1fa420405cb36092963.tar.gz
rust-14546cd5010b57735a76e1fa420405cb36092963.zip
Rollup merge of #52907 - pnkfelix:issue-52877-original-source-should-precede-suggestions, r=petrochenkov
NLL: On "cannot move out of type" error, print original before rewrite

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:
```rust
    /// 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.

Fix #52877
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions