Commit graph

30 commits

Author SHA1 Message Date
Aaron Hill
0dd9f118d9
Show macro name in 'this error originates in macro' message
When there are multiple macros in use, it can be difficult to tell
which one was responsible for producing an error.
2021-05-12 19:03:06 -04:00
Yuki Okushi
eb9abea295 Move some tests to more suitable subdirs 2021-03-06 18:24:53 +09:00
Caio
e7e93717ce Move some tests to more reasonable directories 2021-02-16 21:22:21 -03:00
Vadim Petrochenkov
dee704930d rustc_parse: More precise spans for tuple.0.0 2020-10-11 02:33:49 +03:00
Vadim Petrochenkov
52bdaaa0ed Add some requested tests 2020-07-02 21:05:18 +03:00
Vadim Petrochenkov
64a88db762 Update dtolnay's tests that now work 2020-07-02 20:35:50 +03:00
David Tolnay
63f95a4858 Add test for errors triggered on parts of decomposed index 2020-07-02 20:35:50 +03:00
David Tolnay
3814eec087 Add test for tuple indexed with float in macro input 2020-07-02 20:35:50 +03:00
David Tolnay
6dfa549fb5 Add tests in which the token really is a float 2020-07-02 20:35:50 +03:00
David Tolnay
776deb6b9f Test a range, which is not nested indexing 2020-07-02 20:35:50 +03:00
David Tolnay
0432f63acf Test even deeper nested indexing 2020-07-02 20:35:50 +03:00
David Tolnay
40a21707b4 Add test of tuple nested indexing 2020-07-02 20:35:49 +03:00
Vadim Petrochenkov
8e256b19d5 parser: Break float tokens into parts in tuple field positions 2020-07-02 20:35:49 +03:00
Eduard-Mihai Burtescu
4c7eb59e81 rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
Vadim Petrochenkov
642669c74d Update tests 2020-01-09 21:23:12 +03:00
Janusz Marcinkiewicz
5c34a11324 Refactor 'parse_enum_item' to use 'parse_delim_comma_seq' 2019-11-26 19:24:36 +01:00
Esteban Küber
83ffda5216 Specific labels when referring to "expected" and "found" types 2019-11-18 11:02:22 -08:00
Esteban Küber
52e8ec1432 Remove "here" from "expected one of X here" 2019-11-06 17:26:20 -08:00
Nadrieril
09f9947ebc Gather together usefulness tests
I took most tests that were testing only for match exhaustiveness,
pattern refutability or match arm reachability, and put them in
the same test folder.
2019-10-27 21:20:26 +00:00
varkor
56181cf8ab Correct pluralisation of tuple/array/associated type binding mismatch errors 2019-05-28 21:35:20 +01:00
Vadim Petrochenkov
fa72a81bea Update tests 2019-03-11 23:10:26 +03:00
Esteban Küber
0081ef2548 Point at enum definition when match patterns are not exhaustive
```
error[E0004]: non-exhaustive patterns: type `X` is non-empty
 --> file.rs:9:11
  |
1 | / enum X {
2 | |     A,
  | |     - variant not covered
3 | |     B,
  | |     - variant not covered
4 | |     C,
  | |     - variant not covered
5 | | }
  | |_- `X` defined here
...
9 |       match x {
  |             ^
  |
  = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: `B` and `C` not covered
  --> file.rs:11:11
   |
1  | / enum X {
2  | |     A,
3  | |     B,
4  | |     C,
   | |     - not covered
5  | | }
   | |_- `X` defined here
...
11 |       match x {
   |             ^ patterns `C` not covered
```

When a match expression doesn't have patterns covering every variant,
point at the enum's definition span. On a best effort basis, point at the
variant(s) that are missing. This does not handle the case when the missing
pattern is due to a field's enum variants:

```
enum E1 {
    A,
    B,
    C,
}
enum E2 {
    A(E1),
    B,
}
fn foo() {
    match E2::A(E1::A) {
        E2::A(E1::B) => {}
        E2::B => {}
    }
    //~^ ERROR `E2::A(E1::A)` and `E2::A(E1::C)` not handled
}
```

Unify look between match with no arms and match with some missing patterns.

Fix #37518.
2019-03-02 16:45:23 -08:00
Vadim Petrochenkov
1f64f60d5c tests: Do not use -Z parse-only, continue compilation to test recovery 2019-01-06 22:20:46 +03:00
bors
9eac386342 Auto merge of #57047 - euclio:field-structured-suggestions, r=estebank
use structured suggestions for nonexistent fields

r? @estebank
2018-12-31 20:56:19 +00:00
Andy Russell
dfc326d0e2
use structured suggestions for nonexistent fields 2018-12-31 12:52:30 -05:00
Vadim Petrochenkov
bc16edeb28 Fix rebase and more CI failures 2018-12-27 15:51:37 +03:00
Vadim Petrochenkov
fff01ccfa8 Do not abort compilation if expansion produces errors
Fix a number of uncovered deficiencies in diagnostics
2018-12-27 15:51:36 +03:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Vadim Petrochenkov
c56adf6413 cleanup: Add main functions to some UI tests 2018-08-31 18:56:15 +03:00
David Wood
3fc7ab2373
Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00