Commit Graph

56140 Commits

Author SHA1 Message Date
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
Matthew Piziak
825fd11bd6 replace Rem example with something more evocative
r? @steveklabnik
2016-08-20 15:21:36 -04: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
bors
38fa82a314 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
2016-08-19 18:14:53 -07:00
Andrew Paseltiner
f7961126b5
Fix typos in unix/rwlock.rs 2016-08-19 21:12:36 -04:00
Jonathan Turner
54d0acd2fc wording fixes in error messages 2016-08-19 16:05:37 -07:00
crypto-universe
5d02b03059 New format for E0426
Issue #35799 as a part of issue #35233
?r jonathandturner
2016-08-19 22:31:31 +02:00
Brian Anderson
fce605e1f2 Remove old stage0 compatibility 2016-08-19 20:26:10 +00:00
Alex Crichton
afeeadeae5 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-19 11:59:56 -07:00
bors
f883b0bbab 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`.
2016-08-19 11:17:11 -07:00
trixnz
3b64cf669c Update E0428 to new format 2016-08-19 19:19:34 +02:00
Matthew Piziak
c0eccb1203 replace Neg example with something more evocative of negation 2016-08-19 12:46:11 -04:00
Matthew Piziak
06147ac291 replace Not example with something more evocative 2016-08-19 12:36:48 -04:00
Guillaume Gomez
f551674c6d Add new error code tests 2016-08-19 16:44:47 +02:00
Guillaume Gomez
2c190ad0d2 Update block codes' flags 2016-08-19 16:44:29 +02:00
Chiu-Hsiang Hsu
2128d31a41 Fix label messages for E0133
Issue #35789
2016-08-19 11:58:26 +08:00
bors
413ada3040 Auto merge of #35719 - Amanieu:atomic_access, r=alexcrichton
Implement RFC 1649

cc #35603 rust-lang/rfcs#1649

r? @alexcrichton
2016-08-18 18:44:54 -07:00
Nick Cameron
5aa89d8bf6 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.
2016-08-19 13:31:55 +12:00
Michael Layne
39f318bb4d
Update error format for E0232 2016-08-18 15:31:34 -07:00
Jonathan Turner
ffbb8600fb Add workaround to detect correct compiler version 2016-08-18 15:22:23 -07:00
Matthew Piziak
6c66eaa035 replace AddAssign example with something more evocative of addition
This is analogous to PR #35709 for the `Add` trait.
2016-08-18 16:58:38 -04:00
Matthew Piziak
a516dbb7d9 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
2016-08-18 16:31:32 -04:00
pliniker
161cb36159 Update error message for E0084 2016-08-18 16:27:33 -04:00
Nick Cameron
301401e568 Redirect 2016-08-19 08:20:06 +12:00
Matthew Piziak
469b7fd1c0 split example into three sections with explanation 2016-08-18 16:12:40 -04:00
Matthew Piziak
9563f14eb5 demonstrate RHS != Self use cases for Mul and Div
Vector-scalar multipication is a good usecase for this. Thanks #rust!
2016-08-18 16:04:53 -04:00
Andrew Cantino
06302cb983 Fix minor typo 2016-08-18 15:06:05 -04:00