Commit Graph

30 Commits

Author SHA1 Message Date
Esteban Küber
51d0e86c22 Emit missing unclosed delimiter errors 2019-03-06 18:46:11 -08:00
Esteban Küber
336c48cc7b tweak wording based on in person feedback 2019-02-07 01:42:54 -08:00
Esteban Küber
7451cd8dc0 Deduplicate mismatched delimiter errors
Delay unmatched delimiter errors until after the parser has run to
deduplicate them when parsing and attempt recovering intelligently.
2019-02-07 01:41:30 -08:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Esteban Küber
008aa5a24e Provide more context for unenclosed delimiters
* When encountering EOF, point at the last opening brace that does not
   have the same indentation level as its close delimiter.
 * When encountering the wrong type of close delimiter, point at the
   likely correct open delimiter to give a better idea of what went
   wrong.
2018-09-05 03:43:24 -07:00
Esteban Küber
5238b523c3 Reword un-closed delimiter label 2018-09-05 03:43:24 -07:00
Esteban Küber
2a74d7924a Tweak unclosed delimiter parser error 2018-08-15 13:18:34 -07:00
Crazycolorz5
c1df62a760 Add closing bracket expectation to sequences, modified appropriate test cases. 2018-06-01 10:05:46 -04:00
Guillaume Gomez
2e104a77cf update tests 2018-03-14 00:53:24 +01:00
Vadim Petrochenkov
fa2d9fc4b9 Update UI tests 2018-02-26 20:24:02 +03:00
Guillaume Gomez
5747fd6611 Update ui tests 2018-02-25 12:15:05 +01:00
Ed Schouten
c51f8783f2 Correct for changes in line numbers in expected stderr output.
Due to the disable-cloudabi tags being added to the source files, the
expected output of the compiler is altered slightly.
2018-01-02 18:12:10 +01:00
Vadim Petrochenkov
1f5b201aff Remove NOTE/HELP annotations from UI tests 2017-12-14 23:26:39 +03:00
Oliver Schneider
8937d6a6cf
Merge cfail and ui tests into ui tests 2017-11-24 11:32:35 +01:00
Oliver Schneider
401ab612c2 Adjust new suggestions to the suggestion guidelines 2017-07-21 13:59:17 +02:00
Oliver Schneider
a9d9a4aab4
Change some helps to suggestions 2017-07-17 10:03:37 +02:00
Ariel Ben-Yehuda
fb7ab9e43d report the total number of errors on compilation failure
Prior to this PR, when we aborted because a "critical pass" failed, we
displayed the number of errors from that critical pass. While that's the
number of errors that caused compilation to abort in *that place*,
that's not what people really want to know. Instead, always report the
total number of errors, and don't bother to track the number of errors
from the last pass that failed.

This changes the compiler driver API to handle errors more smoothly,
and therefore is a compiler-api-[breaking-change].

Fixes #42793.
2017-07-02 16:16:44 +03:00
Ariel Ben-Yehuda
77f4022303 Revert "Change error count messages"
This reverts commit 5558c64f33.
2017-07-02 13:49:30 +03:00
Esteban Küber
c13a913e5b Don't naively point to return type on type error 2017-06-24 19:28:43 -07:00
Esteban Küber
c023856b38 Detect missing ; on methods with return type ()
- Point out the origin of a type requirement when it is the return type
  of a method
- Point out possibly missing semicolon when the return type is () and
  the implicit return makes sense as a statement
- Suggest changing the return type of methods with default return type
- Don't suggest changing the return type on fn main()
- Don't suggest changing the return type on impl fn
2017-06-24 01:09:27 -07:00
Michael Kohl
5558c64f33 Change error count messages
See #33525 for details.
2017-05-24 16:14:38 +07:00
Esteban Küber
dedb7bbbbf Merge branch 'master' into issue-32540 2017-04-04 08:13:27 -07:00
Niko Matsakis
fb99d87c46 update UI test
We no longer give suggestions; this is presumably related to the changes
I made in coercion. However, those suggestions appear to be wrong
anyhow!
2017-03-30 08:18:02 -04:00
Esteban Küber
78ae8feebb Improve wording and spans for unexpected token
* Point at where the token was expected instead of the last token
  successfuly parsed.
* Only show `unexpected token` if the next char and the unexpected token
  don't have the same span.
* Change some cfail and pfail tests to ui test.
* Don't show all possible tokens in span label if they are more than 6.
2017-03-25 15:36:59 -07:00
Esteban Küber
03eca71381 Point at last valid token on failed expect_one_of
```rust
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
  --> $DIR/token-error-correct-3.rs:29:9
   |
25 |         foo()
   |             - expected one of `.`, `;`, `?`, `}`, or an operator after this
...
29 |     } else {
   |     ^ unexpected token
```
2017-03-24 23:37:25 -07:00
Esteban Küber
fc774e629f Teach Diagnostics to highlight text 2017-01-17 14:28:53 -08:00
Vadim Petrochenkov
2092682191 resolve: Do not use "resolve"/"resolution" in error messages 2017-01-12 10:08:27 +03:00
Esteban Küber
43b10fa8ed Teach diagnostics to have correctly padded lists
Make the suggestion list have a correct padding:

```
error[E0308]: mismatched types
 --> file.rs:3:20
  |
3 |     let x: usize = "";
  |                    ^^ expected usize, found reference
  |
  = note: expected type `usize`
  = note:    found type `&'static str`
  = help: here are some functions which might fulfill your needs:
          - .len()
          - .foo()
          - .bar()
```
2017-01-07 23:34:37 -08:00
Vadim Petrochenkov
09aba18e10 More systematic error reporting in path resolution 2016-12-26 15:01:49 +03:00
Vadim Petrochenkov
3fb676afb0 Move some compile-fail tests into UI directory 2016-12-26 12:58:33 +03:00