Commit Graph

5681 Commits

Author SHA1 Message Date
José manuel Barroso Galindo
0e8ec4333c Update error message E0384 to new format
Part of #35233
Fixes #35184
2016-08-10 00:07:42 +07:00
Jonathan Turner
fb1c6acc81 Update E0087.rs 2016-08-09 07:53:52 -07:00
hank-der-hafenarbeiter
2adc07f462 added unit test 2016-08-09 14:40:07 +02:00
hank-der-hafenarbeiter
b5ead0060c updated unit test 2016-08-09 14:02:25 +02:00
DarkEld3r
127489a896 Update compiler error 0093 to use new error format 2016-08-09 13:13:04 +03:00
srdja
0cb8439aa3 Update E0008 to new format 2016-08-08 23:36:50 +02:00
Stephen Lazaro
da8fed5f90 Update unit test for E0092 2016-08-08 14:10:59 -07:00
Stephen Lazaro
156c822ab2 Update error messages for E0091 and E0092 2016-08-08 14:10:09 -07:00
Jonathan Turner
f835b38385 Rollup merge of #35524 - garekkream:update-E0162-new-error-format, r=jonathandturner
Update E0162 to the new format

Part of #35233.
Fixes #35268.

r? @jonathandturner
2016-08-08 13:25:59 -07:00
Jonathan Turner
7db3f86966 Rollup merge of #35507 - hank-der-hafenarbeiter:master, r=jonathandturner
Updated Error mesage to new format for E0221

Part of #35386
r? @jonathandturner
2016-08-08 13:25:59 -07:00
Jonathan Turner
0a3766a41a Rollup merge of #35504 - razielgn:updated-e0026-to-new-format, r=jonathandturner
Updated E0026 to new format.

Part of #35233.
Fixes #35497.

r? @jonathandturner
2016-08-08 13:25:59 -07:00
Jonathan Turner
a72891e9e8 Rollup merge of #35484 - KiChjang:e0205-bonus, r=GuillaumeGomez
Shrink E0205 span label to the trait being implemented

Part of #35233.
Extension of #35468.
Closes #35382.

r? @GuillaumeGomez
2016-08-08 13:25:59 -07:00
Jonathan Turner
bbbac59c29 Rollup merge of #35475 - shyaamsundhar:patch-1, r=jonathandturner
E0248 New Format
2016-08-08 13:25:58 -07:00
Jonathan Turner
0e4e8e9544 Rollup merge of #35470 - munyari:e0214, r=jonathandturner
Update E0214 to the new error format

Part of #35233

Addresses #35383
"r? @jonathandturner
2016-08-08 13:25:58 -07:00
Jonathan Turner
c479f0210c Rollup merge of #35449 - poveda-ruiz:master, r=jonathandturner
Updated E0087 to new format

Part of #35233. r? @jonathandturner
2016-08-08 13:25:56 -07:00
Jonathan Turner
7979da0783 Rollup merge of #35446 - pcn:update-E0023-to-new-format, r=jonathandturner
Update E0023 to the new format

Added some extra code to check for the appropriate ending for numbers ==
1 vs. not 1 in error messages.

Added an extra test so that the plural suffix is seen and exercised.
2016-08-08 13:25:56 -07:00
Jonathan Turner
dd38172903 Rollup merge of #35396 - munyari:e0191, r=jonathandturner
Update E0191 to the new error format

Part of #35233

"r? @jonathandturner
2016-08-08 13:25:56 -07:00
Krzysztof Garczynski
daf7c60d16 Update E0162 to the new format 2016-08-08 21:42:49 +02:00
Federico Ravasio
ee38609c20 Updated E0026 to new format. 2016-08-08 20:58:21 +02:00
hank-der-hafenarbeiter
6eb0218075 updated unit test! 2016-08-08 20:52:00 +02:00
bors
f84008b558 Auto merge of #35492 - jonathandturner:fix_nightlies, r=arielb1
Fix for nightlies

Remove the NOTE tests for now so that nightlies will pass. We'll move many of these tests to UI tests later, as this is a better place to check the notes.

cc @alexcrichton
2016-08-08 11:17:05 -07:00
Keith Yeung
bd2bd6c71e Shrink span to variant discriminant expression for E0081 2016-08-08 09:56:41 -07:00
Guillaume Gomez
0658941cd2 Add new error code tests 2016-08-08 18:42:46 +02:00
Jonathan Turner
5f1c6a0076 Remove the NOTE tests for now. We'll move to UI tests later 2016-08-08 09:26:32 -07:00
bors
b42a384a80 Auto merge of #35456 - birkenfeld:issue-33784, r=nikomatsakis
typeck: suggest (x.field)(...) to call struct fields even when x is a reference

Fixes: #33784

Note: This is a reopen of #33785.
2016-08-08 07:47:51 -07:00
Keith Yeung
c6e17ec276 Shrink E0205 span label to the trait being implemented 2016-08-07 22:45:00 -07:00
Keith Yeung
53baa09bfe Update E0206 message to new format 2016-08-07 15:35:39 -07:00
Christian Poveda
8b111a7cf5 Updated E0087 to new format 2016-08-07 17:00:19 -05:00
ShyamSundarB
4a99a9de03 E0248 Change in issue format 2016-08-08 00:12:53 +05:30
Panashe M. Fundira
f07f093522
Update E0214 to the new error format 2016-08-07 13:21:23 -04:00
Jonathan Turner
995eeb02ca Rollup merge of #35468 - munyari:e0205, r=jonathandturner
Update E0205 to the new error format

Part of #35233

Addresses #35382
"r? @jonathandturner
2016-08-07 09:59:45 -07:00
Jonathan Turner
8bd8cef318 Rollup merge of #35467 - terrynsun:master, r=jonathandturner
Update E0116 to new error code format.

Fixes #35249 as part of #35233.

r? @jonathandturner
2016-08-07 09:59:44 -07:00
Jonathan Turner
cfebba5be3 Rollup merge of #35455 - munyari:e0204, r=jonathandturner
Update E0204 to the new error format

Part of #35233

Addresses #35381
"r? @jonathandturner
2016-08-07 09:59:44 -07:00
Jonathan Turner
fe7b3ae13b Rollup merge of #35454 - Detegr:master, r=jonathandturner
New error message format for E0117 and E0118

Part of #35233
r? @jonathandturner
2016-08-07 09:59:44 -07:00
Jonathan Turner
a6cf011334 Rollup merge of #35443 - franleplant:master, r=jonathandturner
Update E0101 and E0102 to new format

Part of #35233
Fixes #35243
Fixes #35244
r? @jonathandturner

PS: My first contribution
2016-08-07 09:59:44 -07:00
Jonathan Turner
7d9ea8b371 Rollup merge of #35439 - pcn:update-E0010-error-message, r=jonathandturner
Update E0010 to use the new format

For https://github.com/rust-lang/rust/issues/35194
2016-08-07 09:59:44 -07:00
Jonathan Turner
87e129ee69 Rollup merge of #35434 - intrepion:fix-compile-fail-e0121, r=jonathandturner
Fixing compiler error E0121

Fixes #35254 and part of #35233
2016-08-07 09:59:43 -07:00
Jonathan Turner
6bb7f354c1 Rollup merge of #35421 - razielgn:updated-e0225-to-new-format, r=jonathandturner
Updated E0225 to new format.

Part of #35233.
Fixes #35388.

r? @jonathandturner
2016-08-07 09:59:43 -07:00
Jonathan Turner
c92ca5f585 Rollup merge of #35419 - Keats:err-243, r=jonathandturner
Update error message for E0243 and E0244

Fixes #35389 and #35390 as part of #35233.

r? @jonathandturner
2016-08-07 09:59:43 -07:00
Jonathan Turner
d4ed060a8f Rollup merge of #35417 - Limeth:master, r=jonathandturner
E0131 updated to new format

Changes
```
error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   | ^
```
to
```
error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   |        ^^^ main cannot have type parameters
```
Fixes #35257. Part of #35233.
r? @jonathandturner
2016-08-07 09:59:42 -07:00
Jonathan Turner
02971961c7 Rollup merge of #35413 - silenuss:e0029-formatting, r=jonathandturner
Update compiler error 0029 to use new error format.

Part of #35233,
Addresses #35201

r? @jonathandturner
2016-08-07 09:59:42 -07:00
Jonathan Turner
7e37442720 Rollup merge of #35411 - KiChjang:e0223-new-format, r=jonathandturner
Update E0223 to the new format

Part of #35233.
Fixes #35387.

r? @jonathandturner
2016-08-07 09:59:42 -07:00
Jonathan Turner
4df58252bf Rollup merge of #35410 - silenuss:e0027-formatting, r=jonathandturner
Update compiler error 0027 to use new error format.

Part of #35233,
Addresses #35200

r? @jonathandturner
2016-08-07 09:59:42 -07:00
Jonathan Turner
46392c8076 Rollup merge of #35394 - mikhail-m1:master, r=jonathandturner
Update error format #35304

Fixes #35304 as part of #35233.

r? @jonathandturner
2016-08-07 09:59:41 -07:00
Jonathan Turner
94cb842887 Rollup merge of #35366 - medzin:E0282, r=jonathandturner
Updated error message E0282

Fixes #35312 as part of #35233.

r? @GuillaumeGomez
2016-08-07 09:59:41 -07:00
Jonathan Turner
b69b2dbeb1 Rollup merge of #35357 - shri3k:E0040, r=jonathandturner
Updates compiler error E0040 with new format

Addresses #35208 as part of #35233.
r? @GuillaumeGomez
2016-08-07 09:59:41 -07:00
Jonathan Turner
0b567c68da Rollup merge of #35355 - shri3k:E0046, r=jonathandturner
Updates compiler error E0046 with new format

Addresses #35209 as part of #35233.
r? @jonathandturner

I've repeated the following in my code. If this is something not desirable then let me know if there's any process to make this any cleaner. Thank you.
```rust
missing_items.iter()
    .map(|name| name.to_string())
     .collect::<Vec<_>>().join("`, `"))
```
2016-08-07 09:59:40 -07:00
Jonathan Turner
f9f6fd4fbb Rollup merge of #35314 - yossi-k:issue/35277, r=jonathandturner
Update E0185 and E0186 to new format

Part of #35233.
Fixes #35277.
Fixes #35276.
r? @jonathandturner
2016-08-07 09:59:40 -07:00
Panashe M. Fundira
0b248f1d29
Update E0205 to the new error format 2016-08-07 12:47:53 -04:00
Terry Sun
03dc48488e Update E0116 to new error code format.
Fixes #35249 as part of #35233.
2016-08-07 11:56:52 -04:00
Fran Guijarro
da86ae2338 Update E0101 and E0102 to new format 2016-08-07 12:03:29 -03:00
Peter C. Norton
ec1ef79ad9 Updated the messages for E0017
- Fix note message, fix tests.
2016-08-07 10:29:50 -04:00
Peter C. Norton
dfb66c3e2b Update E0010 to use the new format
For https://github.com/rust-lang/rust/issues/35194
2016-08-07 10:27:42 -04:00
Yossi Konstantinovsky
64873965fa Update E0185 and E0186 to new format 2016-08-07 17:23:17 +03:00
Yojan Shrestha
b564c6a5e4 Updates compiler error E0040 with new format 2016-08-07 08:31:17 -05:00
Yojan Shrestha
ed72c65f72 Updates compiler error E0046 with new format 2016-08-07 08:24:36 -05:00
bors
f5e7a5910d Auto merge of #35362 - medzin:E0252, r=GuillaumeGomez
Updated error message E0252

Fixes #35306 as part of #35233.

r? @GuillaumeGomez
2016-08-07 05:48:47 -07:00
Panashe M. Fundira
54e1e98eab
Update E0204 to the new error format 2016-08-07 03:53:32 -04:00
Antti Keränen
e91f3f6d12
Update error E0118 to new format
Fixes #35251
Also changes the span of the error to the span of the type
as suggested in the bonus section of #35251
2016-08-07 10:40:38 +03:00
Antti Keränen
ac10b5f127
Update error E0117 to new format
Fixes #35250
2016-08-07 10:38:29 +03:00
Georg Brandl
59af2ac098 typeck: suggest (x.field)(...) to call struct fields even when x is a reference
Fixes: #33784
2016-08-07 09:36:48 +02:00
Jeffrey Seyfried
cdbfe9fce3 Add test for metavariable hygiene. 2016-08-07 06:54:56 +00:00
Jeffrey Seyfried
8f73fc83dd Add regression test. 2016-08-07 06:13:35 +00:00
Peter C. Norton
2c563c69f4 Update E0023 to the new format
Added some extra code to check for the appropriate ending for numbers ==
1 vs. not 1 in error messages.

Added an extra test so that the plural suffix is seen and exercised.
2016-08-07 00:26:31 -04:00
Vincent Prouillet
02f3609a01 Update error message for E0243 and E0244 2016-08-07 01:31:09 +01:00
Jakub Hlusička
5e06da29a7 E0131 updated to new format 2016-08-07 00:09:54 +02:00
Panashe M. Fundira
b79e15d32c
Update E0191 to the new error format 2016-08-06 16:35:57 -04:00
Adam Medziński
19e45799a5 Updated error message E0282 2016-08-06 21:35:02 +02:00
bors
ddf92ffae4 Auto merge of #35393 - GuillaumeGomez:err_codes2, r=jonathandturner
Err codes

r? @jonathandturner
2016-08-06 12:29:28 -07:00
Oliver Forral
6eba89e194 Fixing compiler error E0121 2016-08-06 07:51:53 -07:00
Guillaume Gomez
4e2dd8d24a Add new error code tests 2016-08-06 16:31:20 +02:00
Federico Ravasio
eb469d60b6 Updated E0225 to new format. 2016-08-06 15:36:35 +02:00
Eduard-Mihai Burtescu
67f082287d Rollup merge of #35380 - TheZoq2:master, r=jonathandturner
Update E0004 to use labels

Fixes #35191 and is part of #35233

"r? @jonathandturner
2016-08-06 15:01:23 +03:00
Eduard-Mihai Burtescu
56cadb6a98 Rollup merge of #35376 - trixnz:update-error-373, r=jonathandturner
Update error format for E0373

Fixes #35337 as part of #35233

r? @jonathandturner
2016-08-06 15:01:23 +03:00
Eduard-Mihai Burtescu
77c342e03c Rollup merge of #35374 - mrabault:e0229_format, r=jonathandturner
Update E0229 to new format

Hello,

This fixes #35305. I ran the tests, no unit test broke, even though some were ignored.

Cheers

r? @jonathandturner
2016-08-06 15:01:22 +03:00
Eduard-Mihai Burtescu
b053da3a68 Rollup merge of #35373 - oijazsh:E0107, r=jonathandturner
Update E0107 message to new format

Fixes #35246 as part of #35233.

r? @jonathandturner
2016-08-06 15:01:22 +03:00
Eduard-Mihai Burtescu
aba49ac981 Rollup merge of #35372 - Keats:err-323, r=jonathandturner
Update error message for E0323, E0324 and E0325

 Fixes #35325, #35327 and #35329 as part of #35233

r? @jonathandturner
2016-08-06 15:01:22 +03:00
Eduard-Mihai Burtescu
b722358860 Rollup merge of #35370 - razielgn:updated-e0306-to-new-format, r=jonathandturner
Updated E0306 to new format.

Part of #35233.
Fixes #35315.

r? @jonathandturner
2016-08-06 15:01:22 +03:00
Eduard-Mihai Burtescu
8747b5bc61 Rollup merge of #35368 - shantanuraj:master, r=jonathandturner
Update E0207 to use struct_span_err, add span_label

Fixes #35302 part of #35233

r? @jonathandturner
2016-08-06 15:01:22 +03:00
Eduard-Mihai Burtescu
a7b7417c28 Rollup merge of #35364 - kc1212:e0379, r=jonathandturner
Update E0379 to new format #35338

Fixes #35338, as part of #35233.

But this does not include the bonus. From my understanding a Span is defined by a `hi` and a `lo` position within some context. A naive way would be to mutate the span so that `hi` is 5 positions from `lo` which corresponds to the `const` keyword. But this methods feels a bit rigid. Is there another way to do this?

r? @jonathandturner
2016-08-06 15:01:21 +03:00
Eduard-Mihai Burtescu
c846c30584 Rollup merge of #35363 - GuillaumeGomez:err_codes, r=jonathandturner
Err codes

r? @jonathandturner
2016-08-06 15:01:21 +03:00
Eduard-Mihai Burtescu
75c86cadad Rollup merge of #35356 - Tiwalun:fix-err-msg-e0106, r=jonathandturner
Update E0106 error message to new format.

This fixes #35245, as part of the big error message update in #35233

r? @jonathandturner
2016-08-06 15:01:21 +03:00
Eduard-Mihai Burtescu
b9c5fa4023 Rollup merge of #35353 - poveda-ruiz:master, r=jonathandturner
Updated E0081 to new format

Part of #35233. r? @jonathandturner
2016-08-06 15:01:21 +03:00
Eduard-Mihai Burtescu
8e1b96a690 Rollup merge of #35351 - jaredwy:update-error-69, r=jonathandturner
Updated error format for E0069

Fixes #35219 which is part of the error bonanza at #35233

r? @jonathandturner
2016-08-06 15:01:21 +03:00
Eduard-Mihai Burtescu
bb1ff9d850 Rollup merge of #35288 - Roybie:35271-E0166-update-error-format, r=GuillaumeGomez
Update error message for E0166

Fixes #35271 as part of #35233.

r? @jonathandturner
2016-08-06 15:01:20 +03:00
Adam Medziński
f4dd1f9500 Updated error message E0252 2016-08-06 13:31:03 +02:00
silenuss
1d25e2eecc Update compiler error 0029 to use new error format. 2016-08-06 01:29:36 -06:00
silenuss
c9e9d42576 Update compiler error 0027 to use new error format. 2016-08-06 00:44:27 -06:00
Keith Yeung
065c685e80 Update E0223 to the new format 2016-08-05 21:31:18 -07:00
Jared Wyles
1cf5142248 Updated error format for E0069 2016-08-06 09:04:18 +10:00
bors
7bf54f90d6 Auto merge of #35116 - jseyfried:groundwork_for_new_import_semantics, r=nrc
resolve: diagnostics improvement and groundwork for RFC 1560

Fixes #35115, fixes #35135, and lays groundwork for #32213 (cc #35120).
r? @nrc
2016-08-05 14:42:42 -07:00
Vincent Prouillet
e0035c9797 Update error message for E0323, E0324 and E0325 2016-08-05 20:10:27 +01:00
TheZoq2
422e0d590f Update E0004 to use labels 2016-08-05 21:07:34 +02:00
Shantanu Raj
58b618e527 Update unit tests to accord for label in E0207 2016-08-06 00:04:27 +05:30
Matthias Rabault
51a270f5e7 Fix E0229 unit tests 2016-08-05 20:11:26 +02:00
Omer Sheikh
2061d656e5 Add E0107 tests for multiple lifetime params 2016-08-05 22:56:10 +05:00
trixnz
7eca647e5a Update error format for E0373 2016-08-05 19:53:14 +02:00
Christian Poveda
00179a75c7 Updated style of unit test 2016-08-05 12:05:29 -05:00
Omer Sheikh
3575812e44 Update E0107 message to new format 2016-08-05 21:02:27 +05:00
Mikhail Modin
e7e5cfe312 Merge branch 'master' of https://github.com/rust-lang/rust 2016-08-05 19:01:48 +03:00
Mikhail Modin
2f5294e1d6 Fixes #35304 2016-08-05 18:57:37 +03:00
Federico Ravasio
b7468fa189 Updated E0306 to new format. 2016-08-05 16:55:14 +02:00
bors
b30eff7ba7 Auto merge of #35365 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 30 pull requests

- Successful merges: #34319, #35041, #35042, #35076, #35109, #35137, #35175, #35181, #35182, #35189, #35239, #35264, #35266, #35281, #35285, #35289, #35291, #35294, #35296, #35297, #35298, #35299, #35318, #35319, #35324, #35326, #35328, #35333, #35359, #35362
- Failed merges:
2016-08-05 07:37:16 -07:00
Guillaume Gomez
cd48161e2c Rollup merge of #35359 - Archytaus:master, r=GuillaumeGomez
Updated E0391 and E0404 to new error format

Fixes #35341 and #35342 as part of #35233.

r? @GuillaumeGomez
2016-08-05 16:13:00 +02:00
Guillaume Gomez
dbef510f3c Rollup merge of #35350 - birryree:E0368_update, r=jonathandturner
Fix for issue #35336 - updating error message for for E0368 to includ…

…e a span_label.

This fixes #35336 as part of #35233

r? @jonathandturner
2016-08-05 16:13:00 +02:00
Guillaume Gomez
0339904fb4 Rollup merge of #35333 - nickmass:e0055-formatting, r=jonathandturner
Update compiler error E0055 to use new error format

Addresses #35213, Part of the #35233 meta bug

r? @jonathandturner
2016-08-05 16:13:00 +02:00
Guillaume Gomez
8b9700898b Rollup merge of #35328 - trixnz:update-error-62, r=jonathandturner
Update error format for E0062

Fixes #35217 as part of #35233

There seems to be an issue with the old format ignoring the labels which results in the incorrect line being rendered in the old format. I spoke with @jonathandturner about this and it seems to be a bug. Pertinent information [here](https://gist.github.com/trixnz/ad11e68687529e164427df8f8eb63116).

r? @jonathandturner
2016-08-05 16:12:59 +02:00
Guillaume Gomez
31da06bebb Rollup merge of #35326 - circuitfox:E0119-update-error-format, r=jonathandturner
E0119 update error format

Part of #35233, fixes #35252

r? @jonathandturner
2016-08-05 16:12:59 +02:00
Guillaume Gomez
a7b443fd85 Rollup merge of #35319 - Keats:err-137, r=jonathandturner
Update error format for E0137

Fixes #35265 as part of #35233.

r? @jonathandturner
2016-08-05 16:12:59 +02:00
Guillaume Gomez
e9b79d918c Rollup merge of #35318 - sciyoshi:update-e0124, r=jonathandturner
Update E0124 to the new error format

Part of #35233. This resolves #35255.

r? @jonathandturner
2016-08-05 16:12:58 +02:00
Guillaume Gomez
84d467c5f9 Rollup merge of #35299 - circuitfox:E0110-update-error-format, r=jonathandturner
E0110 update error format

Fixes #35248

Part of #35233

r? @jonathandturner
2016-08-05 16:12:58 +02:00
Guillaume Gomez
65a283fac1 Rollup merge of #35298 - Keats:err-120, r=jonathandturner
Update error message E0120

Fixes #35253 as part of #35233.

r? @jonathandturner
2016-08-05 16:12:57 +02:00
Guillaume Gomez
8038c17da5 Rollup merge of #35297 - saml:e0001-label, r=jonathandturner
Set label for unreachable pattern

Part of #35233
Fixes #35190

r? @jonathandturner
2016-08-05 16:12:57 +02:00
Guillaume Gomez
7a3164010a Rollup merge of #35296 - medzin:master, r=jonathandturner
Update error message E0178

Fixes #35273 as part of #35233.
2016-08-05 16:12:57 +02:00
Guillaume Gomez
709fd096d6 Rollup merge of #35294 - Roybie:35272-E0172-update-error-format, r=jonathandturner
Update error message for E0172

Fixes #35272 as part of #35233.

r? @jonathandturner
2016-08-05 16:12:57 +02:00
Guillaume Gomez
527e326756 Rollup merge of #35291 - yossi-k:master, r=jonathandturner
Update E0079 to new format

Fixes #35222. Part of #35233.
r? @GuillaumeGomez
2016-08-05 16:12:56 +02:00
Guillaume Gomez
7cb933ed82 Rollup merge of #35289 - birryree:E0060_E0061_format_update, r=jonathandturner
E0060 e0061 format update

This fixes #35215 and fixes #35216 as part of #35233

A separate issue will be opened to track the bonus portion of the tickets as @jaredwy will be handling that part.

?r @jonathandturner
2016-08-05 16:12:56 +02:00
Guillaume Gomez
da981cf94d Rollup merge of #35285 - razielgn:updated-e0071-to-new-format, r=jonathandturner
Updated E0071 to new format.

Bonus: the span underlines only the name of the thing that's not a struct rather than the whole expression.

Part of #35233.
Fixes #35220.

r? @jonathandturner
2016-08-05 16:12:56 +02:00
Guillaume Gomez
9186db86fd Rollup merge of #35266 - circuitfox:35247-E0109-update-error-format, r=jonathandturner
E0109 Update error format

Fixes #35247 as part of #35233.

r? @jonathandturner
2016-08-05 16:12:56 +02:00
Guillaume Gomez
158597fcd5 Rollup merge of #35264 - GuillaumeGomez:E0132_update, r=jonathandturner
E0132 update

Fixes #35258.

r? @jonathandturner
2016-08-05 16:12:55 +02:00
Roy Brunton
5eebb92c2f Update error message for E0166 2016-08-05 15:06:36 +01:00
bors
4c02363852 Auto merge of #35317 - TimNN:internal-deprecated, r=eddyb
Ignore deprecation for items deprecated by the same attribute

Whenever a node would be reported as deprecated:

- check if the parent item is also deprecated
- if it is and both were deprecated by the same attribute
- skip the deprecation warning

fixes #35128
closes #16490

r? @eddyb
2016-08-05 04:38:41 -07:00
Guillaume Gomez
7cd1779c31 Add new error code tests 2016-08-05 13:17:39 +02:00
kc1212
764d5cfafb Update E0379 to new format #35338 2016-08-05 22:52:57 +12:00
Ryan Scott
a6ffa42f7d Update E0391 to new format. 2016-08-05 17:36:43 +09:00
bors
41fe4b7195 Auto merge of #35283 - shantanuraj:master, r=jonathandturner
Update wording on E0080

Part of #35223

Update wording on error E0080. Change "attempted" to "attempt"

r? @GuillaumeGomez
2016-08-05 00:17:18 -07:00
Dominik Boehi
c61cfb0982 Update E0106 error message to new format.
This fixes rust/rust-lang#35245
2016-08-05 06:30:41 +02:00
Christian Poveda
8641bc267c Updated E0081 to new format 2016-08-04 23:22:46 -05:00
William Lee
1ca95ae5ba Fix for issue #35336 - updating error message for for E0368 to include a span_label 2016-08-04 23:43:56 -04:00
bors
802d0811a5 Auto merge of #35274 - GuillaumeGomez:err_codes, r=jonathandturner
Add new error code tests

r? @jonathandturner
2016-08-04 17:52:24 -07:00
Vincent Prouillet
3b2f1845f3 Update error message E0120 2016-08-04 22:47:27 +01:00
Nick Massey
b5b3539186 Update compiler error E0055 to use new error format 2016-08-04 15:35:43 -06:00
Tim Neumann
627b1e8ec7 add test for nested deprecated 2016-08-04 23:15:52 +02:00
Tim Neumann
98fe30b58b fix existing tests 2016-08-04 23:15:52 +02:00
Chris Stankus
2f36ecfff0 E0119 update error format 2016-08-04 15:53:48 -05:00
trixnz
0214ec248b Update error format for E0062 2016-08-04 22:52:16 +02:00
Vincent Prouillet
df726a45e1 Update error format for E0137 2016-08-04 20:27:11 +01:00
Samuel Cormier-Iijima
a0bdb17618 Update E0124 to the new error format 2016-08-04 15:09:15 -04:00
Chris Stankus
5430e555f5 E0110 update error format 2016-08-04 10:53:33 -05:00
Federico Ravasio
7c58b26f70 Updated E0071 to new format.
The span underlines only the name of the thing that's not a struct rather
than the whole expression.
2016-08-04 17:26:25 +02:00
saml
034e659411 Changing label to "this is an..." 2016-08-04 11:22:02 -04:00
saml
eeda69fcca Set label for unreachable pattern
Part of #35233
Fixes #35190

r? @jonathandturner
2016-08-04 10:42:01 -04:00
Adam Medziński
08ff7a80c0 Update error message E0178 2016-08-04 16:28:43 +02:00
Roy Brunton
ee8d6b0709 Update error message for E0172 2016-08-04 15:13:46 +01:00
Yossi Konstantinovsky
7fc0b2f3e2 Update E0079 to new format 2016-08-04 16:23:24 +03:00
William Lee
ded0d512dc Removing trailing whitespace leftover from last re-formatting commit 2016-08-04 08:28:48 -04:00
William Lee
0e756840f0 Tidying up some of the line spacing / code formatting for NOTE/ERROR annotation to match other files. 2016-08-04 08:07:14 -04:00
Guillaume Gomez
8502c6cb7c Add new error code tests 2016-08-04 13:58:16 +02:00
bors
271d048523 Auto merge of #35015 - petrochenkov:forearg, r=nikomatsakis
Properly enforce the "patterns aren't allowed in foreign functions" rule

Cases like `arg @ PATTERN` or `mut arg` were missing.
Apply the same rule to function pointer types.

Closes https://github.com/rust-lang/rust/issues/35203
[breaking-change], no breakage in sane code is expected though
r? @nikomatsakis

This is somewhat related to https://github.com/rust-lang/rfcs/pull/1685 (cc @matklad).
The goal is to eventually support full pattern syntax where it makes sense (function body may present) and to support *only* the following forms - `TYPE`, `ident: TYPE`, `_: TYPE` - where patterns don't make sense (function body doesn't present), i.e. in foreign functions and function pointer types.
2016-08-03 22:56:33 -07:00
William Lee
61318156f8 Fixes for issues #35215 and #35216 2016-08-04 00:32:49 -04:00
Shantanu Raj
e5e4cccd3b Update wording on E0080
Change "attempted" to "attempt"
2016-08-04 07:31:06 +05:30
Chris Stankus
c89e27824f Update error message for E0109 2016-08-03 18:00:52 -05:00
Guillaume Gomez
1607d5b437 Add note test for E0132 2016-08-03 23:13:48 +02:00
bors
f495483f2d Auto merge of #35159 - michaelwoerister:incr-comp-implies-orbit, r=nikomatsakis
Automatically enable -Zorbit if -Zincremental is specified.

Fixes #34973

r? @nikomatsakis
2016-08-02 20:25:50 -07:00
Vadim Petrochenkov
5c88efc0da Properly enforce the "patterns aren't allowed in foreign functions" check
Apply the same check to function pointer types
2016-08-03 01:29:53 +03:00
Michael Woerister
44dbc4907d Automatically enable -Zorbit if -Zincremental is specified. 2016-08-02 17:02:01 -04:00
bors
32e462ef99 Auto merge of #35145 - jseyfried:avoid_extra_resolve_error, r=arielb1
resolve: Avoid emitting an unhelpful cascading resolution error

Fixes #35142.
2016-08-02 06:12:23 -07:00
Jeffrey Seyfried
6372a6d7c2 Improve diagnostics for pattern bindings that illegally shadow items.
Improve unused import detection.
2016-08-01 19:09:58 +00:00
Seo Sanghyeon
054d4890cf Rollup merge of #34802 - petrochenkov:call, r=eddyb
Methods `Fn(Mut,Once)::call(mut,once)` are gated with two feature gates, remove one of them

Methods `Fn::call`, `FnMut::call_mut` and `FnOnce::call_once` are gated with usual library feature `fn_traits` and also hardcoded in the compiler and gated once more with feature `unboxed_closures`
This patch removes the `unboxed_closures`feature gate from these methods (`unboxed_closures` is still used for other things though), now they are gated only with `fn_traits`.

All unnecessary `#![feature(unboxed_closures)]`s are removed, many of them are old and were already unnecessary before the change this PR does.
2016-08-02 00:12:39 +09:00
bors
d648a16cd5 Auto merge of #35130 - sanxiyn:unused-type-parameter-error, r=nrc
Suppress unused type parameter error when type has error field

Fix #35075.
2016-07-31 23:01:06 -07:00
bors
7333c4ac25 Auto merge of #35143 - arielb1:rfc447-regions, r=eddyb
typeck: use a TypeVisitor in ctp

Use a TypeVisitor in ctp instead of `ty::walk`

This fixes a few cases where a region could be projected out of a trait while not being constrained by the type parameters, violating rust-lang/rfcs#447 and breaking soundness. As such, this is a [breaking-change].

Fixes #35139

r? @eddyb
2016-07-31 14:41:58 -07:00
Jeffrey Seyfried
d6b10beb88 Make "type aliases cannot be used for traits" a note instead of a span_label. 2016-07-31 21:29:01 +00:00
Jeffrey Seyfried
46bd5d3fa0 Avoid emitting a unhelpful cascading resolution error. 2016-07-31 20:17:08 +00:00
Ariel Ben-Yehuda
0a128f325e typeck: use a TypeVisitor in ctp
Fixes #35139
2016-07-31 23:01:02 +03:00
bors
2b87f031e7 Auto merge of #34986 - nikomatsakis:issue-34349, r=arielb1
Avoid writing a temporary closure kind

We used to write a temporary closure kind into the inference table, but
this could lead to obligations being incorrectled resolved before
inference had completed. This result could then be cached, leading to
further trouble. This patch avoids writing any closure kind until the
computation is complete.

Fixes #34349.

r? @arielb1 -- what do you think?
2016-07-31 11:45:19 -07:00
bors
379ac50809 Auto merge of #34251 - zackmdavis:forbidden_on_whose_authority, r=Manishearth
diagnostically note source of overruling outer forbid

When we emit E0453 (lint level attribute overruled by outer `forbid`
lint level), it could be helpful to note where the `forbid` level was
set, for the convenience of users who, e.g., believe that the correct
fix is to weaken the `forbid` to `deny`.

![forbidden_on_whose_authority](https://cloud.githubusercontent.com/assets/1076988/15995312/2d847376-30ce-11e6-865e-b68cfebc0291.png)
2016-07-31 08:50:46 -07:00
Vadim Petrochenkov
a80d329b68 Don't gate methods Fn(Mut,Once)::call(mut,once) with feature unboxed_closures
They are already gated with feature `fn_traits`
2016-07-31 17:48:20 +03:00
bors
1225e122fd Auto merge of #34904 - petrochenkov:rustcall, r=nikomatsakis
Properly feature gate all unstable ABIs

Fixes https://github.com/rust-lang/rust/issues/34900
[breaking-change]
r? @pnkfelix

---
Function-visiting machinery for AST/HIR is surprisingly error-prone, it's *very* easy to miss some cases or visit something twice while writing a visitor. This is the true problem behind https://github.com/rust-lang/rust/issues/34900. I'll try to restructure these visitors a bit and send one more PR later.
2016-07-30 15:58:20 -07:00
Zack M. Davis
661b4f09fb diagnostically note source of overruling outer forbid
When we emit E0453 (lint level attribute overruled by outer `forbid`
lint level), it could be helpful to note where the `forbid` level was
set, for the convenience of users who, e.g., believe that the correct
fix is to weaken the `forbid` to `deny`.
2016-07-30 15:18:07 -07:00
Seo Sanghyeon
03652157f9 Suppress unused type parameter error when type has error field 2016-07-31 00:58:30 +09:00
Manish Goregaokar
0b64a561f6 Rollup merge of #35106 - xen0n:issue-35082, r=alexcrichton
syntax_ext: format: fix ICE with bad named arguments

Fixes #35082 by guarding against a new case of malformed invocation not previously covered.

r? @alexcrichton
2016-07-30 13:44:47 +05:30
Manish Goregaokar
26e22b8e2e Rollup merge of #35080 - jonathandturner:fix_numeric_expected_found, r=nikomatsakis
Rename _ to {integer} and {float} for unknown numeric types

This PR renames _ to {integer} or {float} for unknown numeric types, to help people parse error messages that have numeric types that haven't been nailed down.

Example:
```rust
fn main() {
    let x: String = 4;
}
```

Before:
```
error[E0308]: mismatched types
 --> quicktest.rs:2:21
  |
2 |     let x: String = 4;
  |                     ^ expected struct `std::string::String`, found integral variable
  |
  = note: expected type `std::string::String`
  = note:    found type `_`

error: aborting due to previous error
```

after:
```
error[E0308]: mismatched types
 --> quicktest.rs:2:21
  |
2 |     let x: String = 4;
  |                     ^ expected struct `std::string::String`, found integral variable
  |
  = note: expected type `std::string::String`
  = note:    found type `{integer}`

error: aborting due to previous error
```
```
2016-07-30 13:44:46 +05:30
Manish Goregaokar
8c6421fb17 Rollup merge of #35063 - jseyfried:avoid_importing_inaccessible_names, r=nrc
resolve: Exclude inaccessible names from single imports

If a single import resolves to an inaccessible name in some but not all namespaces, avoid importing the name in the inaccessible namespaces.

Currently, the inaccessible namespaces are imported but cause a privacy error when used.

r? @nrc
2016-07-30 13:44:46 +05:30
Wang Xuerui
2a41b31a88
syntax_ext: format: fix ICE with bad named arguments 2016-07-29 16:40:10 +08: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
Manish Goregaokar
43bcada397 Rollup merge of #34963 - petrochenkov:useerr, r=jseyfried
resolve: Fix ICE and extra diagnostics happening when unresolved imports are used in patterns

Closes https://github.com/rust-lang/rust/issues/34933

r? @jseyfried
2016-07-28 20:33:06 +05:30
bors
1895bf760d Auto merge of #34908 - jseyfried:improve_tt_matchers, r=nrc
macros: Improve `tt` matchers

Fixes #5846, fixes #22819.
r? @nrc
2016-07-28 00:01:54 -07:00
Jeffrey Seyfried
448550223b Add regression test 2016-07-28 02:16:11 +00:00
bors
f2e59cc6aa Auto merge of #34907 - arielb1:found-parse-error, r=nikomatsakis
Centralize and clean type error reporting

Refactors the code that handles type errors to be cleaner and fixes various edge cases.

This made the already-bad "type mismatch resolving" error message somewhat uglier. I want to fix that in another commit before this PR is merged.

Fixes #31173

r? @jonathandturner, cc @nikomatsakis
2016-07-27 14:28:06 -07:00
bors
29abe5ec71 Auto merge of #34856 - jseyfried:refactor_reset_tls, r=nrc
Avoid reseting the thread local interner at the beginning of `phase_1_parse_input`

The thread local interner is used before `phase_1_parse_input` to create `InternedString`s, which currently wrap `Rc<String>`s. Once `InternedString` is refactored to be an interned string id (like `Name`), resetting will invalidate everything that was interned before `phase_1_parse_input`.

The resets were only useful for the `rusti` project, which can now use `driver::reset_thread_local_state`.

r? @nrc
2016-07-27 10:16:36 -07:00
Jeffrey Seyfried
8205691929 Fix fallout in tests. 2016-07-27 05:17:05 +00:00
Jeffrey Seyfried
a279f2f62d Weaken test compile-fail/lifetime-inference-give-expl-lifetime-param. 2016-07-25 20:34:43 +00:00
Ariel Ben-Yehuda
717e39294f address review comments
I split the RFC1592 commit out
2016-07-23 00:03:19 +03:00
Niko Matsakis
8ffc04b032 Avoid writing a temporary closure kind
We used to write a temporary closure kind into the inference table, but
this could lead to obligations being incorrectled resolved before
inference had completed. This result could then be cached, leading to
further trouble. This patch avoids writing any closure kind until the
computation is complete.

Fixes #34349.
2016-07-22 16:57:08 -04:00
Ariel Ben-Yehuda
f3ee99bd4d try to recover the non-matching types in projection errors
The type equation in projection takes place under a binder and a snapshot, which
we can't easily take types out of. Instead, when encountering a projection error,
try to re-do the projection and find the type error then.

This fails to produce a sane type error when the failure was a "leak_check" failure.
I can't think of a sane way to show *these*, so I just left them use the old crappy
representation, and added a test to make sure we don't break them.
2016-07-22 14:32:56 +03:00
Ariel Ben-Yehuda
37c569627c refactor constant evaluation error reporting
Refactor constant evaluation to use a single error reporting function
that reports a type-error-like message.

Also, unify all error codes with the "constant evaluation error" message
to just E0080, and similarly for a few other duplicate codes. The old
situation was a total mess, and now that we have *something* we can
further iterate on the UX.
2016-07-22 14:32:56 +03:00
Ariel Ben-Yehuda
fa4eda8935 switch projection errors to use the new type error messages
Unfortunately, projection errors do not come with a nice set of
mismatched types. This is because the type equality check occurs
within a higher-ranked context. Therefore, only the type error
is reported. This is ugly but was always the situation.

I will introduce better errors for the lower-ranked case in
another commit.

Fixes the last known occurence of #31173
2016-07-22 14:32:56 +03:00
Ariel Ben-Yehuda
b7b2db4da7 switch compare_method to new-style trait error reporting 2016-07-22 14:32:56 +03:00
Ariel Ben-Yehuda
8eb12d91aa remove rustc_typeck::same_type_err 2016-07-22 14:32:56 +03:00
Vadim Petrochenkov
d7a968eb1c Fix ICE happening when unresolved imports are used in patterns 2016-07-21 21:19:16 +03:00
bors
bbfcb471db Auto merge of #34357 - tbu-:pr_exact_size_is_empty, r=brson
Add `is_empty` function to `ExactSizeIterator`

All other types implementing a `len` functions have `is_empty` already.
2016-07-18 14:26:22 -07:00
Vadim Petrochenkov
9292c0bc91 Properly feature gate all unstable ABIs 2016-07-18 22:51:18 +03:00
bors
06ca016b6e Auto merge of #34886 - jseyfried:improve_stmt_matchers, r=eddyb
macros: fix bug in `stmt` matchers

Today, `stmt` matchers stop too early when parsing expression statements that begin with non-braced macro invocations. For example,
```rust
fn main() {
    macro_rules! m { ($s:stmt;) => { $s } }
    id!(vec![].push(0););
    //^ Before this PR, the `stmt` matcher only consumes "vec![]", so this is an error.
    //| After this PR, the `stmt` matcher consumes "vec![].push(0)", so this compiles.
}
```
This change is backwards compatible due to the follow set for `stmt`.

r? @eddyb
2016-07-18 01:40:23 -07:00
Jeffrey Seyfried
bd1ad762b7 Add regression test 2016-07-17 16:08:09 +00:00
bors
34f35ed29c Auto merge of #34871 - petrochenkov:inherent, r=jseyfried
Do not resolve inherent static methods from other crates prematurely

Under some specific circumstances paths like `Type::method` can be resolved early in rustc_resolve instead of type checker. `Type` must be defined in another crate, it should be an enum or a trait object (i.e. a type that acts as a "module" in resolve), and `method` should be an inherent static method.
As a result, such paths don't go through `resolve_ufcs`, may be resolved incorrectly and break some invariants in type checker. This patch removes special treatment of such methods.

The removed code was introduced in 2bd46e767c to fix a problem that no longer exists.

r? @jseyfried
2016-07-17 09:07:50 -07:00
Vadim Petrochenkov
f66da5e794 Do not resolve inherent static methods from other crates prematurely 2016-07-17 00:19:26 +03:00
bors
b5ad2779ea Auto merge of #34846 - jonas-schievink:issue34839, r=eddyb
Variant Size Differences: Erase regions before computing type layout

Fixes #34839
2016-07-16 13:38:51 -07:00
bors
eb196dc2ff Auto merge of #34816 - jseyfried:fix_include_path, r=nrc
Fix `include!()`s inside `asm!()` invocations

Fixes #34812, a regression caused by #33749 that was not fixed in #34450.
r? @nrc
2016-07-16 06:34:01 -07:00
Jonas Schievink
d1486108bc Erase regions before computing type layout
Fixes #34839
2016-07-16 10:45:13 +02:00