diff options
| author | bors <bors@rust-lang.org> | 2017-11-09 15:42:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-11-09 15:42:26 +0000 |
| commit | 98e791e7e135ef6526ca97c33fcf8cd0db50320f (patch) | |
| tree | 930bf2cdb7ced0ea9712a220de491d880f96c610 /src/libsyntax/json.rs | |
| parent | fd9ecfdfd01c0954172a002cc806174a077b9e3d (diff) | |
| parent | dfe218ac970f93aa93dc566156c2a54693110208 (diff) | |
| download | rust-98e791e7e135ef6526ca97c33fcf8cd0db50320f.tar.gz rust-98e791e7e135ef6526ca97c33fcf8cd0db50320f.zip | |
Auto merge of #45741 - oli-obk:refactor_suggestions, r=estebank
Refactor internal suggestion API ~~The only functional change is that whitespace, which is suggested to be added, also gets `^^^^` under it. An example is shown in the tests (the only test that changed).~~ Continuation of #41876 r? @nagisa the changes are probably best viewed [without whitespace](https://github.com/rust-lang/rust/pull/45741/files?w=1)
Diffstat (limited to 'src/libsyntax/json.rs')
| -rw-r--r-- | src/libsyntax/json.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs index 74a762f2f62..6564046ffe6 100644 --- a/src/libsyntax/json.rs +++ b/src/libsyntax/json.rs @@ -284,17 +284,17 @@ impl DiagnosticSpan { fn from_suggestion(suggestion: &CodeSuggestion, je: &JsonEmitter) -> Vec<DiagnosticSpan> { - suggestion.substitution_parts + suggestion.substitutions .iter() .flat_map(|substitution| { - substitution.substitutions.iter().map(move |suggestion| { + substitution.parts.iter().map(move |suggestion| { let span_label = SpanLabel { - span: substitution.span, + span: suggestion.span, is_primary: true, label: None, }; DiagnosticSpan::from_span_label(span_label, - Some(suggestion), + Some(&suggestion.snippet), je) }) }) |
