about summary refs log tree commit diff
path: root/src/librustc_errors/lib.rs
AgeCommit message (Collapse)AuthorLines
2018-05-09use fmt::Result where applicableAndre Bogus-2/+2
2018-04-25Approximate -> ApplicabilityManish Goregaokar-2/+2
2018-04-24Use enum for approximate suggestionsManish Goregaokar-1/+9
2018-04-17Make Handler more thread-safeJohn Kåre Alsaker-21/+26
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-07Auto merge of #49661 - alexcrichton:bump-bootstrap, r=nikomatsakisbors-2/+0
Bump the bootstrap compiler to 1.26.0 beta Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-04-06Print query stack on ICEsJohn Kåre Alsaker-0/+5
2018-04-05Auto merge of #49045 - Zoxc:tls, r=michaelwoeristerbors-17/+8
Make queries thread safe This makes queries thread safe by removing the query stack and making queries point to their parents. Queries write to the query map when starting and cycles are detected by checking if there's already an entry in the query map. This makes cycle detection O(1) instead of O(n), where `n` is the size of the query stack. This is mostly corresponds to the method I described [here](https://internals.rust-lang.org/t/parallelizing-rustc-using-rayon/6606). cc @rust-lang/compiler r? @michaelwoerister
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-2/+0
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-03-26Stabilize i128_typeMark Mansi-1/+1
2018-03-26Stabilize conservative_impl_traitTaylor Cramer-1/+1
2018-03-25Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoeristerkennytm-16/+18
Always print `aborting due to n previous error(s)` r? @michaelwoerister
2018-03-24Make queries thread safe. Remove the query stack and make queries point to ↵John Kåre Alsaker-17/+8
their parents instead.
2018-03-16Always print `aborting due to n previous error(s)` and only print it once ↵John Kåre Alsaker-16/+18
for multi-threaded code
2018-03-15Require the code mapper to be thread-safeJohn Kåre Alsaker-4/+7
2018-03-14test for putting back check on jsonGuillaume Gomez-4/+47
2018-03-07rustc: Migrate to `termcolor` crate from `term`Alex Crichton-10/+21
This crate moves the compiler's error reporting to using the `termcolor` crate from crates.io. Previously rustc used a super-old version of the `term` crate in-tree which is basically unmaintained at this point, but Cargo has been using `termcolor` for some time now and tools like `rg` are using `termcolor` as well, so it seems like a good strategy to take! Note that the `term` crate remains in-tree for libtest. Changing libtest will be a bit tricky due to how the build works, but we can always tackle that later. cc #45728
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-4/+4
2018-02-01Auto merge of #47540 - Manishearth:suggestion, r=nrcbors-0/+6
Add approximate suggestions for rustfix This adds `span_approximate_suggestion()` that lets you emit a suggestion marked as "non-machine applicable" in the JSON output. UI users see no difference. This is for when rustc and clippy wish to emit suggestions which will make sense to the reader (e.g. they may have placeholders like `<type>`) but are not source-applicable, so that rustfix/etc can ignore these. fixes #39254
2018-01-29Toggle span highlighting on `-Zteach`Esteban Küber-1/+1
2018-01-29Add approximate suggestions for rustfixManish Goregaokar-0/+6
This adds `span_approximate_suggestion()` that lets you emit a suggestion marked as "approximate" in the JSON output. UI users see no difference. This is for when rustc and clippy wish to emit suggestions which will make sense to the reader (e.g. they may have placeholders like `<type>`) but are not source-applicable, so that rustfix/etc can ignore these. fixes #39254
2018-01-26Merge branch 'explain' of https://github.com/estebank/rust into rollupAlex Crichton-0/+18
2018-01-26Do not capture stderr in the compiler. Instead just panic silently for fatal ↵John Kåre Alsaker-1/+15
errors
2018-01-25Add description to field and methodEsteban Küber-0/+8
2018-01-22Only emit expanded diagnostic information onceEsteban Küber-0/+10
2018-01-14Auto merge of #47274 - Manishearth:rustdoc-span, r=QuietMisdreavusbors-0/+1
Use correct line offsets for doctests Not yet tested. This doesn't handle char positions. It could if I collected a map of char offsets and lines, but this is a bit more work and requires hooking into the parser much more (unsure if it's possible). r? @QuietMisdreavus (fixes #45868)
2018-01-10Use correct line offsets for doctests (fixes #45868)Manish Goregaokar-0/+1
2018-01-08Clean emitted diagnostics when `reset_err_count` is called.Rafael Fernández López-2/+6
When external tools like `rustfmt` calls to `reset_err_count` for handler reusing, it will set the error count on the handler to 0, but since https://github.com/rust-lang/rust/pull/47146 the handler will contain status that will prevent the error count to be bumped if this handler is reused. This caused `rustfmt` idempotency tests to fail: https://github.com/rust-lang-nursery/rustfmt/issues/2338 Fixes: https://github.com/rust-lang-nursery/rustfmt/issues/2338
2018-01-03Only bump error count when we are sure that the diagnostic is not a repetition.Rafael Fernández López-0/+3
This ensures that if we emit the same diagnostic twice, the error count will match the real number of errors shown to the user. Fixes #42106
2017-12-21Make err_count thread safeJohn Kåre Alsaker-8/+10
2017-12-14When attempting to write str with single quote suggest double quotesEsteban Küber-0/+1
2017-11-20address review commentsAlex Burka-18/+44
2017-11-19use -Z flag instead of env varAlex Burka-1/+5
2017-11-16Remove left over dead code from suggestion diagnostic refactoringOliver Schneider-14/+0
2017-11-03Refactor internal suggestion APIOliver Schneider-77/+55
2017-11-02Make the difference between lint codes and error codes explicitOliver Schneider-14/+18
2017-10-26Auto merge of #45519 - michaelwoerister:dedup-errors, r=arielb1bors-6/+31
Don't emit the same compiler diagnostic twice. This PR makes the compiler filter out diagnostic messages that have already been emitted during the same compilation session.
2017-10-25librustc_errors: Don't emit the same error message twice.Michael Woerister-6/+31
2017-10-20Add short message-formatGuillaume Gomez-1/+1
2017-08-30Auto merge of #43968 - petrochenkov:span2, r=michaelwoeristerbors-11/+7
Make fields of `Span` private I actually tried to intern spans and benchmark the result<sup>*</sup>, and this was a prerequisite. This kind of encapsulation will be a prerequisite for any other attempt to compress span's representation, so I decided to submit this change alone. The issue https://github.com/rust-lang/rust/issues/43088 seems relevant, but it looks like `SpanId` won't be able to reuse this interface, unless the tables are global (like interner that I tried) and are not a part of HIR. r? @michaelwoerister anyway <sup>*</sup> Interning means 2-3 times more space is required for a single span, but duplicates are free. In practice it turned out that duplicates are not *that* common, so more memory was wasted by interning rather than saved.
2017-08-30Make fields of `Span` privateVadim Petrochenkov-11/+7
2017-08-29Rollup merge of #43778 - topecongiro:handler-reset-err-count, r=arielb1Ariel Ben-Yehuda-0/+6
Add reset_err_count() to errors::Handler The motivation here is to allow rustfmt to recover from parse errors after failing to parse macros (cc https://github.com/rust-lang-nursery/rustfmt/issues/1742). r? @nrc
2017-08-27Additional libc cleanupTatsuyuki Ishi-1/+2
2017-08-26Auto merge of #44071 - alexcrichton:no-cycles, r=nikomatsakisbors-10/+6
rustc: Start moving toward "try_get is a bug" for incremental This PR is an effort to burn down some of the work items on #42633. The basic change here was to leave the `try_get` function exposed but have it return a `DiagnosticBuilder` instead of a `CycleError`. This means that it should be a compiler bug to *not* handle the error as dropping a diagnostic should result in a complier panic. After that change it was then necessary to update the compiler's callsites of `try_get` to handle the error coming out. These were handled as: * The `sized_constraint` and `needs_drop_raw` checks take the diagnostic and defer it as a compiler bug. This was a new piece of functionality added to the error handling infrastructure, and the idea is that for both these checks a "real" compiler error should be emitted elsewhere, so it's only a bug if we don't actually emit the complier error elsewhere. * MIR inlining was updated to just ignore the diagnostic. This is being tracked by https://github.com/rust-lang/rust/issues/43542 which sounded like it either already had some work underway or was planning to change regardless. * The final case, `item_path`, is still sort of up for debate. At the time of this writing this PR simply removes the invocations of `try_get` there, assuming that the query will always succeed. This turns out to be true for the test suite anyway! It sounds like, though, that this logic was intended to assist in "weird" situations like `RUST_LOG` where debug implementations can trigger at any time. This PR would therefore, however, break those implementations. I'm unfortunately sort of out of ideas on how to handle `item_path`, but other thoughts would be welcome! Closes #42633
2017-08-25rustc_errors: Add the ability to delay as bugsAlex Crichton-10/+6
This adds a function to `DiagnosticBuilder` to delay the entire diagnostic as a bug to be emitted at a later time. This'll end up getting used in the compiler in the subsequent commits...
2017-08-25Auto merge of #43994 - tamird:remove-attributes, r=alexcrichtonbors-3/+0
*: remove crate_{name,type} attributes Fixes #41701. r? @arielb1
2017-08-25*: remove crate_{name,type} attributesTamir Duberstein-3/+0
Fixes #41701.
2017-08-24rustc: Capture diagnostics from all queriesAlex Crichton-1/+22
This commit alters the `rustc::ty::maps` implementation to ensure that all output diagnostics from the compiler are tracked for the duration of each query. These are then intended to be replayed back the first time a cached value is loaded, and otherwise the cache should operate the same as it does today. Closes #42513
2017-08-23Add reset_err_count() to errors::HandlerSeiichi Uchida-0/+6
The motivation here is to allow rustfmt to recover from parse errors after failing to parse macros.
2017-08-21Auto merge of #43986 - petrochenkov:pubcrate3, r=pnkfelixbors-15/+6
rustc: Remove some dead code Extracted from https://github.com/rust-lang/rust/pull/43192 r? @eddyb