about summary refs log tree commit diff
path: root/src/librustc_errors
AgeCommit message (Collapse)AuthorLines
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>
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