about summary refs log tree commit diff
path: root/src/libsyntax/errors
AgeCommit message (Collapse)AuthorLines
2016-05-09Auto merge of #33484 - murarth:diagnostic-builder-fields, r=brsonbors-0/+8
Add accessor methods to DiagnosticBuilder
2016-05-08Rollup merge of #33369 - nikomatsakis:graceful-empty-span, r=jntrnrManish Goregaokar-1/+49
degrade gracefully with empty spans In https://github.com/rust-lang/rust/pull/32756, we solved the final test failure, but digging more into it the handling of that scenario could be better. The error was caused by an empty span supplied by the parser representing EOF. This patch checks that we cope more gracefully with such spans: r? @jonathandturner
2016-05-07Add accessor methods to DiagnosticBuilderMurarth-0/+8
2016-05-03Remove unused trait imports introduced while in reviewSeo Sanghyeon-1/+1
2016-05-03degrade gracefully with empty spansNiko Matsakis-1/+49
2016-05-02assert we get at least two rendered lines backNiko Matsakis-2/+5
2016-05-02avoid double panicNiko Matsakis-1/+2
2016-05-02do not fail if len(rendered_lines) is == 1Niko Matsakis-10/+14
also handle more rendered-lines
2016-05-02update unit testsNiko Matsakis-39/+38
2016-05-02Finish up with 'old school' error modeJonathan Turner-12/+63
2016-05-02Add back in a 'old school' error formatJonathan Turner-50/+201
2016-05-02change color of warning to YELLOWNiko Matsakis-1/+1
2016-05-02fix snippet tests MORE!Niko Matsakis-2/+2
2016-05-02Nit: use Range::containsNiko Matsakis-7/+2
2016-05-02fix tests betterNiko Matsakis-5/+5
2016-05-02only emit `^` at the start of a multi-line errorNiko Matsakis-143/+67
as a result, simplify elision code
2016-05-02Nit: use last_mut betterNiko Matsakis-4/+3
2016-05-02Nit: in emitter.rsNiko Matsakis-2/+1
2016-05-02Nit: address various style nitsNiko Matsakis-5/+10
2016-05-02Nit: do not use RLKNiko Matsakis-12/+14
2016-05-02Nit: do not import variants from StyleNiko Matsakis-24/+23
2016-05-02Do not import variants from RenderedLineKindNiko Matsakis-12/+12
2016-05-02refactor the Emitter traitNiko Matsakis-98/+74
There is now a CoreEmitter that everything desugars to, but without losing any information. Also remove RenderSpan::FileLine. This lets the rustc_driver tests build.
2016-05-02change errors from Yellow to MagentaNiko Matsakis-1/+1
The Yellow text is very hard to read with a white background.
2016-05-02WIP factor out RudimentaryEmitterNiko Matsakis-16/+31
2016-05-02refactor to use new snippet code and modelNiko Matsakis-649/+322
Major changes: - Remove old snippet rendering code and use the new stuff. - Introduce `span_label` method to add a label - Remove EndSpan mode and replace with a fn to get the last character of a span. - Stop using `Option<MultiSpan>` and just use an empty `MultiSpan` - and probably a bunch of other stuff :)
2016-05-02adapt JSON to new modelNiko Matsakis-119/+83
Each Span now carries a `is_primary` boolean along with an optional label. If there are multiple labels for a span, it will appear multiple times.
2016-05-02revamp MultiSpan and introduce new snippet codeNiko Matsakis-0/+1345
MultiSpan model is now: - set of primary spans - set of span+label pairs Primary spans render with `^^^`, secondary spans with `---`. Labels are placed next to the `^^^` or `---` marker as appropriate.
2016-04-27Make some fatal lexer errors recoverablemitaa-0/+2
2016-04-21pacify the merciless acrichto (somewhat)Niko Matsakis-8/+6
Also add a comment or two to pacify the merciless self-critic, who hates a closure without a comment.
2016-04-21port compiletest to use JSON outputNiko Matsakis-122/+176
This uncovered a lot of bugs in compiletest and also some shortcomings of our existing JSON output. We had to add information to the JSON output, such as suggested text and macro backtraces. We also had to fix various bugs in the existing tests. Joint work with jntrnr.
2016-04-12Remove unused trait importsSeo Sanghyeon-3/+0
2016-04-04Give better spans for SpanEnd errorsNick Cameron-15/+60
2016-03-30Put in `-Z continue-parse-after-error`Felix S. Klock II-0/+9
This works by adding a boolean flag, `continue_after_error`, to `syntax::errors::Handler` that can be imperatively set to `true` or `false` via a new `fn set_continue_after_error`. The flag starts off true (since we generally try to recover from compiler errors, and `Handler` is shared across all phases). Then, during the `phase_1_parse_input`, we consult the setting of the `-Z continue-parse-after-error` debug flag to determine whether we should leave the flag set to `true` or should change it to `false`. ---- (We might consider adding a debugflag to do such aborts in other places where we are currently attempting recovery, such as resolve, but I think the parser is the really important case to handle in the face of #31994 and the parser bugs of varying degrees that were injected by parse error recovery.)
2016-03-24Include source text in JSON errorsNick Cameron-1/+39
2016-03-22fix alignmentJorge Aparicio-12/+12
2016-03-22try! -> ?Jorge Aparicio-38/+38
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-02-03Fix rendering of single-char-spanmitaa-10/+10
A span spanning only a single character would render like `^~` instead of just `^`.
2016-02-02Rollup merge of #31281 - oli-obk:patch-2, r=nikomatsakisSteve Klabnik-2/+2
2016-02-01Spans now derive equalityDaniel Campbell-5/+3
2016-01-30off by oneOliver Schneider-1/+1
2016-01-29Update emitter.rsmitaa-1/+1
2016-01-29fix overflow due to multiline error spanOliver Schneider-1/+1
2016-01-28Implement MultiSpan error reportingmitaa-377/+873
This allows to render multiple spans on one line, or to splice multiple replacements into a code suggestion.
2016-01-26Rollup merge of #31211 - Manishearth:pr-30765, r=nrcManish Goregaokar-2/+2
r? @eddyb or @nrc
2016-01-26Make emitter handle DUMMY_SP correctlyManish Goregaokar-2/+2
2016-01-22The war on abort_if_errorsNick Cameron-2/+5
2016-01-15Rollup merge of #30787 - nikomatsakis:future-incompatible-lint, r=brsonManish Goregaokar-0/+18
There is now more structure to the report, so that you can specify e.g. an RFC/PR/issue number and other explanatory details. Example message: ``` type-parameter-invalid-lint.rs:14:8: 14:9 error: defaults for type parameters are only allowed on type definitions, like `struct` or `enum` type-parameter-invalid-lint.rs:14 fn avg<T=i32>(_: T) {} ^ type-parameter-invalid-lint.rs:14:8: 14:9 warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! type-parameter-invalid-lint.rs:14:8: 14:9 note: for more information, see PR 30742 <https://github.com/rust-lang/rust/pull/30724> type-parameter-invalid-lint.rs:11:9: 11:28 note: lint level defined here type-parameter-invalid-lint.rs:11 #![deny(future_incompatible)] ^~~~~~~~~~~~~~~~~~~ error: aborting due to previous error ``` r? @brson I would really like feedback also on the specific messages! Fixes #30746
2016-01-15Add a testNick Cameron-1/+1
And fix bustage in make check
2016-01-15Implement JSON error emissionNick Cameron-27/+210
[breaking-change] syntax::errors::Handler::new has been renamed to with_tty_emitter Many functions which used to take a syntax::errors::ColorConfig, now take a rustc::session::config::ErrorOutputType. If you previously used ColorConfig::Auto as a default, you should now use ErrorOutputType::default().