diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-01-19 14:21:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-19 14:21:23 +0100 |
| commit | e78bde401524a430290dd5e5f1fc404422f8be2e (patch) | |
| tree | 6b4848d00a16a6df28c16e8f5fea3c29a21ef33c /src/libsyntax/parse | |
| parent | c8c03afa5762624b37877c00485a5b0ca0d07797 (diff) | |
| parent | 02843d9eb71ad50d490afc6276f4bfe59f182624 (diff) | |
| download | rust-e78bde401524a430290dd5e5f1fc404422f8be2e.tar.gz rust-e78bde401524a430290dd5e5f1fc404422f8be2e.zip | |
Rollup merge of #57699 - euclio:applicability-ify, r=petrochenkov
add applicability to remaining suggestions Fixes #50723. I noticed that the suggestion methods on `DiagnosticBuilder` weren't actually deprecated due to #57679. This PR deprecates them properly and fixes the remaining usages. There's also a PR for clippy at rust-lang/rust-clippy#3667.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index bdbca30c645..7e15b231276 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4063,12 +4063,13 @@ impl<'a> Parser<'a> { if let Some(mut err) = delayed_err { if let Some(etc_span) = etc_span { - err.multipart_suggestion( + err.multipart_suggestion_with_applicability( "move the `..` to the end of the field list", vec![ (etc_span, String::new()), (self.span, format!("{}.. }}", if ate_comma { "" } else { ", " })), ], + Applicability::MachineApplicable, ); } err.emit(); @@ -6904,7 +6905,11 @@ impl<'a> Parser<'a> { let mut err = self.struct_span_err(fixed_name_sp, error_msg); err.span_label(fixed_name_sp, "dash-separated idents are not valid"); - err.multipart_suggestion(suggestion_msg, replacement); + err.multipart_suggestion_with_applicability( + suggestion_msg, + replacement, + Applicability::MachineApplicable, + ); err.emit(); } Ok(ident) |
