about summary refs log tree commit diff
path: root/src/librustc_errors/snippet.rs
AgeCommit message (Collapse)AuthorLines
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-1/+1
2019-12-22Format the worldMark Rousskov-17/+13
2019-05-23librustc_errors: Remove unused annotation style `OldSchoolNoteText`Philipp Hansch-1/+0
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-03-28Fix MultilineAnnotation field nameEsteban Küber-1/+1
2019-03-27Account for fully overlapping multiline annotationsEsteban Küber-0/+7
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-02-07librustc_errors => 2018Taiki Endo-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-06-11Remove highlighting from secondary messagesEsteban Küber-0/+1
Deemphasize the secondary messages so that all other highlights stand out more.
2018-02-02Remove dead codeManish Goregaokar-24/+0
2018-01-26Add line numbers and columns to error messages spanning multiple filesvarkor-1/+2
If an error message is emitted that spans several files, only the primary file currently has line and column data attached. This is useful information, even in files other than the one in which the error occurs. We can often work out which line and column the error corresponds to in other files — in this case it is helpful to add them (in the case of ambiguity, the first relevant line/column is picked, which is still helpful than none).
2017-11-22Rollup merge of #46052 - oli-obk:rendered_diagnostics_in_json, r=petrochenkovkennytm-1/+1
Include rendered diagnostic in json r? @petrochenkov
2017-11-20The end of a span can be *before* the first char in a lineOliver Schneider-1/+1
2017-11-19show macro backtrace with env varAlex Burka-0/+1
2017-10-25librustc_errors: Don't emit the same error message twice.Michael Woerister-1/+1
2017-08-15Fix typos & us spellingsFourchaux-1/+1
2017-07-06Remove unused code from librustc_errorsKevin Mehall-4/+0
2017-04-20Reduce visual clutter of multiline start when possibleEsteban Küber-8/+14
When a span starts on a line with nothing but whitespace to the left, and there are no other annotations in that line, simplify the visual representation of the span. Go from: ```rust error[E0072]: recursive type `A` has infinite size --> file2.rs:1:1 | 1 | struct A { | _^ starting here... 2 | | a: A, 3 | | } | |_^ ...ending here: recursive type has infinite size | ``` To: ```rust error[E0072]: recursive type `A` has infinite size --> file2.rs:1:1 | 1 | / struct A { 2 | | a: A, 3 | | } | |_^ recursive type has infinite size ``` Remove `starting here...`/`...ending here` labels from all multiline diagnostics.
2017-04-09Always show end line of multiline annotationsEsteban Küber-10/+3
```rust error[E0046]: not all trait items implemented, missing: `Item` --> $DIR/issue-23729.rs:20:9 | 20 | impl Iterator for Recurrence { | _________^ starting here... 21 | | //~^ ERROR E0046 22 | | //~| NOTE missing `Item` in implementation 23 | | //~| NOTE `Item` from trait: `type Item;` ... | 36 | | } 37 | | } | |_________^ ...ending here: missing `Item` in implementation | = note: `Item` from trait: `type Item;` ``` instead of ```rust error[E0046]: not all trait items implemented, missing: `Item` --> $DIR/issue-23729.rs:20:9 | 20 | impl Iterator for Recurrence { | ^ missing `Item` in implementation | = note: `Item` from trait: `type Item;` ```
2017-02-02store typeck lints in the `TypeckTables`Niko Matsakis-1/+1
Otherwise they are a "hidden output"
2017-01-24Auto merge of #39214 - estebank:fix-labels-without-msg, r=nikomatsakisbors-0/+35
Fix multiple labels when some don't have message The diagnostic emitter now accounts for labels with no text message, presenting the underline on its own, without drawing the line for the non existing message below it. Go from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ----^^^^^^^---- | | | | | `b` is a good letter | ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ----^^^^^^^---- | | | `b` is a good letter ``` from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ | | | | | | `a` is a good letter ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ `a` is a good letter ``` and from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ | | | | | | ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ ``` r? @nikomatsakis cc @jonathandturner, @GuillaumeGomez, @nrc
2017-01-20Fix multiple labels when some don't have messageEsteban Küber-0/+35
The diagnostic emitter now accounts for labels with no text message, presenting the underline on its own, without drawing the line for the non existing message below it. Go from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ----^^^^^^^---- | | | | | `b` is a good letter | ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ----^^^^^^^---- | | | `b` is a good letter ``` and from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ | | | | | | `a` is a good letter ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ `a` is a good letter ```
2017-01-17Teach Diagnostics to highlight textEsteban Küber-0/+1
2016-11-23review commentsEsteban Küber-52/+56
2016-11-22Show multiline spans in full if short enoughEsteban Küber-3/+100
When dealing with multiline spans that span few lines, show the complete span instead of restricting to the first character of the first line. For example, instead of: ``` % ./rustc foo.rs error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied --> foo.rs:13:9 | 13 | foo(1 + bar(x, | ^ trait `{integer}: std::ops::Add<()>` not satisfied | ``` show ``` % ./rustc foo.rs error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied --> foo.rs:13:9 | 13 | foo(1 + bar(x, | ________^ starting here... 14 | | y), | |_____________^ ...ending here: trait `{integer}: std::ops::Add<()>` not satisfied | ```
2016-10-18run rustfmt on librustc_errors folderSrinivas Reddy Thatiparthy-3/+3
2016-08-07Turn on new errors, json mode. Remove duplicate unicode testJonathan Turner-13/+1
2016-07-14DCE and fixing some internal testsJonathan Turner-731/+2
2016-07-14Implement latest rfc style using simpler renderingJonathan Turner-152/+64
2016-06-23make old school mode a bit more configurableJonathan Turner-7/+36
2016-06-23Move test helper functions to consolidated codemap testingJonathan Turner-0/+887