Commit Graph

56112 Commits

Author SHA1 Message Date
Jonathan Turner
0c84ac124a Rollup merge of #35858 - shyaamsundhar:patch-1, r=GuillaumeGomez
E0435, E0437 & E0438 New Error Format

Part of #35801 , #35802 and #35803
r? @GuillaumeGomez

Hi! Please review the changes.
2016-08-22 15:34:21 -07:00
Jonathan Turner
7c2fba6d4d Rollup merge of #35842 - apasel422:typo, r=GuillaumeGomez
Fix typos in unix/rwlock.rs

r? @steveklabnik
2016-08-22 15:34:20 -07:00
Jonathan Turner
cc51d1c21d Rollup merge of #35841 - kyrias:new-error-E0424, r=GuillaumeGomez
Update E0424 to the new error format

Fixes #35797.
Part of #35233.

r? @GuillaumeGomez
2016-08-22 15:34:20 -07:00
Jonathan Turner
ae83225afc Rollup merge of #35835 - crypto-universe:E0426, r=jonathandturner
New format for E0426

Issue #35799 as a part of issue #35233
r? jonathandturner
2016-08-22 15:34:20 -07:00
Jonathan Turner
025c5e7311 Rollup merge of #35824 - GuillaumeGomez:err_codes, r=jonathandturner
Err codes

r? @jonathandturner
2016-08-22 15:34:19 -07:00
Jonathan Turner
5523db8f2e Rollup merge of #35820 - knight42:update-error-msg, r=jonathandturner
Updated E0054, E0423 & E0432 to new error format

Fixes #35791, #35796 and #35344, as part of #35233

r? @jonathandturner
2016-08-22 15:34:19 -07:00
Jonathan Turner
40f40e6cd9 Rollup merge of #35817 - wesleywiser:fix_35703, r=jonathandturner
Update E0503 to the new format

Fixes #35703
Part of #35233

r? @jonathandturner
2016-08-22 15:34:19 -07:00
Jonathan Turner
b6950492c2 Rollup merge of #35809 - matthew-piziak:bitwise-and-example, r=GuillaumeGomez
replace `BitAnd` example with something more evocative of bitwise AND
2016-08-22 15:34:19 -07:00
Jonathan Turner
f46438c71a Rollup merge of #35526 - munyari:e0033, r=jonathandturner
Update E0033 to the new error format

Part of #35233

Addresses #35498
"r? @jonathandturner
2016-08-22 15:34:19 -07:00
Jonathan Turner
ab734210f0 Rollup merge of #35360 - medzin:E0388, r=jonathandturner
Updated error message E0388

Fixes #35339 as part of #35233.

r? @GuillaumeGomez
2016-08-22 15:34:18 -07:00
Adam Medziński
bfbdff0e2d Updated error message E0388 2016-08-22 23:22:40 +02:00
Matthew Piziak
9f88f8ae48 replace BitAnd example with something more evocative of bitwise AND
reformat method chain according to ubsan Rustic Style Guide

https://ubsan.github.io/style/
2016-08-22 17:04:18 -04:00
bors
3c5a0fa45b Auto merge of #35871 - bluss:cstring-new, r=alexcrichton
cstring: avoid excessive growth just to 0-terminate

Based on following what happens in CString::new("string literal"):

1. Using `Into<Vec<u8>>`, a Vec is allocated with capacity exactly equal
   to the string's input length.
2. By `v.push(0)`, the Vec is grown to twice capacity, since it was full.
3. By `v.into_boxed_slice()`, the Vec capacity is shrunk to fit the length again.

If we use `.reserve_exact(1)` just before the push, then we avoid the
capacity doubling that we're going to have to shrink anyway.

Growing by just 1 byte means that the step (2) is less likely to have to
move the memory to a larger allocation chunk, and that the step (3) does
not have to reallocate.

Addresses part of #35838
2016-08-22 08:29:41 -07:00
ggomez
cdb4af848b Remove E0455 test (for now) 2016-08-22 14:53:28 +02:00
bors
57a1f684cd Auto merge of #35848 - Mark-Simulacrum:make-tidy-in-tree, r=alexcrichton
Check that executable file is in-tree before failing tidy check

I silenced stdout and stderr for ls-files, not sure if that's appropriate (is `make tidy` intended to give debugging information)? Otherwise it prints each file it find to stdout/stderr, which currently prints nothing (only executable files are checked).

I have not done major testing regarding the behavior of ls-files when the file is ignored, but judging by the man page everything should be fine.

I've duplicated the code which makes the path git-friendly from the `Cargo.lock` checking code; I can extract that into a common helper if wanted (it's only two lines).

Fixes #35689.
2016-08-22 05:39:53 -07:00
Knight
8fdc531446 Updated E0423 to new format 2016-08-22 13:57:37 +08:00
Knight
a4c6307a15 Updated E0432 to new format 2016-08-22 13:57:10 +08:00
Knight
820c810107 Updated E0054 to new format 2016-08-22 13:51:21 +08:00
bors
c44534ef5a Auto merge of #35821 - nbaksalyar:solaris-trans-fix, r=alexcrichton
Fix linker on Solaris/Illumos

This patch provides a fix for the `GnuLinker::export_symbols` function that currently relies on a `--retain-symbols-file` option which is not supported by the Solaris & Illumos linker.

Instead, a [version script](https://www.gnu.org/software/gnulib/manual/html_node/LD-Version-Scripts.html) is used on this platform to achieve the same goal. Here's an example of a similar approach in LLVM's CMake script: https://github.com/llvm-mirror/llvm/blob/master/cmake/modules/AddLLVM.cmake#L88-L94.

Perhaps other platforms like OpenBSD could benefit from this as well. /cc @semarie
2016-08-21 22:30:46 -07:00
bors
42584d36f6 Auto merge of #35777 - nrc:carrier3, r=@nikomatsakis
Carrier trait (third attempt)

This adds a `Carrier` trait to operate with `?`. The only public implementation is for `Result`, so effectively the trait does not exist, however, it ensures future compatibility for the `?` operator. This is not intended to be used, nor is it intended to be a long-term solution.

Although this exact PR has not been through Crater, I do not expect it to be a breaking change based on putting numerous similar PRs though Crater in the past.

cc:
* [? tracking issue](https://github.com/rust-lang/rust/issues/31436)
* [previous PR](https://github.com/rust-lang/rust/pull/35056)
* [RFC issue](https://github.com/rust-lang/rfcs/issues/1718) for discussion of long-term Carrier trait solutions.

r? @nikomatsakis
2016-08-21 15:12:43 -07:00
Nick Cameron
c32456da8f Fix type error with ? in existing code. 2016-08-22 09:31:26 +12:00
bors
1576de0ce6 Auto merge of #35776 - jseyfried:more_groundwork, r=nrc
resolve: More groundwork for `item_like_imports` (RFC 1560)

r? @nrc
2016-08-21 11:03:48 -07:00
Shyam Sundar B
738b91e997 Update lib.rs
Update lib.rs
Update lib.rs
Update E0438.rs
Update E0437.rs
Update E0435.rs
2016-08-21 18:43:58 +05:30
Ulrik Sverdrup
876c02cc1a cstring: avoid excessive growth just to 0-terminate
Based on following what happens in CString::new("string literal"):

1. Using `Into<Vec<u8>>`, a Vec is allocated with capacity exactly equal
   to the string's input length.
2. By `v.push(0)`, the Vec is grown to twice capacity, since it was full.
3. By `v.into_boxed_slice()`, the Vec capacity is shrunk to fit the length again.

If we use `.reserve_exact(1)` just before the push, then we avoid the
capacity doubling that we're going to have to shrink anyway.

Growing by just 1 byte means that the step (2) is less likely to have to
move the memory to a larger allocation chunk, and that the step (3) does
not have to reallocate.
2016-08-21 13:37:33 +02:00
Wesley Wiser
9bb8b65bdd Update E0503 to the new format
Fixes #35703
Part of #35233
2016-08-20 21:07:19 -04:00
Johannes Löthberg
ff44f088d7 Update E0424 to the new error format
Fixes #35797.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2016-08-20 22:05:51 +02:00
bors
490189634b Auto merge of #35857 - jonathandturner:rollup, r=jonathandturner
Rollup of 19 pull requests

- Successful merges: #35234, #35701, #35709, #35710, #35775, #35778, #35780, #35781, #35794, #35800, #35804, #35806, #35811, #35812, #35818, #35827, #35830, #35831, #35839
- Failed merges: #35759
2016-08-20 07:09:53 -07:00
Jonathan Turner
9072861c20 Rollup merge of #35839 - jonathandturner:error_touchup, r=Aatch
Wording fixes in error messages

This PR is largely wording fixes to existing PRs that I found going back through the ones that have already been updated.  Sometimes seeing the message in context made me think "oh there's a better wording!"

There's one additional fix.  This will also prevent the secondary underlining of derive call (since they look like macros to the system in the way I was using):

```
error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
  --> src/test/compile-fail/E0184.rs:11:10
   |
11 | #[derive(Copy)] //~ ERROR E0184
   |          ^^^^
   |          |
   |          in this macro invocation
```

Is now just:

```
error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor
  --> src/test/compile-fail/E0184.rs:11:10
   |
11 | #[derive(Copy)] //~ ERROR E0184
   |          ^^^^
```
2016-08-20 07:09:37 -07:00
Jonathan Turner
b22352f568 Rollup merge of #35831 - trixnz:error-428, r=jonathandturner
Update E0428 to new format

Fixes #35798 as part of #35233.

r? @jonathandturner
2016-08-20 07:09:37 -07:00
Jonathan Turner
0d69b887c6 Rollup merge of #35830 - matthew-piziak:not-example, r=steveklabnik
replace `Neg` example with something more evocative of negation
2016-08-20 07:09:37 -07:00
Jonathan Turner
cc431a017d Rollup merge of #35827 - matthew-piziak:neg-example, r=steveklabnik
replace `Not` example with something more evocative
2016-08-20 07:09:37 -07:00
Jonathan Turner
f17ff3aa93 Rollup merge of #35818 - wdv4758h:E0133-label, r=Aatch
Fix label messages for E0133

Issue #35789
2016-08-20 07:09:36 -07:00
Jonathan Turner
b9c0a8cd8e Rollup merge of #35812 - mlayne:E0232, r=jonathandturner
Update error format for E0232

Fixes #35795, as part of #35233.

Excited to make my first contribution to rustc!

r? @jonathandturner
2016-08-20 07:09:36 -07:00
Jonathan Turner
a361cdb72f Rollup merge of #35811 - jonathandturner:fix_rustbuild_version_test, r=alexcrichton
Add workaround to detect correct compiler version

This adds a workaround which fixes a rustbuild issue where the wrong compiler is checked for the version number.  The bug would arise if you build the system correctly then changed to any other version (eg doing a `git pull`).  After changing to the new version, building would fail and complain that crates were built with the wrong compiler.

There are actually two compilers at play, the bootstrapping compiler (called the "snapshot" compiler) and the actual compiler being built (the "real" compiler).  In the case of this issue, the wrong compiler was being checked for version mismatch.

r? @alexcrichton
2016-08-20 07:09:36 -07:00
Jonathan Turner
0155eb16dd Rollup merge of #35806 - matthew-piziak:addassign-example, r=steveklabnik
replace `AddAssign` example with something more evocative of addition

This is analogous to PR #35709 for the `Add` trait.
2016-08-20 07:09:36 -07:00
Jonathan Turner
15277eb0a9 Rollup merge of #35804 - pliniker:master, r=jonathandturner
Update error message for E0084

Fixes #35792 as part of #35233

r? @jonathandturner
2016-08-20 07:09:35 -07:00
Jonathan Turner
a36ff81753 Rollup merge of #35800 - matthew-piziak:mul-div-examples, r=steveklabnik
demonstrate `RHS != Self` use cases for `Mul` and `Div`

Vector-scalar multipication is a good usecase for this. Thanks #rust!
2016-08-20 07:09:35 -07:00
Jonathan Turner
ad17e0c277 Rollup merge of #35794 - cantino:fix-typo, r=apasel422
Fix minor typo

Minor typo in the book.
2016-08-20 07:09:35 -07:00
Jonathan Turner
f4b123f05f Rollup merge of #35781 - ErikUggeldahl:spellingfix, r=apasel422
Very minor spelling fix in the book

Changed datastructure to data structure.

r? @steveklabnik
2016-08-20 07:09:35 -07:00
Jonathan Turner
69612f0039 Rollup merge of #35780 - clementmiao:E0396_new_err_format, r=jonathandturner
updated E0396 to new error format

Updated E0396 to new error format.
Part of #35233
Fixes #35779

Thanks again for letting me help!

r? @jonathandturner
2016-08-20 07:09:35 -07:00
Jonathan Turner
7c843c4663 Rollup merge of #35778 - clementmiao:E0395_new_error_format, r=jonathandturner
updated E0395 to new error format

Updated E0395 to new error format.
Part of #35233
Fixes #35693

Thanks again for letting me help!

r? @jonathandturner
2016-08-20 07:09:34 -07:00
Jonathan Turner
54a41993f5 Rollup merge of #35775 - frewsxcv:os-str-doc-examples, r=GuillaumeGomez
Add a few doc examples for `std::ffi::OsStr`.
2016-08-20 07:09:34 -07:00
Jonathan Turner
ba8611ee38 Rollup merge of #35710 - matthew-piziak:explicit-drop, r=steveklabnik
note that calling drop() explicitly is a compiler error

Part of #29365
2016-08-20 07:09:34 -07:00
Jonathan Turner
ed9a18a7c7 Rollup merge of #35709 - matthew-piziak:add-trait-example, r=GuillaumeGomez
replace `Add` example with something more evocative of addition

Currently most of the operator traits use trivial implementation
examples that only perform side effects. Honestly, that might not be too
bad for the sake of documentation; but anyway, here's a proposal to move
a slightly modified version of the module-level point-addition example
into the `Add` documentation, since it's more evocative of addition
semantics.

Part of #29365
2016-08-20 07:09:34 -07:00
Jonathan Turner
2d32a69700 Rollup merge of #35701 - matthew-piziak:rangefull-example-error, r=steveklabnik
explicitly show how iterating over `..` fails

I've also removed the `main()` wrapper, which I believe is extraneous.
LMK if that's incorrect.
2016-08-20 07:09:33 -07:00
Jonathan Turner
d5595d1f3e Rollup merge of #35234 - nrc:rustdoc-macros, r=steveklabnik
rustdoc: remove the `!` from macro URLs and titles

Because the `!` is part of a macro use, not the macro's name. E.g., you write `macro_rules! foo` not `macro_rules! foo!`, also `#[macro_import(foo)]`.

(Pulled out of #35020).
2016-08-20 07:09:33 -07:00
trixnz
d791aa1b3f Fix broken tests for E0428 2016-08-20 12:10:41 +02:00
Nikita Baksalyar
c08b7b9f75
Fix linker on Solaris/Illumos
Solaris linker doesn't support the `--retain-symbols-file` option,
so this patch provides version scripts as an alternative on that
platform.
2016-08-20 12:19:07 +05:00
bors
99867ee883 Auto merge of #35607 - alexcrichton:stabilize-1.12, r=brson
std: Stabilize APIs for the 1.12 release

Stabilized

* `Cell::as_ptr`
* `RefCell::as_ptr`
* `IpAddr::is_{unspecified,loopback,multicast}`
* `Ipv6Addr::octets`
* `LinkedList::contains`
* `VecDeque::contains`
* `ExitStatusExt::from_raw` - both on Unix and Windows
* `Receiver::recv_timeout`
* `RecvTimeoutError`
* `BinaryHeap::peek_mut`
* `PeekMut`
* `iter::Product`
* `iter::Sum`
* `OccupiedEntry::remove_entry`
* `VacantEntry::into_key`

Deprecated

* `Cell::as_unsafe_cell`
* `RefCell::as_unsafe_cell`
* `OccupiedEntry::remove_pair`

Closes #27708
cc #27709
Closes #32313
Closes #32630
Closes #32713
Closes #34029
Closes #34392
Closes #34285
Closes #34529
2016-08-20 00:08:38 -07:00
Mark-Simulacrum
be8df50c9f Check that executable file is in-tree before failing tidy check. 2016-08-19 22:32:40 -06:00