Commit graph

11 commits

Author SHA1 Message Date
Mark Rousskov
cdd805506e Replace DiagnosticBuilder with Diagnostic when emitting error 2019-09-17 09:29:46 -04:00
Nicholas Nethercote
2fcd870711 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.
2019-09-12 08:29:17 +10:00
Mazdak Farrokhzad
8111cca73e
Rollup merge of #64206 - phansch:update_issue_number, r=varkor
annotate-snippet emitter: Update an issue number

The tracking issue has been replaced by one with mentoring instructions (#64205).
2019-09-06 19:00:50 +02:00
Philipp Hansch
0ca645ac5f
annotate-snippet emitter: Update issue number
The tracking issue has been replaced by one with mentoring instructions.
2019-09-06 07:34:55 +02:00
Philipp Hansch
159d249705
annotate-snippet emitter: Deal with multispans from macros, too
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-05 21:31:12 +02:00
Philipp Hansch
84ccbe2076
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 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-09-01 13:05:47 +02:00
Aleksey Kladov
ed7317cebe remove unused Level::PhaseFatal 2019-08-14 22:22:46 +03:00
Philipp Hansch
dd0f2ac250
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.

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-25 21:03:53 +02:00
Igor Matuszewski
12806b7050 Fix clippy::redundant_field_names 2019-06-26 13:59:58 +02:00
Shotaro Yamada
6a0abd6048 Remove unnecessary .clone() 2019-06-15 20:46:00 +09:00
Philipp Hansch
df076b2d5e
librustc_errors: Rename AnnotateRs -> AnnotateSnippet
The proper name of the library is `annotate-snippet`, not `annotate-rs`,
this commit should get rid of any confusing `AnnotateRs` names.

1. Renames `annotate_rs_emitter.rs` to
   `annotate_snippet_emitter_writer.rs` so that the difference between the
   `Emitter` trait and the implementers is more clear.
2. Renames `AnnotateRsEmitterWriter` to `AnnotateSnippetEmitterWriter`
3. Renames `HumanReadableErrorType::AnnotateRs` to `HumanReadableErrorType::AnnotateSnippet`
2019-06-05 21:43:55 +02:00
Renamed from src/librustc_errors/annotate_rs_emitter.rs (Browse further)