about summary refs log tree commit diff
path: root/src/libsyntax_ext/format.rs
AgeCommit message (Collapse)AuthorLines
2019-01-11don't unwrap unexpected tokens in `format!`Andy Russell-1/+1
Fixes #57512.
2019-01-02make `panictry!` private to libsyntaxAndy Russell-21/+27
This commit completely removes usage of the `panictry!` macro from outside libsyntax. The macro causes parse errors to be fatal, so using it in libsyntax_ext caused parse failures *within* a syntax extension to be fatal, which is probably not intended. Furthermore, this commit adds spans to diagnostics emitted by empty extensions if they were missing, à la #56491.
2018-12-31Use structured suggestion for braceless unicode escape squenceEsteban Küber-2/+2
2018-12-31Account for `\xFF` and `\u{FF}` sequences in string format errorsEsteban Küber-0/+45
2018-12-30Improve error recovery for some built-in macrosVadim Petrochenkov-12/+14
2018-12-29Auto merge of #57140 - estebank:str-err, r=varkorbors-2/+9
Tweaks to format string diagnostics Add label spans and fix incorrect spans. Fix #55155, fix #55350.
2018-12-27Make sure feature gate errors are recoverableVadim Petrochenkov-1/+0
2018-12-27Fix `trace_macros` and `log_syntax`Vadim Petrochenkov-3/+3
2018-12-27Do not abort compilation if expansion produces errorsVadim Petrochenkov-2/+2
Fix a number of uncovered deficiencies in diagnostics
2018-12-26Add span label to unused string formatting argumentEsteban Küber-1/+6
Fix #55350.
2018-12-26Point at correct span for arguments in format stringsEsteban Küber-1/+3
When a format string has escaped whitespace characters format arguments were shifted by one per each escaped character. Account for these escaped characters when synthesizing the spans. Fix #55155.
2018-12-26Various changes to string format diagnosticsEsteban Küber-8/+69
- Point at opening mismatched formatting brace - Account for differences between raw and regular strings - Account for differences between the code snippet and `InternedString` - Add more tests
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-14format: minor stylistic improvementsljedrz-12/+6
2018-12-14format: refactor verify_arg_typeljedrz-22/+16
2018-12-14format: refactor report_invalid_referencesljedrz-25/+21
2018-12-14format: remove unreachable conditionljedrz-22/+9
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-09-17Whitespace fix again.Vitaly _Vi Shukela-3/+3
2018-09-17Fill in suggestions Applicability according to @estebankVitaly _Vi Shukela-3/+3
Also fix some formatting along the way.
2018-09-16Attach Applicability to multipart_suggestion and span_suggestionsVitaly _Vi Shukela-1/+2
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-8/+8
2018-08-22Rollup merge of #53504 - ekse:suggestions-applicability-2, r=estebankGuillaume Gomez-1/+3
Set applicability for more suggestions. Converts a couple more calls to `span_suggestion_with_applicability` (#50723). To be on the safe side, I marked suggestions that depend on the intent of the user or that are potentially lossy conversions as MaybeIncorrect. r? @estebank
2018-08-21Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkorkennytm-1/+1
Fix typos found by codespell.
2018-08-20Set applicability for more suggestions.Sébastien Duquette-1/+3
2018-08-19mv codemap() source_map()Donato Sciarra-1/+1
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-08-09Use Cow<str> in describe_num_argsljedrz-6/+8
2018-08-09Refactor expand_preparsed_format_argsljedrz-55/+62
2018-08-06Point at correct span when missing comma in `println`Esteban Küber-1/+1
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-8/+7
2018-07-24Add span label for format str missing specifierEsteban Küber-8/+11
2018-07-24Use suggestions for `printf` formatEsteban Küber-1/+16
2018-07-24Reword missing formatting arguments labelEsteban Küber-1/+1
2018-07-23Only point at inside of string literals if they're actually string literalsEsteban Küber-6/+24
2018-07-23Point only at invalid positional argumentsEsteban Küber-62/+76
2018-07-23Point at incorrect named arg in format stringEsteban Küber-2/+19
2018-07-22Point at internal span in format stringEsteban Küber-12/+22
2018-07-21fix logic bugEsteban Küber-2/+2
2018-07-21Remove dependency on `libsyntax`Esteban Küber-1/+5
2018-07-21Gate `format_args_nll` behind feature flagEsteban Küber-0/+15
2018-07-21Suggest space separated format str literalEsteban Küber-1/+1
2018-07-19Use correct spans for format string errorsEsteban Küber-1/+1
When encountering format string errors in a raw string, or regular string literal with embedded newlines, account for the positional change to use correct spans. :drive by fix: 🚗
2018-07-19rework printlnEsteban Küber-2/+20
2018-07-19Improve suggestion for missing fmt str in printlnEsteban Küber-6/+22
Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal.
2018-07-12Deny bare trait objects in src/libsyntax_extljedrz-1/+1
2018-05-26Add `Ident::as_str` helperVadim Petrochenkov-1/+1
2018-05-17Rollup merge of #50610 - estebank:fmt-str, r=KimundiMark Simulacrum-3/+6
Improve format string errors Point at format string position inside the formatting string: ``` error: invalid format string: unmatched `}` found --> $DIR/format-string-error.rs:21:22 | LL | let _ = format!("}"); | ^ unmatched `}` in format string ``` Explain that argument names can't start with an underscore: ``` error: invalid format string: invalid argument name `_foo` --> $DIR/format-string-error.rs:15:23 | LL | let _ = format!("{_foo}", _foo = 6usize); | ^^^^ invalid argument name in format string | = note: argument names cannot start with an underscore ``` Fix #23476. The more accurate spans will only be seen when using `format!` directly, when using `println!` the diagnostics machinery makes the span be the entire statement.
2018-05-17Rename trans to codegen everywhere.Irina Popa-14/+14
2018-05-10Improve format string errorsEsteban Küber-3/+6
- Point at format string position inside the formatting string - Explain that argument names can't start with an underscore