Commit Graph

5726 Commits

Author SHA1 Message Date
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
Tobias Bucher
f2e73d9d48 Fix compile-fail test for ExactSizeIterator::is_empty 2016-07-14 23:42:13 +02:00
bors
e08a6c2068 Auto merge of #34797 - doomrobo:fix-import-trait-method, r=jseyfried
Fixed issue where importing a trait method directly and then calling the method causes a compiler panic

The code below triggers the panic, and is included in a new regression test.

```rust
trait Foo {
    fn foo();
}

use Foo::foo;

fn main() {
    foo();
}
```
The bug is caused by `librustc_resolve` allowing the illegal binding to be imported even after displaying the error message above.

The fix amounts to importing a dummy binding (`rustc::hir::def::Def::Err`) instead of the actual trait method.
2016-07-14 14:33:17 -07:00
Alex Crichton
b2d1f7ebae test: Remove NOTE assertions from trace_macros-gate
If no NOTE assertions are present I believe they aren't asserted at all, and it
looks like the number of NOTEs differs on distcheck vs `make check`, so let's
just remove them all.

Closes #18154
2016-07-14 10:27:56 -07:00
Jeffrey Seyfried
11f24a93c7 Add regression test 2016-07-14 10:27:20 +00:00
Wang Xuerui
5e55a44116
syntax_ext: format: allow multiple formats for one argument
This commit removed the restriction of only allowing one type per argument.
This is achieved by adding mappings between macro arguments and format
placeholders, then taking the mapping into consideration when emitting
the Arguments expression.

syntax_ext: format: fix implicit positional arguments

syntax_ext: format: don't panic if no args given for implicit positional args

Check the list lengths before use.
Fixes regression of `compile-fail/macro-backtrace-println.rs`.

syntax_ext: format: also map CountIsParam indices to expanded args

syntax_ext: format: fix ICE in case of malformed format args
2016-07-14 03:10:45 +08:00
bors
2ab18ce6f7 Auto merge of #34660 - jseyfried:fix_parse_stmt, r=nrc
Fix bugs in macro-expanded statement parsing

Fixes #34543.

This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m { () => {
    println!("") println!("")
    //^ Semicolons are now required on macro-expanded non-braced macro invocations
    //| in statement positions.
    let x = 0
    //^ Semicolons are now required on macro-expanded `let` statements
    //| that are followed by more statements, so this would break.
    let y = 0 //< (this would still be allowed to reduce breakage in the wild)
}
fn main() { m!() }
```

r? @eddyb
2016-07-13 01:37:07 -07:00
Michael Rosenberg
5a99d79857 Fixed issue where importing a trait method directly and then calling the method causes a compiler panic 2016-07-13 02:34:10 -04:00
Jeffrey Seyfried
57fac56cb5 Start a best-effort warning cycle. 2016-07-13 04:50:35 +00:00
Jeffrey Seyfried
337236870d Fix fallout. 2016-07-12 04:31:40 +00:00
Jonas Schievink
f5d29a3b59 Move variant_size_differences out of trans
Also enhances the error message a bit, fixes #30505 on the way, and adds
a test (which was missing).

Closes #34018
2016-07-10 22:12:31 +02:00
petrochenkov
d27e55c5d8 Stabilize FnOnce::Output + Fix rebase 2016-07-08 13:35:17 +03:00
Vadim Petrochenkov
2859f8bf39 Add tests + Fix rustdoc regression + Fix rebase 2016-07-08 12:42:57 +03:00
Vadim Petrochenkov
a397b60ebb Resolve partially resolved paths in struct patterns/expressions
Treat Def::Err correctly in struct patterns
Make instantiate_path and instantiate_type a bit closer to each other
2016-07-08 12:42:57 +03:00
Vadim Petrochenkov
2cdd9f1c97 Rewrite check_pat_enum, split it into check_pat_tuple_struct and check_pat_path
Update definitions in def_map for associated types written in unqualified form (like `Self::Output`)
Cleanup finish_resolving_def_to_ty/resolve_ty_and_def_ufcs
Make VariantDef's available through constructor IDs
2016-07-08 12:42:57 +03:00
bors
9b4e2a5b2d Auto merge of #34682 - CensoredUsername:clobber-docs, r=eddyb
Correct inline assembly clobber formatting.

Fixes the formatting for inline assembly clobbers used in the book.
As this causes llvm to silently ignore the clobber an error is also
added to catch cases in which the wrong formatting was used.
Additionally a test case is added to confirm that this error works.

This fixes #34458

Note: this is only one out of a few possible ways to fix the issue
depending on how the asm! macro formatting is wanted.

Additionally, it'd be nicer to have some kind of test or feedback
from llvm if the clobber constraints are valid, but I do not know
enough about llvm to say if or how this is possible.
2016-07-07 21:48:04 -07:00
bors
4114b68eba Auto merge of #34648 - eddyb:return-in-peace-pls, r=nagisa
Revert "Revert "Remove the return_address intrinsic.""

This reverts commit f698cd3a36.

Made possible by the merge of servo/servo#11872, this closes #34227 for good.
2016-07-06 06:26:37 -07:00
CensoredUsername
e32da12753 Correct inline assembly clobber formatting.
Fixes the formatting for inline assembly clobbers used in the book.
As this causes llvm to silently ignore the clobber an error is also
added to catch cases in which the wrong formatting was used.
Additionally a test case is added to confirm that this error works.
2016-07-06 15:02:49 +02:00
bors
47380768e7 Auto merge of #34546 - jseyfried:cfg_attr_path, r=nrc
Support `cfg_attr` on `path` attributes

Fixes #25544.
This is technically a [breaking-change]. For example, the following would break:
```rust
mod foo; // Suppose `foo.rs` existed in the appropriate location
```
2016-07-06 00:34:51 -07:00
Jeffrey Seyfried
ba59d42f24 Add regression test 2016-07-06 03:26:57 +00:00
Eduard Burtescu
0ec3d98702 Revert "Revert "Remove the return_address intrinsic.""
This reverts commit f698cd3a36.
2016-07-04 21:06:50 +03:00
bors
696b703b5a Auto merge of #34530 - alexcrichton:stabilize-1.11, r=aturon
std: Stabilize APIs for the 1.11.0 release

Although the set of APIs being stabilized this release is relatively small, the
trains keep going! Listed below are the APIs in the standard library which have
either transitioned from unstable to stable or those from unstable to
deprecated.

Stable

* `BTreeMap::{append, split_off}`
* `BTreeSet::{append, split_off}`
* `Cell::get_mut`
* `RefCell::get_mut`
* `BinaryHeap::append`
* `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past
  libstd stabilizations
* `Iterator::sum`
* `Iterator::product`

Deprecated

* `{f32, f64}::next_after`
* `{f32, f64}::integer_decode`
* `{f32, f64}::ldexp`
* `{f32, f64}::frexp`
* `num::One`
* `num::Zero`

Added APIs (all unstable)

* `iter::Sum`
* `iter::Product`
* `iter::Step` - a few methods were added to accomodate deprecation of One/Zero

Removed APIs

* `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is
  unstable

Closes #27739
Closes #27752
Closes #32526
Closes #33444
Closes #34152
cc #34529 (new tracking issue)
2016-07-03 14:33:55 -07:00
Alex Crichton
3016626c3a std: Stabilize APIs for the 1.11.0 release
Although the set of APIs being stabilized this release is relatively small, the
trains keep going! Listed below are the APIs in the standard library which have
either transitioned from unstable to stable or those from unstable to
deprecated.

Stable

* `BTreeMap::{append, split_off}`
* `BTreeSet::{append, split_off}`
* `Cell::get_mut`
* `RefCell::get_mut`
* `BinaryHeap::append`
* `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past
  libstd stabilizations
* `Iterator::sum`
* `Iterator::product`

Deprecated

* `{f32, f64}::next_after`
* `{f32, f64}::integer_decode`
* `{f32, f64}::ldexp`
* `{f32, f64}::frexp`
* `num::One`
* `num::Zero`

Added APIs (all unstable)

* `iter::Sum`
* `iter::Product`
* `iter::Step` - a few methods were added to accomodate deprecation of One/Zero

Removed APIs

* `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is
  unstable

Closes #27739
Closes #27752
Closes #32526
Closes #33444
Closes #34152
cc #34529 (new tracking issue)
2016-07-03 10:49:01 -07:00
bors
45c3a50f39 Auto merge of #34580 - eddyb:two-steps-forward-one-step-backwards, r=nagisa
Revert "Remove the return_address intrinsic."

This reverts commit b30134dbc3.

Servo might want this merged if they don't merge servo/servo#11872 soon.

cc @pnkfelix @jdm
2016-07-02 17:25:05 -07:00
bors
e85adffd64 Auto merge of #34443 - eddyb:sized-matters, r=arielb1
Disallow constants and statics from having unsized types.

This is a `[breaking-change]` which fixes #34390 by banning unsized `const` and `static`, e.g.:
```rust
const A: [i32] = *(&[0, 1, 2] as &[i32]);
static B: str = *"foo";
```

This was not intentionally allowed, and other than for `static` since some versions ago, it ICE'd.
If you've been taking advantage of this with `static`, you should be able to just use references instead.
2016-07-02 09:36:52 -07:00
bors
7a262d3034 Auto merge of #34539 - arielb1:metadata-hash, r=alexcrichton
Make the metadata lock more robust

Fixes #33778 and friends.

I also needed to add a metadata encoding version to rlibs, as they did not have it before. To keep it backwards-compatible, I added 4 zeroes to the start of the metadata, which are treated as an empty length field by older rustcs.

r? @alexcrichton
2016-07-02 06:50:59 -07:00
Ariel Ben-Yehuda
42b7c32ac8 fix test fallout 2016-07-02 14:50:36 +03:00
Manish Goregaokar
2c643bd4d0 Rollup merge of #34531 - GuillaumeGomez:libsyntax_err_codes, r=jonathandturner
Add error codes in libsyntax

r? @jonathandturner

Fixes #34526
2016-07-02 15:46:49 +05:30
Eduard Burtescu
f698cd3a36 Revert "Remove the return_address intrinsic."
This reverts commit b30134dbc3.
2016-06-30 21:12:36 +03:00
ggomez
7a8b4026ba Fix tests 2016-06-29 22:10:36 +02:00
Manish Goregaokar
8e2598c3d2 Rollup merge of #34542 - jseyfried:fix_recursive_modules, r=nrc
Fix non-termination on recursive module re-exports in extern crates

Fixes #33776.
r? @nrc
2016-06-29 21:21:24 +05:30
Manish Goregaokar
2e893ea6de Rollup merge of #34497 - oli-obk:double_negation, r=eddyb
Revert "skip double negation in const eval"

This reverts commit 735c018974.

fixes #34395

The original commit was based on a mis-understanding of the overflowing literal lint.

This needs to be ported to beta.

r? @eddyb
2016-06-29 21:21:22 +05:30
Manish Goregaokar
8886818a9a Rollup merge of #34495 - jseyfried:only_ident_macro_invocations, r=eddyb
Forbid type parameters and global paths in macro invocations

Fixes #28558.
This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m { () => { () } }
fn main() {
    m::<T>!(); // Type parameters are no longer allowed in macro invocations
    ::m!(); // Global paths are no longer allowed in macro invocations
}
```
Any breakage can be fixed by removing the type parameters or the leading `::` (respectively).

r? @eddyb
2016-06-29 21:21:22 +05:30
Jeffrey Seyfried
66ef652559 Disallow derive on items with type macros 2016-06-29 01:25:36 +00:00
Jeffrey Seyfried
9ffe1c9fba Add regression test 2016-06-29 00:27:18 +00:00
bors
ea0dc92972 Auto merge of #34424 - jseyfried:breaking_batch, r=Manishearth
Batch up libsyntax breaking changes

Batch of the following syntax-[breaking-change] changes:
 - #34213: Add a variant `Macro` to `TraitItemKind`
 - #34368: Merge the variant `QPath` of `PatKind` into the variant `PatKind::Path`
 - #34385: Move `syntax::ast::TokenTree` into a new module `syntax::tokenstream`
 - #33943:
  - Remove the type parameter from `visit::Visitor`
  - Remove `attr::WithAttrs` -- use `attr::HasAttrs` instead.
  - Change `fold_tt`/`fold_tts` to take token trees by value and avoid wrapping token trees in `Rc`.
  - Remove the field `ctxt` of `ast::Mac_`
  - Remove inherent method `attrs()` of types -- use the method `attrs` of `HasAttrs` instead.
 - #34316:
  - Remove `ast::Decl`/`ast::DeclKind` and add variants `Local` and `Item` to `StmtKind`.
  - Move the node id for statements from the `StmtKind` variants to a field of `Stmt` (making `Stmt` a struct instead of an alias for `Spanned<StmtKind>`)
  - Rename `ast::ExprKind::Again` to `Continue`.
 - #34339: Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`
  - Use `.into()` in convert between `Vec<Attribute>` and `ThinVec<Attribute>`
  - Use autoderef instead of `.as_attr_slice()`
 - #34436: Remove the optional expression from `ast::Block` and instead use a `StmtKind::Expr` at the end of the statement list.
 - #34403: Move errors into a separate crate (unlikely to cause breakage)
2016-06-27 16:42:03 -07:00
Oliver Schneider
b8f9c88c2d
Revert "skip double negation in const eval"
This reverts commit 735c018974.
2016-06-27 11:44:10 +02:00
bors
f019e381fe Auto merge of #34453 - frewsxcv:regress, r=sanxiyn
Add regression test for #24424.

Fixes https://github.com/rust-lang/rust/issues/24424.
2016-06-27 01:10:49 -07:00
Jeffrey Seyfried
b4611b1ff2 Add regression test 2016-06-27 03:17:55 +00:00
bors
af2fe634bf Auto merge of #34491 - eddyb:return-in-peace, r=nagisa
Remove the return_address intrinsic.

This intrinsic to get the return pointer was introduced in #16248 / #16081 by @pcwalton for Servo.
However, as explained in #34227, it's impossible to ensure it's used correctly, and it broke with `-Zorbit`.

Servo's usage is being replaced in servo/servo#11872, and I expect nobody else to have abused it.
But I've also started a crater run, just in case this is a `[breaking-change]` for anyone else.
2016-06-26 19:02:12 -07:00
Eduard Burtescu
b30134dbc3 Remove the return_address intrinsic. 2016-06-27 01:47:28 +03:00
Eduard Burtescu
fe7207f6af Disallow constants and statics from having unsized types. 2016-06-26 18:28:17 +03:00
Jeffrey Seyfried
9bb3ea0feb Rollup merge of #34436 - jseyfried:no_block_expr, r=eddyb
To allow these braced macro invocation, this PR removes the optional expression from `ast::Block` and instead uses a `StmtKind::Expr` at the end of the statement list.

Currently, braced macro invocations in blocks can expand into statements (and items) except when they are last in a block, in which case they can only expand into expressions.

For example,
```rust
macro_rules! make_stmt {
    () => { let x = 0; }
}

fn f() {
    make_stmt! {} //< This is OK...
    let x = 0; //< ... unless this line is commented out.
}
```

Fixes #34418.
2016-06-26 02:20:14 +00:00
Jeffrey Seyfried
d3ae56d755 Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichton
This PR refactors the 'errors' part of libsyntax into its own crate (librustc_errors).  This is the first part of a few refactorings to simplify error reporting and potentially support more output formats (like a standardized JSON output and possibly an --explain mode that can work with the user's code), though this PR stands on its own and doesn't assume further changes.

As part of separating out the errors crate, I have also refactored the code position portion of codemap into its own crate (libsyntax_pos).  While it's helpful to have the common code positions in a separate crate for the new errors crate, this may also enable further simplifications in the future.
2016-06-25 22:35:09 +00:00
Jeffrey Seyfried
4e2e31c118 Rollup merge of #34368 - petrochenkov:astqpath, r=Manishearth
The AST part of https://github.com/rust-lang/rust/pull/34365

plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645
2016-06-25 22:35:06 +00:00
Corey Farwell
0abee313c6 Add regression test for #24424.
Fixes https://github.com/rust-lang/rust/issues/24424.
2016-06-25 07:31:05 -04:00
Jeffrey Seyfried
e4885565a5 Add regression test 2016-06-24 11:46:18 +00:00
Jeffrey Seyfried
94479ad81f Add regression test 2016-06-23 17:42:10 +00:00
Jonathan Turner
bad4869d28 Fix touchy test to work with old and new error format 2016-06-23 08:07:35 -04:00
Jonathan Turner
51deb4fedb Address more travis errors 2016-06-23 08:07:35 -04:00
Manish Goregaokar
f753689115 Rollup merge of #34367 - Stebalien:issue-23281, r=sfackler
Add regression test for #23281

Closes #23281
2016-06-22 09:51:07 +01:00
Eduard Burtescu
7279af86c8 trans: generalize immediate temporaries to all MIR locals. 2016-06-20 23:55:14 +03:00
Vadim Petrochenkov
f903c97959 Merge PatKind::QPath into PatKind::Path in AST 2016-06-20 23:39:02 +03:00
Steven Allen
03d86ba2f5 Add regression test for #23281
Closes #23281
2016-06-20 14:23:43 -04:00
bors
25f349db3e Auto merge of #34348 - dsprenkels:issue-34194-test, r=alexcrichton
Add regression test for #34194

This pull request adds a regression test for #34194.

Closes #34194.
2016-06-19 22:18:52 -07:00
Steven Allen
7c452b1f0a Add test case for #22434
Closes #22434
2016-06-18 18:43:44 -04:00