]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #35891 - munyari:book, r=steveklabnik
Jonathan Turner [Mon, 22 Aug 2016 22:34:22 +0000 (15:34 -0700)]
Rollup merge of #35891 - munyari:book, r=steveklabnik

Add reference to `Self` in traits chapter (book)

Addresses #31891

"r? @steveklabnik

7 years agoRollup merge of #35889 - alevy:patch-1, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:22 +0000 (15:34 -0700)]
Rollup merge of #35889 - alevy:patch-1, r=GuillaumeGomez

Minor type in CONTRIBUTING.md

A single missing article

7 years agoRollup merge of #35882 - petrochenkov:patch-2, r=eddyb
Jonathan Turner [Mon, 22 Aug 2016 22:34:22 +0000 (15:34 -0700)]
Rollup merge of #35882 - petrochenkov:patch-2, r=eddyb

rustc: Fix outdated comment

cc https://github.com/rust-lang/rust/issues/35870#issuecomment-241282692

r? @eddyb

7 years agoRollup merge of #35881 - matthew-piziak:rc-would-unwrap-example, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:22 +0000 (15:34 -0700)]
Rollup merge of #35881 - matthew-piziak:rc-would-unwrap-example, r=GuillaumeGomez

add example for `Rc::would_unwrap`

Part of #29372

r? @steveklabnik

7 years agoRollup merge of #35879 - CryZe:patch-2, r=apasel422
Jonathan Turner [Mon, 22 Aug 2016 22:34:22 +0000 (15:34 -0700)]
Rollup merge of #35879 - CryZe:patch-2, r=apasel422

Fix "Furthermore" Typo in String Docs

It used to say "Furtheremore" instead of "Furthermore".

7 years agoRollup merge of #35878 - matthew-piziak:ptr-assertions, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:21 +0000 (15:34 -0700)]
Rollup merge of #35878 - matthew-piziak:ptr-assertions, r=GuillaumeGomez

replace `println!` statements with `assert!`ions in `std::ptr` examples

r? @steveklabnik

7 years agoRollup merge of #35864 - matthew-piziak:index-example, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:21 +0000 (15:34 -0700)]
Rollup merge of #35864 - matthew-piziak:index-example, r=GuillaumeGomez

replace `Index` example with something more evocative of indexing

r? @steveklabnik

7 years agoRollup merge of #35861 - matthew-piziak:rem-example, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:21 +0000 (15:34 -0700)]
Rollup merge of #35861 - matthew-piziak:rem-example, r=GuillaumeGomez

replace `Rem` example with something more evocative

r? @steveklabnik

7 years agoRollup merge of #35860 - matthew-piziak:mul-example, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:21 +0000 (15:34 -0700)]
Rollup merge of #35860 - matthew-piziak:mul-example, r=GuillaumeGomez

replace `Mul` example with something more evocative of multiplication

I may have gone a bit overboard on this one. Numbers are fun.

7 years agoRollup merge of #35858 - shyaamsundhar:patch-1, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:21 +0000 (15:34 -0700)]
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.

7 years agoRollup merge of #35842 - apasel422:typo, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:20 +0000 (15:34 -0700)]
Rollup merge of #35842 - apasel422:typo, r=GuillaumeGomez

Fix typos in unix/rwlock.rs

r? @steveklabnik

7 years agoRollup merge of #35841 - kyrias:new-error-E0424, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:20 +0000 (15:34 -0700)]
Rollup merge of #35841 - kyrias:new-error-E0424, r=GuillaumeGomez

Update E0424 to the new error format

Fixes #35797.
Part of #35233.

r? @GuillaumeGomez

7 years agoRollup merge of #35835 - crypto-universe:E0426, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:20 +0000 (15:34 -0700)]
Rollup merge of #35835 - crypto-universe:E0426, r=jonathandturner

New format for E0426

Issue #35799 as a part of issue #35233
r? jonathandturner

7 years agoRollup merge of #35824 - GuillaumeGomez:err_codes, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:19 +0000 (15:34 -0700)]
Rollup merge of #35824 - GuillaumeGomez:err_codes, r=jonathandturner

Err codes

r? @jonathandturner

7 years agoRollup merge of #35820 - knight42:update-error-msg, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:19 +0000 (15:34 -0700)]
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

7 years agoRollup merge of #35817 - wesleywiser:fix_35703, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:19 +0000 (15:34 -0700)]
Rollup merge of #35817 - wesleywiser:fix_35703, r=jonathandturner

Update E0503 to the new format

Fixes #35703
Part of #35233

r? @jonathandturner

7 years agoRollup merge of #35809 - matthew-piziak:bitwise-and-example, r=GuillaumeGomez
Jonathan Turner [Mon, 22 Aug 2016 22:34:19 +0000 (15:34 -0700)]
Rollup merge of #35809 - matthew-piziak:bitwise-and-example, r=GuillaumeGomez

replace `BitAnd` example with something more evocative of bitwise AND

7 years agoRollup merge of #35526 - munyari:e0033, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:19 +0000 (15:34 -0700)]
Rollup merge of #35526 - munyari:e0033, r=jonathandturner

Update E0033 to the new error format

Part of #35233

Addresses #35498
"r? @jonathandturner

7 years agoRollup merge of #35360 - medzin:E0388, r=jonathandturner
Jonathan Turner [Mon, 22 Aug 2016 22:34:18 +0000 (15:34 -0700)]
Rollup merge of #35360 - medzin:E0388, r=jonathandturner

Updated error message E0388

Fixes #35339 as part of #35233.

r? @GuillaumeGomez

7 years agoUpdated error message E0388
Adam Medziński [Fri, 5 Aug 2016 09:27:59 +0000 (11:27 +0200)]
Updated error message E0388

7 years agoreplace `BitAnd` example with something more evocative of bitwise AND
Matthew Piziak [Thu, 18 Aug 2016 21:19:17 +0000 (17:19 -0400)]
replace `BitAnd` example with something more evocative of bitwise AND

reformat method chain according to ubsan Rustic Style Guide

https://ubsan.github.io/style/

7 years agoreplace `Mul` example with something more evocative of multiplication
Matthew Piziak [Sat, 20 Aug 2016 18:14:04 +0000 (14:14 -0400)]
replace `Mul` example with something more evocative of multiplication

I may have gone a bit overboard on this one. Numbers are fun.

tone down the error message

7 years agoCorrect failing book test
Panashe M. Fundira [Mon, 22 Aug 2016 16:10:02 +0000 (12:10 -0400)]
Correct failing book test

7 years agoAuto merge of #35871 - bluss:cstring-new, r=alexcrichton
bors [Mon, 22 Aug 2016 15:29:41 +0000 (08:29 -0700)]
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

7 years agoRemove E0455 test (for now)
ggomez [Mon, 22 Aug 2016 12:53:28 +0000 (14:53 +0200)]
Remove E0455 test (for now)

7 years agoAuto merge of #35848 - Mark-Simulacrum:make-tidy-in-tree, r=alexcrichton
bors [Mon, 22 Aug 2016 12:39:53 +0000 (05:39 -0700)]
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.

7 years ago Updated E0423 to new format
Knight [Mon, 22 Aug 2016 05:57:37 +0000 (13:57 +0800)]
 Updated E0423 to new format

7 years ago Updated E0432 to new format
Knight [Mon, 22 Aug 2016 05:57:10 +0000 (13:57 +0800)]
 Updated E0432 to new format

7 years agoUpdated E0054 to new format
Knight [Mon, 22 Aug 2016 05:51:21 +0000 (13:51 +0800)]
Updated E0054 to new format

7 years agoAuto merge of #35821 - nbaksalyar:solaris-trans-fix, r=alexcrichton
bors [Mon, 22 Aug 2016 05:30:46 +0000 (22:30 -0700)]
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

7 years agoAdd reference to `Self` in traits chapter (book)
Panashe M. Fundira [Mon, 22 Aug 2016 03:09:18 +0000 (23:09 -0400)]
Add reference to `Self` in traits chapter (book)

7 years agoMinor type in CONTRIBUTING.md
Amit Levy [Mon, 22 Aug 2016 02:42:33 +0000 (22:42 -0400)]
Minor type in CONTRIBUTING.md

A single missing article

7 years agoAuto merge of #35777 - nrc:carrier3, r=@nikomatsakis
bors [Sun, 21 Aug 2016 22:12:43 +0000 (15:12 -0700)]
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

7 years agoFix type error with `?` in existing code.
Nick Cameron [Sun, 21 Aug 2016 21:31:26 +0000 (09:31 +1200)]
Fix type error with `?` in existing code.

7 years agorustc: Fix outdated comment
Vadim Petrochenkov [Sun, 21 Aug 2016 21:21:13 +0000 (00:21 +0300)]
rustc: Fix outdated comment

7 years agoadd example for `Rc::would_unwrap`
Matthew Piziak [Sun, 21 Aug 2016 21:18:21 +0000 (17:18 -0400)]
add example for `Rc::would_unwrap`

Part of #29372

r? @steveklabnik

7 years agoFix "Furthermore" Typo in String Docs
Christopher Serr [Sun, 21 Aug 2016 20:51:37 +0000 (22:51 +0200)]
Fix "Furthermore" Typo in String Docs

It used to say "Furtheremore" instead of "Furthermore".

7 years agoreplace `println!` statements with `assert!`ions in `std::ptr` examples
Matthew Piziak [Sun, 21 Aug 2016 20:49:09 +0000 (16:49 -0400)]
replace `println!` statements with `assert!`ions in `std::ptr` examples

r? @steveklabnik

7 years agoAuto merge of #35776 - jseyfried:more_groundwork, r=nrc
bors [Sun, 21 Aug 2016 18:03:48 +0000 (11:03 -0700)]
Auto merge of #35776 - jseyfried:more_groundwork, r=nrc

resolve: More groundwork for `item_like_imports` (RFC 1560)

r? @nrc

7 years agoUpdate lib.rs
Shyam Sundar B [Sun, 21 Aug 2016 13:13:58 +0000 (18:43 +0530)]
Update lib.rs
Update lib.rs
Update lib.rs
Update E0438.rs
Update E0437.rs
Update E0435.rs

7 years agocstring: avoid excessive growth just to 0-terminate
Ulrik Sverdrup [Sun, 21 Aug 2016 11:33:28 +0000 (13:33 +0200)]
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.

7 years agoUpdate E0503 to the new format
Wesley Wiser [Sun, 21 Aug 2016 01:07:19 +0000 (21:07 -0400)]
Update E0503 to the new format

Fixes #35703
Part of #35233

7 years agoreplace `Index` example with something more evocative of indexing
Matthew Piziak [Sat, 20 Aug 2016 20:39:40 +0000 (16:39 -0400)]
replace `Index` example with something more evocative of indexing

r? @steveklabnik

7 years agoUpdate E0424 to the new error format
Johannes Löthberg [Sat, 20 Aug 2016 00:41:51 +0000 (02:41 +0200)]
Update E0424 to the new error format

Fixes #35797.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
7 years agoreplace `Rem` example with something more evocative
Matthew Piziak [Sat, 20 Aug 2016 19:21:36 +0000 (15:21 -0400)]
replace `Rem` example with something more evocative

r? @steveklabnik

7 years agoAuto merge of #35857 - jonathandturner:rollup, r=jonathandturner
bors [Sat, 20 Aug 2016 14:09:53 +0000 (07:09 -0700)]
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

7 years agoRollup merge of #35839 - jonathandturner:error_touchup, r=Aatch
Jonathan Turner [Sat, 20 Aug 2016 14:09:37 +0000 (07:09 -0700)]
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
   |          ^^^^
```

7 years agoRollup merge of #35831 - trixnz:error-428, r=jonathandturner
Jonathan Turner [Sat, 20 Aug 2016 14:09:37 +0000 (07:09 -0700)]
Rollup merge of #35831 - trixnz:error-428, r=jonathandturner

Update E0428 to new format

Fixes #35798 as part of #35233.

r? @jonathandturner

7 years agoRollup merge of #35830 - matthew-piziak:not-example, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:37 +0000 (07:09 -0700)]
Rollup merge of #35830 - matthew-piziak:not-example, r=steveklabnik

replace `Neg` example with something more evocative of negation

7 years agoRollup merge of #35827 - matthew-piziak:neg-example, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:37 +0000 (07:09 -0700)]
Rollup merge of #35827 - matthew-piziak:neg-example, r=steveklabnik

replace `Not` example with something more evocative

7 years agoRollup merge of #35818 - wdv4758h:E0133-label, r=Aatch
Jonathan Turner [Sat, 20 Aug 2016 14:09:36 +0000 (07:09 -0700)]
Rollup merge of #35818 - wdv4758h:E0133-label, r=Aatch

Fix label messages for E0133

Issue #35789

7 years agoRollup merge of #35812 - mlayne:E0232, r=jonathandturner
Jonathan Turner [Sat, 20 Aug 2016 14:09:36 +0000 (07:09 -0700)]
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

7 years agoRollup merge of #35811 - jonathandturner:fix_rustbuild_version_test, r=alexcrichton
Jonathan Turner [Sat, 20 Aug 2016 14:09:36 +0000 (07:09 -0700)]
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

7 years agoRollup merge of #35806 - matthew-piziak:addassign-example, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:36 +0000 (07:09 -0700)]
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.

7 years agoRollup merge of #35804 - pliniker:master, r=jonathandturner
Jonathan Turner [Sat, 20 Aug 2016 14:09:35 +0000 (07:09 -0700)]
Rollup merge of #35804 - pliniker:master, r=jonathandturner

Update error message for E0084

Fixes #35792 as part of #35233

r? @jonathandturner

7 years agoRollup merge of #35800 - matthew-piziak:mul-div-examples, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:35 +0000 (07:09 -0700)]
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!

7 years agoRollup merge of #35794 - cantino:fix-typo, r=apasel422
Jonathan Turner [Sat, 20 Aug 2016 14:09:35 +0000 (07:09 -0700)]
Rollup merge of #35794 - cantino:fix-typo, r=apasel422

Fix minor typo

Minor typo in the book.

7 years agoRollup merge of #35781 - ErikUggeldahl:spellingfix, r=apasel422
Jonathan Turner [Sat, 20 Aug 2016 14:09:35 +0000 (07:09 -0700)]
Rollup merge of #35781 - ErikUggeldahl:spellingfix, r=apasel422

Very minor spelling fix in the book

Changed datastructure to data structure.

r? @steveklabnik

7 years agoRollup merge of #35780 - clementmiao:E0396_new_err_format, r=jonathandturner
Jonathan Turner [Sat, 20 Aug 2016 14:09:35 +0000 (07:09 -0700)]
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

7 years agoRollup merge of #35778 - clementmiao:E0395_new_error_format, r=jonathandturner
Jonathan Turner [Sat, 20 Aug 2016 14:09:34 +0000 (07:09 -0700)]
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

7 years agoRollup merge of #35775 - frewsxcv:os-str-doc-examples, r=GuillaumeGomez
Jonathan Turner [Sat, 20 Aug 2016 14:09:34 +0000 (07:09 -0700)]
Rollup merge of #35775 - frewsxcv:os-str-doc-examples, r=GuillaumeGomez

Add a few doc examples for `std::ffi::OsStr`.

7 years agoRollup merge of #35710 - matthew-piziak:explicit-drop, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:34 +0000 (07:09 -0700)]
Rollup merge of #35710 - matthew-piziak:explicit-drop, r=steveklabnik

note that calling drop() explicitly is a compiler error

Part of #29365

7 years agoRollup merge of #35709 - matthew-piziak:add-trait-example, r=GuillaumeGomez
Jonathan Turner [Sat, 20 Aug 2016 14:09:34 +0000 (07:09 -0700)]
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

7 years agoRollup merge of #35701 - matthew-piziak:rangefull-example-error, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:33 +0000 (07:09 -0700)]
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.

7 years agoRollup merge of #35234 - nrc:rustdoc-macros, r=steveklabnik
Jonathan Turner [Sat, 20 Aug 2016 14:09:33 +0000 (07:09 -0700)]
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).

7 years agoFix broken tests for E0428
trixnz [Sat, 20 Aug 2016 10:10:41 +0000 (12:10 +0200)]
Fix broken tests for E0428

7 years agoFix linker on Solaris/Illumos
Nikita Baksalyar [Sat, 13 Aug 2016 09:09:43 +0000 (14:09 +0500)]
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.

7 years agoAuto merge of #35607 - alexcrichton:stabilize-1.12, r=brson
bors [Sat, 20 Aug 2016 07:08:38 +0000 (00:08 -0700)]
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

7 years agoCheck that executable file is in-tree before failing tidy check.
Mark-Simulacrum [Sat, 20 Aug 2016 03:44:46 +0000 (21:44 -0600)]
Check that executable file is in-tree before failing tidy check.

7 years agoAuto merge of #33922 - estebank:doc-comment, r=alexcrichton
bors [Sat, 20 Aug 2016 01:14:53 +0000 (18:14 -0700)]
Auto merge of #33922 - estebank:doc-comment, r=alexcrichton

Specific error message for missplaced doc comments

Identify when documetation comments have been missplaced in the following places:

 * After a struct element:

    ```rust
    // file.rs:
    struct X {
        a: u8 /** document a */,
    }
    ```

    ```bash
    $ rustc file.rs
    file.rs:2:11: 2:28 error: found documentation comment that doesn't
    document anything
    file.rs:2     a: u8 /** document a */,
                        ^~~~~~~~~~~~~~~~~
    file.rs:2:11: 2:28 help: doc comments must come before what they document,
    maybe a comment was intended with `//`?
    ```

 * As the last line of a struct:

    ```rust
    // file.rs:
    struct X {
        a: u8,
        /// incorrect documentation
    }
    ```

    ```bash
    $ rustc file.rs
    file.rs:3:5: 3:27 error: found a documentation comment that doesn't
    document anything
    file.rs:3     /// incorrect documentation
                  ^~~~~~~~~~~~~~~~~~~~~~
    file.rs:3:5: 3:27 help: doc comments must come before what they document,
    maybe a comment was intended with `//`?
    ```

 * As the last line of a `fn`:

    ```rust
    // file.rs:
    fn main() {
        let x = 1;
        /// incorrect documentation
    }
    ```

    ```bash
    $ rustc file.rs
    file.rs:3:5: 3:27 error: found a documentation comment that doesn't
    document anything
    file.rs:3     /// incorrect documentation
                  ^~~~~~~~~~~~~~~~~~~~~~
    file.rs:3:5: 3:27 help: doc comments must come before what they document,
    maybe a comment was intended with `//`?
    ```

Fix #27429, #30322

7 years agoFix typos in unix/rwlock.rs
Andrew Paseltiner [Sat, 20 Aug 2016 01:12:36 +0000 (21:12 -0400)]
Fix typos in unix/rwlock.rs

7 years agowording fixes in error messages
Jonathan Turner [Fri, 19 Aug 2016 23:05:37 +0000 (16:05 -0700)]
wording fixes in error messages

7 years agoNew format for E0426
crypto-universe [Fri, 19 Aug 2016 20:31:31 +0000 (22:31 +0200)]
New format for E0426

Issue #35799 as a part of issue #35233
?r jonathandturner

7 years agostd: Stabilize APIs for the 1.12 release
Alex Crichton [Thu, 11 Aug 2016 21:08:24 +0000 (14:08 -0700)]
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

7 years agoAuto merge of #35655 - ollie27:rustdoc_search_static_prim, r=steveklabnik
bors [Fri, 19 Aug 2016 18:17:11 +0000 (11:17 -0700)]
Auto merge of #35655 - ollie27:rustdoc_search_static_prim, r=steveklabnik

rustdoc: Fix a couple of issues with the search results

* Fix links to static items in the search results.
* Don't include the path for primitive methods in the search results. Displaying `std::u32::max_value` is misleading so just display `u32::max_value`.

7 years agoUpdate E0428 to new format
trixnz [Fri, 19 Aug 2016 17:19:34 +0000 (19:19 +0200)]
Update E0428 to new format

7 years agoreplace `Neg` example with something more evocative of negation
Matthew Piziak [Fri, 19 Aug 2016 16:46:11 +0000 (12:46 -0400)]
replace `Neg` example with something more evocative of negation

7 years agoreplace `Not` example with something more evocative
Matthew Piziak [Fri, 19 Aug 2016 16:35:54 +0000 (12:35 -0400)]
replace `Not` example with something more evocative

7 years agoAdd new error code tests
Guillaume Gomez [Fri, 19 Aug 2016 14:44:47 +0000 (16:44 +0200)]
Add new error code tests

7 years agoUpdate block codes' flags
Guillaume Gomez [Fri, 19 Aug 2016 14:44:29 +0000 (16:44 +0200)]
Update block codes' flags

7 years agoFix label messages for E0133
Chiu-Hsiang Hsu [Fri, 19 Aug 2016 03:58:26 +0000 (11:58 +0800)]
Fix label messages for E0133

Issue #35789

7 years agoAuto merge of #35719 - Amanieu:atomic_access, r=alexcrichton
bors [Fri, 19 Aug 2016 01:44:54 +0000 (18:44 -0700)]
Auto merge of #35719 - Amanieu:atomic_access, r=alexcrichton

Implement RFC 1649

cc #35603 rust-lang/rfcs#1649

r? @alexcrichton

7 years agoRemove the Option and bool impls for carrier and add a dummy impl
Nick Cameron [Tue, 9 Aug 2016 05:54:24 +0000 (17:54 +1200)]
Remove the Option and bool impls for carrier and add a dummy impl

The dummy impl should ensure the same type checking behaviour as having other (real) Carrier impls.

7 years agoUpdate error format for E0232
Michael Layne [Thu, 18 Aug 2016 21:40:59 +0000 (14:40 -0700)]
Update error format for E0232

7 years agoAdd workaround to detect correct compiler version
Jonathan Turner [Thu, 18 Aug 2016 22:22:23 +0000 (15:22 -0700)]
Add workaround to detect correct compiler version

7 years agoreplace `AddAssign` example with something more evocative of addition
Matthew Piziak [Thu, 18 Aug 2016 20:54:33 +0000 (16:54 -0400)]
replace `AddAssign` example with something more evocative of addition

This is analogous to PR #35709 for the `Add` trait.

7 years agonote that calling drop() explicitly is a compiler error
Matthew Piziak [Tue, 16 Aug 2016 08:33:59 +0000 (04:33 -0400)]
note that calling drop() explicitly is a compiler error

Part of #29365

explain that std::mem::drop in prelude will invoke Drop

change "prelude" -> "the prelude"; change links to reference-style

move link references to links' section

7 years agoUpdate error message for E0084
pliniker [Thu, 18 Aug 2016 20:27:33 +0000 (16:27 -0400)]
Update error message for E0084

7 years agoRedirect
Nick Cameron [Tue, 16 Aug 2016 02:25:12 +0000 (14:25 +1200)]
Redirect

7 years agosplit example into three sections with explanation
Matthew Piziak [Thu, 18 Aug 2016 20:12:40 +0000 (16:12 -0400)]
split example into three sections with explanation

7 years agodemonstrate `RHS != Self` use cases for `Mul` and `Div`
Matthew Piziak [Thu, 18 Aug 2016 20:04:53 +0000 (16:04 -0400)]
demonstrate `RHS != Self` use cases for `Mul` and `Div`

Vector-scalar multipication is a good usecase for this. Thanks #rust!

7 years agoFix minor typo
Andrew Cantino [Thu, 18 Aug 2016 19:06:05 +0000 (15:06 -0400)]
Fix minor typo

7 years agoAuto merge of #35684 - nikomatsakis:incr-comp-metadata-audit-35111, r=mw
bors [Thu, 18 Aug 2016 15:54:10 +0000 (08:54 -0700)]
Auto merge of #35684 - nikomatsakis:incr-comp-metadata-audit-35111, r=mw

Restructure metadata encoder to track deps precisely

This issue restructures meta-data encoding to track dependencies very precisely. It uses a cute technique I hope to spread elsewhere, where we can guard the data flowing into a new dep-graph task and ensure that it is not "leaking" information from the outside, which would result in missing edges. There are no tests because we don't know of any bugs in the old system, but it's clear that there was leaked data.

The commit series is standalone, but the refactorings are kind of "windy". It's a good idea to read the comment in `src/librustc_metadata/index_builder.rs` to get a feeling for the overall strategy I was aiming at.

In several cases, I wound up adding some extra hashtable lookups, I think primarily for looking up `AdtDef` instances. We could remove these by implementing `DepGraphRead` for an `AdtDef` and then having it register a read to the adt-defs table, I guess, but I doubt it is really noticeable.

Eventually I think I'd like to extend this pattern to the dep-graph more generally, since it effectively guarantees that data cannot leak.

Fixes #35111.

r? @michaelwoerister

7 years agoAdd a few doc examples for `std::ffi::OsStr`.
Corey Farwell [Thu, 18 Aug 2016 02:56:43 +0000 (22:56 -0400)]
Add a few doc examples for `std::ffi::OsStr`.

* `std::ffi::OsStr::new`.
* `std::ffi::OsStr::is_empty`.
* `std::ffi::OsStr::len`.

7 years agoAuto merge of #35732 - jonathandturner:region_error_labels, r=nikomatsakis
bors [Thu, 18 Aug 2016 12:39:11 +0000 (05:39 -0700)]
Auto merge of #35732 - jonathandturner:region_error_labels, r=nikomatsakis

Move 'doesn't live long enough' errors to labels

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

An example follows.

Before:

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

After:

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

r? @nikomatsakis

7 years agoAdd type `Determinacy`.
Jeffrey Seyfried [Thu, 18 Aug 2016 05:39:32 +0000 (05:39 +0000)]
Add type `Determinacy`.

7 years agoFix fallout in tests.
Jeffrey Seyfried [Thu, 18 Aug 2016 02:00:47 +0000 (02:00 +0000)]
Fix fallout in tests.

7 years agoRefactor away `ImportResolvingError`.
Jeffrey Seyfried [Thu, 18 Aug 2016 03:39:48 +0000 (03:39 +0000)]
Refactor away `ImportResolvingError`.

7 years agoRename `source` -> `name` in `finalize_import`.
Jeffrey Seyfried [Thu, 18 Aug 2016 01:46:18 +0000 (01:46 +0000)]
Rename `source` -> `name` in `finalize_import`.

7 years agoRename `target_module` to `module` or `imported_module`.
Jeffrey Seyfried [Thu, 18 Aug 2016 01:43:26 +0000 (01:43 +0000)]
Rename `target_module` to `module` or `imported_module`.