summary refs log tree commit diff
path: root/src/librustc_errors
AgeCommit message (Collapse)AuthorLines
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-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>
2019-06-10librustc_errors: Add some more documentationPhilipp Hansch-1/+14
2019-06-08Remove unused `#![feature(custom_attribute)]`sVadim Petrochenkov-1/+0
2019-06-05librustc_errors: Rename AnnotateRs -> AnnotateSnippetPhilipp Hansch-13/+13
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-04eprint -> eprintln to add trailing newlinePhilipp Hansch-1/+1
2019-06-04Simplify source_string and block-format methodsPhilipp Hansch-14/+13
2019-06-04Print to stderr and blessPhilipp Hansch-1/+4
2019-06-04Add new diagnostic writer using annotate-snippet libraryPhilipp Hansch-2/+216
This adds a new diagnostic writer `AnnotateRsEmitterWriter` that uses the [`annotate-snippet`][as] library to print out the human readable diagnostics. The goal is to eventually switch over to using the library instead of maintaining our own diagnostics output. This commit does *not* add all the required features to the new diagnostics writer. It is only meant as a starting point so that other people can contribute as well. [as]: https://github.com/rust-lang/annotate-snippets-rs
2019-05-28librustc_errors: Move annotation collection to own implPhilipp Hansch-167/+174
Extracted from work on #59346. This moves the annotation collection to the `FileWithAnnotatedLines` impl to allow re-use in a separate EmitterWriter.
2019-05-23Rollup merge of #61073 - phansch:remove_unused_annotation_style, r=matthewjasperMazdak Farrokhzad-2/+1
librustc_errors: Remove unused annotation style `OldSchoolNoteText` I could not find any references to it and the `snippet` module does not seem to be exported publicly, so I think it can be safely removed. This was originally removed in 17bd76a51 and I'm not sure why it is still there.
2019-05-23librustc_errors: Remove unused annotation style `OldSchoolNoteText`Philipp Hansch-2/+1
I could not find any references to it and the `snippet` module does not seem to be exported publicly, so I think it can be safely removed.
2019-05-21Make -Zemit-artifact-notifications also emit the artifact typeJeremy Fitzhardinge-3/+3
This is easier for tooling to handle than trying to reverse-engineer it from the filename extension.
2019-05-10Remove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match.Mazdak Farrokhzad-0/+12
2019-05-07rustc: rename -Z emit-directives to -Z emit-artifact-notifications and ↵Eduard-Mihai Burtescu-15/+11
simplify the output.
2019-05-02introduce unescape moduleAleksey Kladov-1/+1
Currently, we deal with escape sequences twice: once when we lex a string, and a second time when we unescape literals. This PR aims to remove this duplication, by introducing a new `unescape` mode as a single source of truth for character escaping rules
2019-04-30In JSON output, emit a directive after metadata is generated.Nicholas Nethercote-8/+22
To implement pipelining, Cargo needs to know when metadata generation is finished. This commit adds code to do that. Unfortunately, metadata file writing currently occurs very late during compilation, so pipelining won't produce a speed-up. Moving metadata file writing earlier will be a follow-up. The change involves splitting the existing `Emitter::emit` method in two: `Emitter::emit_diagnostic` and `Emitter::emit_directive`. The JSON directives look like this: ``` {"directive":"metadata file written: liba.rmeta"} ``` The functionality is behind the `-Z emit-directives` option, and also requires `--error-format=json`.
2019-04-22Fix #58270, fix off-by-one error in error diagnostics.Xavier Denis-0/+10
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-10/+14
2019-04-17Auto merge of #60034 - rasendubi:fix-comments, r=Centrilbors-6/+6
Small comments fix - Fix comments around test harness generation - Promote regular comments to rustdoc comments
2019-04-17Promote regular comments to rustdoc commentsAlexey Shmalko-6/+6
2019-04-17Rollup merge of #59128 - oli-obk:colorful_json, r=mark-i-m,eddybMazdak Farrokhzad-12/+55
Emit ansi color codes in the `rendered` field of json diagnostics cc @ljedrz Implemented for https://github.com/rust-lang/rust/pull/56595#issuecomment-447645115 (x.py clippy)
2019-04-17Deny `internal` in stage0Mateusz Mikuła-1/+1
2019-04-09Do not render ascii colors to buffersOliver Scherer-1/+1
2019-04-03Deny internal lints on non conflicting cratesflip1995-0/+1
- libarena - librustc_allocator - librustc_borrowck - librustc_codegen_ssa - librustc_codegen_utils - librustc_driver - librustc_errors - librustc_incremental - librustc_metadata - librustc_passes - librustc_privacy - librustc_resolve - librustc_save_analysis - librustc_target - librustc_traits - libsyntax - libsyntax_ext - libsyntax_pos
2019-04-02Rename `colorful-json` to `json-rendered` and make it a selection instead of ↵Oliver Scherer-2/+37
a bool
2019-04-02Emit ansi color codes in the `rendered` field of json diagnosticsOliver Scherer-10/+18
2019-03-31Rollup merge of #58805 - fabric-and-ink:redundant_import, r=petrochenkovMazdak Farrokhzad-1/+1
Lint for redundant imports Add lint for redundant imports. The changes are suggested by @petrochenkov. Closes #10178.
2019-03-31Rollup merge of #59574 - JohnTitor:distinguish-error-vs-warning, r=CentrilMazdak Farrokhzad-3/+14
Distinguish message for external macros depending on error level fixes #57716 (I picked you because assigned to this issue.) r? @estebank
2019-03-31Distinguish depending on error levelYuki OKUSHI-3/+14
Remove unnecessary comment
2019-03-30Remove redundant importsFabian Drinck-1/+1
2019-03-28Fix MultilineAnnotation field nameEsteban Küber-1/+1
2019-03-28Add comemnts clarifying logicEsteban Küber-0/+5
2019-03-28review commentsEsteban Küber-3/+3
2019-03-27Account for fully overlapping multiline annotationsEsteban Küber-13/+47
When two multiline span labels point at the same span, we special case the output to avoid weird behavior: ``` foo( _____^ |_____| || bar, || ); || ^ ||______| |______foo baz ``` instead showing ``` foo( _____^ | bar, | ); | ^ | | |______foo baz ```
2019-03-23Tweak unsupported negative trait bounds messageEsteban Küber-1/+1
2019-03-12Stabilize Range*::contains.Steven Malis-1/+0
2019-03-07fix bad logicEsteban Küber-3/+4
2019-03-07Keep current behavior while accepting error countEsteban Küber-8/+18
2019-03-06Make `-Z treat-err-as-bug` take a number of errors to be emittedEsteban Küber-10/+19
`-Z treat-err-as-bug=0` will cause `rustc` to panic after the first error is reported. `-Z treat-err-as-bug=2` will cause `rustc` to panic after 3 errors have been reported.
2019-02-24Use ? in some macrosTaiki Endo-3/+3
2019-02-14Rollup merge of #58296 - estebank:hidden-suggestion, r=oli-obkMazdak Farrokhzad-37/+221
Hidden suggestion support Add way to hide suggestion snippet window from cli output to avoid cluttered spans that don't enhance understanding. r? @pietroalbini CC @zackmdavis