Commit graph

49 commits

Author SHA1 Message Date
Felix S. Klock II
d8bd5336c9 rust-lang/rust#51025: improve test robustness so that they work under NLL too. 2018-05-25 13:00:51 +02:00
Felix S. Klock II
032081cdff Trivial updates to .nll.stderr files post-rebase, reflecting s/-Znll/nll/ in messages. 2018-04-18 15:37:23 +02:00
Felix S. Klock II
746d63a203 Checkpoint the current status of NLL on ui tests via compare-mode=nll. 2018-04-11 00:38:35 +02:00
Guillaume Gomez
2e104a77cf update tests 2018-03-14 00:53:24 +01:00
Vadim Petrochenkov
c1a73d2f4a tidy: Add a check for stray .stderr and .stdout files in UI test directories 2018-03-09 17:27:22 +03:00
Vadim Petrochenkov
7ba5fd168a Update UI tests 2018-02-26 20:24:42 +03: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
Matthias Krüger
4452446292 fix more typos found by codespell. 2018-02-17 17:38:49 +01:00
Matthew Jasper
6853b34f0e Don't show first assignment in loops
Matches current ast-borrowck behavior.
2017-11-27 08:07:49 +00:00
Oliver Schneider
8937d6a6cf
Merge cfail and ui tests into ui tests 2017-11-24 11:32:35 +01:00
Cengiz Can
da52563bf5 Improve SubSupConflict case with one named, one anonymous lifetime parameter #42701 2017-11-12 18:56:45 +03:00
Esteban Küber
805333b2b5 review comments 2017-11-06 21:02:31 -08:00
Esteban Küber
de959afab5 Handle anon lifetime arg being returned with named lifetime return type
When there's a lifetime mismatch between an argument with an anonymous
lifetime being returned in a method with a return type that has a named
lifetime, show specialized lifetime error pointing at argument with a
hint to give it an explicit lifetime matching the return type.

```
error[E0621]: explicit lifetime required in the type of `other`
  --> file2.rs:21:21
   |
17 |     fn bar(&self, other: Foo) -> Foo<'a> {
   |                   ----- consider changing the type of `other` to `Foo<'a>`
...
21 |                     other
   |                     ^^^^^ lifetime `'a` required
```

Follow up to #44124 and #42669.
2017-11-05 09:55:07 -08:00
Niko Matsakis
73543d53cd fix test reference 2017-09-26 11:56:44 -04:00
Niko Matsakis
9e4649ebf8 remove random newlines from error messages, fix compile-fail test
That kind of formatting seems like the job of other code.
2017-09-26 11:55:53 -04:00
Niko Matsakis
d7bb575b06 use present tense consistently and update references 2017-09-26 11:55:53 -04:00
gaurikholkar
aa6f0c8050 modify message for return time having multiple lifetimes 2017-09-26 11:55:52 -04:00
gaurikholkar
e58f528bb0 merge fixes, addressing CR comments 2017-09-26 11:55:52 -04:00
gaurikholkar
9240454a3f add ui tests for EBR 2017-09-14 10:27:41 +05:30
gaurikholkar
f8df89a5cb adding ui tests 2017-09-14 09:56:44 +05:30
gaurikholkar
e71eef1775 fix ui tests 2017-09-13 20:56:27 +05:30
gaurikholkar
6e3cdcea4c Adding changes for trait objects 2017-09-12 18:22:22 +05:30
gaurikholkar
93529b40ca add ui test for fn items, tidy fixes 2017-09-12 16:48:18 +05:30
gaurikholkar
2f50c33290 Adding E0623 for structs 2017-09-12 10:06:29 +05:30
gaurikholkar
cfc7cf3961 adding E0623 for LateBound regions 2017-09-09 11:12:27 +05:30
gaurikholkar
b569094d94 minor fix 2017-08-23 19:43:05 +05:30
gaurikholkar
90ab9d9a6d code review fixes 2017-08-23 18:43:26 +05:30
gaurikholkar
fe9c68a051 Adding E0623 for structs 2017-08-17 15:06:32 +05:30
gaurikholkar
cb93cc6299 changing E0623 error message 2017-07-29 17:40:16 +05:30
gaurikholkar
4fb1808ab6 Adding E0623, to detect missing lifetimes when both regions are anonymous 2017-07-28 08:51:58 +05:30
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
gaurikholkar
4abcf28d2b adding compile-fail test 2017-06-29 14:13:53 -07:00
gaurikholkar
aebc4e0074 Changing the error code to E0621 2017-06-29 06:37:18 -07:00
gaurikholkar
a851e1e543 Adding changes to track anonymous region in self 2017-06-29 06:37:18 -07:00
gaurikholkar
2d99ffd11b track anonymous regions in return types, fix tidy errors 2017-06-29 06:37:18 -07:00
gaurikholkar
8fb6f74e57 Enabling E0611 for inherent functions 2017-06-29 06:37:18 -07:00
gaurikholkar
ae92bd095c Interchange ^ and - 2017-06-29 06:37:18 -07:00
Niko Matsakis
4bed5f0094 update reference for test 2017-06-29 06:37:18 -07:00
gaurikholkar
5df7a2c863 Adding new ui test for trait impl 2017-06-29 06:37:18 -07:00
gaurikholkar
176225c4dd Adding diagnostic code 0611 for lifetime errors with one named, one anonymous lifetime parameter 2017-06-29 06:37:18 -07:00
Michael Kohl
5558c64f33 Change error count messages
See #33525 for details.
2017-05-24 16:14:38 +07:00
Florian Hartwig
eb703f7851 Fix off-by-one error in column number in explain_span. 2017-05-18 00:21:57 +02:00
Eduard-Mihai Burtescu
6d4c2141b5 rustc: use DefId instead of CodeExtent for FreeRegion's scope. 2017-05-13 17:42:59 +03:00
Esteban Küber
cc07c357e4 Reduce visual clutter of multiline start when possible
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-20 17:31:20 -07:00
Esteban Küber
2389830dea Highlight and simplify mismatched types
Shorten mismatched types errors by replacing subtypes that are not
different with `_`, and highlighting only the subtypes that are
different.

Given a file

```rust
struct X<T1, T2> {
    x: T1,
    y: T2,
}

fn foo() -> X<X<String, String>, String> {
    X { x: X {x: "".to_string(), y: 2}, y: "".to_string()}
}

fn bar() -> Option<String> {
    "".to_string()
}
```

provide the following output

```rust
error[E0308]: mismatched types
  --> file.rs:6:5
   |
 6 |     X { x: X {x: "".to_string(), y: 2}, y: "".to_string()}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found {integer}
   |
   = note: expected type `X<X<_, std::string::String>, _>`
                                 ^^^^^^^^^^^^^^^^^^^   // < highlighted
              found type `X<X<_, {integer}>, _>`
                                 ^^^^^^^^^             // < highlighted

error[E0308]: mismatched types
  --> file.rs:6:5
   |
10 |     "".to_string()
   |     ^^^^^^^^^^^^^^ expected struct `std::option::Option`, found `std::string::String`
   |
   = note: expected type `Option<std::string::String>`
                          ^^^^^^^                   ^  // < highlighted
              found type `std::string::String`
```
2017-04-11 15:45:00 -07:00
Niko Matsakis
9e0171f7c8 remove vestiges of the old suggestion machinery 2017-02-17 14:47:39 -05:00
Niko Matsakis
5167ac8719 add some sample UI error test cases
These are some samples that I have been focusing on improving over
time. In this PR, I mainly want to stem the bleeding where we in some
cases we show an error that gives you no possible way to divine the
problem.
2017-02-17 11:01:35 -05:00