about summary refs log tree commit diff
path: root/src/librustc_errors
AgeCommit message (Collapse)AuthorLines
2019-09-17Take Diagnostic in Handler::emit_diagnosticMark Rousskov-15/+9
2019-09-17Replace DiagnosticBuilder with Diagnostic when emitting errorMark Rousskov-11/+24
2019-09-16Fix failure note `to_str` implementationAfnan Enayet-7/+10
* Serialize the level to something a little more useful for a failure note struct * Update tests accordingly
2019-09-14Rollup merge of #64374 - nnethercote:box-DiagnosticBuilder, r=zackmdavisMazdak Farrokhzad-37/+48
Box `DiagnosticBuilder`. It's a large type -- 176 bytes on 64-bit. And it's passed around and returned from a lot of functions, including within `PResult`. This commit boxes it, which reduces memory traffic. In particular, `PResult` shrinks to 16 bytes in the best case; this reduces instruction counts by up to 2% on various workloads. The commit touches a lot of lines but it's almost all trivial plumbing changes.
2019-09-12Box `DiagnosticBuilder`.Nicholas Nethercote-37/+48
It's a large type -- 176 bytes on 64-bit. And it's passed around and returned from a lot of functions, including within PResult. This commit boxes it, which reduces memory traffic. In particular, `PResult` shrinks to 16 bytes in the best case; this reduces instruction counts by up to 2% on various workloads.
2019-09-08Dedent macro definitionV1shvesh-3/+3
2019-09-08Remove extra trailing newlineV1shvesh-1/+0
2019-09-08Add pluralise macroV1shvesh-0/+8
Adress issue #64238. Create a macro to be used for pluralisation check throughout rustc codebase.
2019-09-06Rollup merge of #64206 - phansch:update_issue_number, r=varkorMazdak Farrokhzad-1/+1
annotate-snippet emitter: Update an issue number The tracking issue has been replaced by one with mentoring instructions (#64205).
2019-09-06annotate-snippet emitter: Update issue numberPhilipp Hansch-1/+1
The tracking issue has been replaced by one with mentoring instructions.
2019-09-05annotate-snippet emitter: Deal with multispans from macros, tooPhilipp Hansch-126/+137
This moves the two methods from the `EmitterWriter` impl to trait default methods in the `Emitter` trait so that they can be re-used by the `AnnotateSnippetEmitterWriter`. Closes #61810
2019-09-03Rollup merge of #64058 - phansch:refactor_out_method, r=estebankMazdak Farrokhzad-12/+32
librustc_errors: Extract sugg/subst handling into method An initial refactoring before working on #61809. This moves the whole block into a method so that it can be reused in the annotate-snippet emitter. The method is already used in the new emitter, but there's no UI tests with suggestions included in this PR. A first look at some UI tests with suggestions showed that there's some more work to do in [annotate-snippet-rs][annotate-snippet-rs] before the new output is closer to the current one, so I opted to do that in a second step. r? @estebank [annotate-snippet-rs]: https://github.com/rust-lang/annotate-snippets-rs
2019-09-01librustc_errors: Extract sugg/subst handling into methodPhilipp Hansch-12/+32
An initial refactoring before working on #61809. This moves the whole block into a method so that it can be reused in the annotate-snippet output. It's already used in the new emitter, but there's no UI tests with suggestions included in this PR. A first look at some UI tests with suggestions showed that there's some more work to do in [annotate-snippet-rs][annotate-snippet-rs] before the new output is closer to the current one.
2019-08-31Use saturating_subEsteban Küber-4/+6
2019-08-30Tweak terminal width trimmingEsteban Küber-2/+2
Properly account for left margin when setting terminal width through CLI flag and don't trim code by default if we can't get the terminal's dimensions.
2019-08-30Account for rounding errors when deciding the diagnostic boundariesEsteban Küber-2/+2
2019-08-21Add terminal_width debugging flagEsteban Küber-8/+18
2019-08-21Further unicode checksEsteban Küber-10/+20
2019-08-21Center trim on the span labels and handle unicodeEsteban Küber-22/+35
2019-08-21Fix tidyEsteban Küber-11/+10
2019-08-21Introduce `term-size` dependency and consider term width when trimmingEsteban Küber-93/+160
2019-08-21clean upEsteban Küber-63/+157
2019-08-21Strip code to the left and right in diagnostics for long linesEsteban Küber-32/+118
2019-08-15syntax_pos: `NO_EXPANSION`/`SyntaxContext::empty()` -> `SyntaxContext::root()`Vadim Petrochenkov-3/+2
For consistency with `ExpnId::root`. Also introduce a helper `Span::with_root_ctxt` for creating spans with `SyntaxContext::root()` context
2019-08-14remove unused Level::PhaseFatalAleksey Kladov-7/+3
2019-08-12DiagnosticBuilder docsRalf Jung-0/+6
2019-07-28Auto merge of #63090 - Centril:rollup-xnjwm2h, r=Centrilbors-1/+2
Rollup of 8 pull requests Successful merges: - #61856 (Lint attributes on function arguments) - #62360 (Document that ManuallyDrop::drop should not called more than once) - #62392 (Update minifier-rs version) - #62871 (Explicit error message for async recursion.) - #62995 (Avoid ICE when suggestion span is at Eof) - #63053 (SystemTime docs: recommend Instant for elapsed time) - #63081 (tidy: Cleanup the directory whitelist) - #63088 (Remove anonymous_parameters from unrelated test) Failed merges: r? @ghost
2019-07-28Rollup merge of #62995 - estebank:issue-62973, r=varkorMazdak Farrokhzad-1/+2
Avoid ICE when suggestion span is at Eof Fix #62973.
2019-07-28Deny `unused_lifetimes` through rustbuildVadim Petrochenkov-1/+0
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-2/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-07-26Rollup merge of #62985 - phansch:support_ui_testing_flag, r=estebankMazdak Farrokhzad-7/+3
librustc_errors: Support ui-testing flag in annotate-snippet emitter This adds support for the `-Z ui-testing` flag to the new annotate-snippet diagnostic emitter. Support for the flag was added to `annotate-snippet-rs` in these PRs: * https://github.com/rust-lang/annotate-snippets-rs/pull/3 * https://github.com/rust-lang/annotate-snippets-rs/pull/5 r? @estebank Closes #61811
2019-07-25Avoid ICE when suggestion span is at EofEsteban Küber-1/+2
2019-07-25librustc_errors: Support ui-testing flag in annotate-snippet emitterPhilipp Hansch-7/+3
This adds support for the `-Z ui-testing` flag to the new annotate-snippet diagnostic emitter. The support for the flag was added to `annotate-snippet-rs` in these PRs: * https://github.com/rust-lang/annotate-snippets-rs/pull/3 * https://github.com/rust-lang/annotate-snippets-rs/pull/5 Closes #61811
2019-07-23cleanup: Remove `extern crate serialize as rustc_serialize`sVadim Petrochenkov-4/+1
2019-07-11Emit dropped unemitted errors to aid in ICE debuggingEsteban Küber-3/+6
2019-07-11syntax: Make def-site span mandatory in ↵Vadim Petrochenkov-33/+31
ExpnInfo/MacroBacktrace/DiagnosticSpanMacroExpansion We have to deal with dummy spans anyway Remove def-site span from expander interfaces. It's not used by the expansion infra, only by specific expanders, which can keep it themselves if they want it.
2019-07-07rustc: Remove `dylib` crate type from most rustc cratesAlex Crichton-2/+1
Now that procedural macros no longer link transitively to libsyntax, this shouldn't be needed any more! This commit is an experiment in removing all dynamic libraries from rustc except for librustc_driver itself. Let's see how far we can get with that!
2019-07-05Rollup merge of #61545 - flip1995:internal_lints, r=oli-obkMazdak Farrokhzad-1/+0
Implement another internal lints cc #49509 This adds ~~two~~ one internal lint~~s~~: 1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669 2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~ ~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~ TODO (not directly relevant for review): - [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb) - [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870 - [x] Check explicitly for the `{declare,impl}_lint_pass!` macros r? @oli-obk
2019-07-03Remove needless lifetimesJeremy Stucki-43/+43
2019-06-27Rollup merge of #62131 - Xanewok:clip-some-nits, r=petrochenkovMazdak Farrokhzad-4/+4
libsyntax: Fix some Clippy warnings When I was working on it before a lot of these popped up in the RLS so I figured I'll send a small patch fixing only the (hopefully) uncontroversial ones. Others that could be also fixed included also [`clippy::print_with_newline`](https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline) and [`clippy::cast_lossless`](https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless). Should I add them as well? since most of it touches libsyntax... r? @petrochenkov
2019-06-26Fix clippy::print_with_newlineIgor Matuszewski-2/+2
2019-06-26Fix clippy::redundant_field_namesIgor Matuszewski-2/+2
2019-06-24Enable internal lints in bootstrapflip1995-1/+0
2019-06-22Count all errors for `track_errors`Matthew Jasper-3/+13
2019-06-22Prefer to use `has_errors` to `err_count`Matthew Jasper-4/+3
2019-06-17Make use of `ptr::null(_mut)` instead of casting zeroLzu Tao-1/+1
2019-06-15Remove unnecessary `.clone()`Shotaro Yamada-1/+1
2019-06-11Auto merge of #61741 - Centril:rollup-fgro5kz, r=Centrilbors-1/+15
Rollup of 11 pull requests Successful merges: - #61518 (Add loops to doc list of things not stable in const fn) - #61526 (move some tests into subfolders) - #61550 (Windows 10 SDK is also required now.) - #61606 (Remove some legacy proc macro flavors) - #61652 (Mention slice patterns in array) - #61686 (librustc_errors: Add some more documentation) - #61698 (typeck: Fix const generic in repeat param ICE.) - #61707 (Azure: retry failed awscli installs) - #61715 (make sure make_ascii_lowercase actually leaves upper-case non-ASCII characters alone) - #61724 (core: use memcmp optimization for 128 bit integer slices) - #61726 (Use `for_each` in `Iterator::partition`) Failed merges: r? @ghost
2019-06-11Add deny(unused_lifetimes) to all the crates that have deny(internal).Eduard-Mihai Burtescu-0/+1
2019-06-10Address review commentsPhilipp Hansch-2/+3
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>