Commit Graph

32 Commits

Author SHA1 Message Date
Manish Goregaokar
43440a4a6e Rollup merge of #36212 - razielgn:updated-e0493-to-new-format, r=jonathandturner
Updated e0493 to new format (+ bonus).

Part of #35233.
Fixes #35999.

r? @jonathandturner

I'm not satisfied with the bonus part, there has to be an easier way to reach into the `Drop`'s span implementation. I'm all ears. :)
2016-09-04 21:00:59 +08:00
Jonathan Turner
59c0ff6314 Rollup merge of #36171 - jonathandturner:temporary_value, r=nikomatsakis
Update lifetime errors to specifically note temporaries

This PR updates the error message we give in the case of a temporary value not living long enough.

Before:

<img width="497" alt="screen shot 2016-08-31 at 10 02 47 am" src="https://cloud.githubusercontent.com/assets/547158/18138551/27a06794-6f62-11e6-9ee2-bdf8bed75ca7.png">

Now:

<img width="488" alt="screen shot 2016-08-31 at 10 03 01 am" src="https://cloud.githubusercontent.com/assets/547158/18138557/2e5cf322-6f62-11e6-9047-4a78abf3d78c.png">

Specifically, it makes the following changes:

* Detects if a temporary is being used.  If so, it changes the labels to mention that a temporary value specifically is in question
* Simplifies wording of the existing labels to focus on lifetimes rather than values being valid
* Changes the help to a note, since the help+span wasn't as helpful (and sometimes more confusing) than just a note.

r? @nikomatsakis
2016-09-02 15:28:51 -07:00
Federico Ravasio
059094f3f2 Moved test on E0493 from compile-fail to ui. 2016-09-02 19:55:14 +02:00
Jonathan Turner
439afcd974 Update error message for lifetime of borrowed values 2016-08-31 17:48:26 -07:00
CensoredUsername
d282a633fa Guard against platforms on which the sysv64 calling convention is not valid in non-codegen tests. Remove false positive in a test that relied on the exact formatting of an error string and rewrite the sysv64 register allocation test at it was triggering undefined behaviour 2016-08-30 16:03:06 +02:00
Keith Yeung
e46b09a1f9 Add UI test for E0379 2016-08-27 22:43:51 -07:00
Jonathan Turner
54d0acd2fc wording fixes in error messages 2016-08-19 16:05:37 -07:00
bors
43c090ed69 Auto merge of #35732 - jonathandturner:region_error_labels, r=nikomatsakis
Move 'doesn't live long enough' errors to labels

This patch moves the "doesn't live long enough" region-style errors to instead use labels.

An example follows.

Before:

```
error: `x` does not live long enough
  --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:26:18
   |
26 |         let y = &x;
   |                  ^
   |
note: reference must be valid for the block at 23:10...
  --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:23:11
   |
23 | fn main() {
   |           ^
note: ...but borrowed value is only valid for the block suffix following statement 0 at 25:18
  --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:25:19
   |
25 |         let x = 1;
   |                   ^
```

After:

```
error: `x` does not live long enough
  --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:26:18
   |
26 |         let y = &x;
   |                  ^ does not live long enough
...
32 |     };
   |     - borrowed value only valid until here
...
35 | }
   | - borrowed value must be valid until here
```

r? @nikomatsakis
2016-08-18 05:39:11 -07:00
bors
9d6520f97b Auto merge of #35769 - eddyb:rollup, r=eddyb
Rollup of 12 pull requests

- Successful merges: #35346, #35734, #35739, #35740, #35742, #35744, #35749, #35750, #35751, #35756, #35766, #35768
- Failed merges:
2016-08-18 00:15:11 -07:00
Keith Yeung
31d56cb144 Add UI test for E0053 2016-08-17 15:33:50 -07:00
Jonathan Turner
70ce90c320 Move 'doesn't live long enough' errors to labels 2016-08-17 15:24:42 -07:00
Jonathan Turner
54d42cc912 Rebase. Fix mutable iteration nit. 2016-08-17 15:11:18 -07:00
Jonathan Turner
61865384b8 Replace local backtrace with def-use, repair std macro spans 2016-08-17 14:26:14 -07:00
Jonathan Turner
d0a272b797 Fix merge conflict 2016-08-17 14:26:05 -07:00
Jonathan Turner
75454f72a3 Rollup merge of #35713 - sanxiyn:ui-test, r=nikomatsakis
Use UI test to test spans, instead of forced line break

There must be lots more, but these are what I could easily find.
2016-08-17 06:25:27 -07:00
Seo Sanghyeon
3aa63400a2 Use UI test to test spans, instead of forced line break 2016-08-16 20:46:50 +09:00
Seo Sanghyeon
d52eb1ab0c RUST_NEW_ERROR_FORMAT is no more 2016-08-16 16:52:30 +09:00
Seo Sanghyeon
f76a737bae Correct span for pub_restricted field 2016-08-12 21:08:02 +09:00
Ryan Scott
19e140b946 Update E0404 to new format. 2016-08-05 17:36:43 +09:00
Jeffrey Seyfried
6656a30ca1 Fix fallout in ui/codemap_tests. 2016-08-01 18:42:16 +00:00
Jonathan Turner
ea77049cfa Move to {integer} and {float} 2016-07-28 09:49:31 -07:00
Jonathan Turner
cfdaca049a Rename _ to {numerics} for unknown numeric types 2016-07-28 08:58:25 -07:00
Jonathan Turner
0b727f0801 Add unicode test to ui tests 2016-07-14 10:55:09 -04:00
Jonathan Turner
1fd014a965 Add fix for tabs. Move error unit tests->ui tests 2016-07-14 07:57:46 -04:00
Jonathan Turner
012ff15c94 Fix up some tidy-unfriendly spacing 2016-07-14 07:57:46 -04:00
Jonathan Turner
f481879d2a Fix a couple UI test failures 2016-07-14 07:57:46 -04:00
Jonathan Turner
df87a781de Satisfy tidy 2016-05-24 10:57:44 -04:00
Jonathan Turner
00b78d0d6a Back to single line between errors. Add header space to secondary files 2016-05-24 10:42:32 -04:00
Jonathan Turner
9cc8debeb7 Move issue-26480 cfail to ui test. Fix #33763 2016-05-24 07:40:09 -04:00
Jonathan Turner
428099233a Fix #33819 and update ui test 2016-05-23 14:48:11 -04:00
Niko Matsakis
24cfa1efb0 pacify the mercilous tidy 2016-05-16 16:48:48 -04:00
Niko Matsakis
cb112dc8cf add UI testing framework 2016-05-13 15:22:45 -07:00