Commit Graph

73075 Commits

Author SHA1 Message Date
varkor
919d643b79 Add min and last specialisations for Range 2018-01-09 19:37:44 +00:00
varkor
2d8334358a Use next and next_back 2018-01-06 22:14:02 +00:00
varkor
c23d4500fd Fix behaviour after iterator exhaustion 2018-01-05 18:57:10 +00:00
varkor
439beab41f Remove min from RangeFrom 2018-01-04 15:03:50 +00:00
varkor
f3baa85729 Add tests for specialised Range iter methods 2018-01-04 12:37:00 +00:00
varkor
087bffa78c Remove RangeInclusive::sum 2018-01-04 12:36:43 +00:00
varkor
29e6b1034b Add max and sum specialisations for Range 2018-01-04 01:51:18 +00:00
varkor
3d9c36fbf5 Add min specialisation for RangeFrom and last for RangeInclusive 2018-01-04 00:58:41 +00:00
varkor
680ebf7b16 Add min and max specialisations for RangeInclusive 2018-01-04 00:17:36 +00:00
bors
8d1a30289e Auto merge of #46913 - Eh2406:master, r=eddyb
CStore switch FxHashMap to IndexVec

This is a first attempt to fix #46876.
2018-01-03 12:59:52 +00:00
bors
b107f720e5 Auto merge of #47151 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

- Successful merges: #47104, #47107, #47113, #47117, #47118, #47121, #47125, #47134, #47145
- Failed merges:
2018-01-03 10:07:39 +00:00
kennytm
b416119472 Rollup merge of #47145 - frewsxcv:frewsxcv-linewriter-error, r=QuietMisdreavus
Document when LineWriter flushes; document errors for into_inner.

Fixes https://github.com/rust-lang/rust/issues/42468.
2018-01-03 16:58:04 +08:00
kennytm
08501bd983 Rollup merge of #47134 - Sogomn:master, r=QuietMisdreavus
Defocus search bar in rustdoc pages

rust-lang/rfcs#2265
2018-01-03 16:58:03 +08:00
kennytm
bf3fd1744c Rollup merge of #47125 - daboross:patch-3, r=estebank
Mention SliceConcatExt's stability in its docs

Just saw someone in IRC mention there being no stable way to join string slices! It isn't entirely clear from the rust documentation that `SliceConcatExt` is usable. While this is mentioned in https://doc.rust-lang.org/std/prelude/, the trait has nothing to indicate that it's currently usable if found via a documentation search.

The wording on this could probably be improved, but I'm hoping its better than nothing.
2018-01-03 16:58:02 +08:00
kennytm
8bfb420d63 Rollup merge of #47121 - frewsxcv:frewsxcv-vec, r=kennytm
Fix panic condition docs for Vec::insert.

Fixes https://github.com/rust-lang/rust/issues/47065.
2018-01-03 16:58:01 +08:00
kennytm
2182f1431c Rollup merge of #47118 - hdhoang:patch-2, r=BurntSushi
memchr: fix variable name in docstrings

upstream BurntSushi/rust-memchr#24

r=BurntSushi
2018-01-03 16:58:00 +08:00
kennytm
d6cf5a56ac Rollup merge of #47117 - tinaun:no_more_dups, r=frewsxcv
[unstable book] remove duplicate entries

if a unstable feature is a language feature, it shouldn't also have a library feature stub generated
2018-01-03 16:57:58 +08:00
kennytm
219e72c908 Rollup merge of #47113 - sdroege:chunks-size-field, r=dtolnay
Minor cleanup for slice::Chunks and ChunksMut

This only renames the `size` field to `chunk_size` in one of them for consistency, and changes an assertion to check for != 0 instead of > 0.
2018-01-03 16:57:57 +08:00
kennytm
dd0b70e3fe Rollup merge of #47107 - mark-i-m:patch-1, r=steveklabnik
Fix typo

I am assuming that there was once something else you could do and somebody forgot to remove "either". Is that correct?
2018-01-03 16:57:56 +08:00
kennytm
f7932ef1d5 Rollup merge of #47104 - matthewjasper:dont-panic-on-generic-drop, r=estebank
Delay panic from incoherent drop implementation

Closes #41974
2018-01-03 16:57:55 +08:00
bors
b8934399a8 Auto merge of #47088 - clarcharr:cleanup_unicode_py, r=alexcrichton
Move static code outside of unciode.py.

This script in libstd_unicode is a mess and also contains code that shouldn't be output by a script, and instead just put in modules. So, this change does that.
2018-01-03 06:24:23 +00:00
Clar Charr
b4b3ddd59e Move static code outside of unciode.py. 2018-01-02 22:51:22 -05:00
bors
0f4ebf9f0a Auto merge of #47146 - ereslibre:issue-42106, r=estebank
Only bump error count when we are sure that the diagnostic is not a repetition

This ensures that if we emit the same diagnostic twice, the error count will
match the real number of errors shown to the user.

Fixes #42106

This is a followup of https://github.com/rust-lang/rust/pull/45603 as stated in https://github.com/rust-lang/rust/issues/42106#issuecomment-345218473.

This program, for example:

```rust
fn do_something<T>(collection: &mut Vec<T>) {
    let _a = &collection;
    collection.swap(1, 2);
}

fn main() {}
```

without this patch, produces:

```
error[E0502]: cannot borrow `*collection` as mutable because `collection` is also borrowed as immutable
  --> $DIR/issue-42106.rs:13:5
   |
12 |     let _a = &collection;
   |               ---------- immutable borrow occurs here
13 |     collection.swap(1, 2); //~ ERROR also borrowed as immutable
   |     ^^^^^^^^^^ mutable borrow occurs here
14 | }
   | - immutable borrow ends here

error: aborting due to 2 previous errors
```

The number of errors do not match the diagnostics reported. This PR fixes this problem. The output is now in this case:

```
error[E0502]: cannot borrow `*collection` as mutable because `collection` is also borrowed as immutable
  --> $DIR/issue-42106.rs:13:5
   |
12 |     let _a = &collection;
   |               ---------- immutable borrow occurs here
13 |     collection.swap(1, 2); //~ ERROR also borrowed as immutable
   |     ^^^^^^^^^^ mutable borrow occurs here
14 | }
   | - immutable borrow ends here

error: aborting due to previous error
```

Also, some other tests outputs have been adapted because their count didn't really match the number of diagnostics reported.

As an aside, an outdated comment has been removed (`Handler::cancel` will only call to the `Diagnostic::cancel` method and will not decrease the count of errors).

All tests are passing with this PR (`x.py test` is successful).
2018-01-03 03:37:47 +00:00
Rafael Fernández López
063607eecb
Only bump error count when we are sure that the diagnostic is not a repetition.
This ensures that if we emit the same diagnostic twice, the error count will
match the real number of errors shown to the user.

Fixes #42106
2018-01-03 00:42:12 +01:00
Corey Farwell
f3ef077b91 Document when LineWriter flushes; document errors for into_inner.
Fixes https://github.com/rust-lang/rust/issues/42468.
2018-01-02 13:30:44 -08:00
Johannes Boczek
3153d23bb7 Indentation fix
Fixed intentaion (tabs -> spaces)
Added trailing newline
2018-01-02 19:58:06 +01:00
Johannes Boczek
0772b6faed Defocus search bar in rustdoc pages
Escape now removes focus from the search bar
2018-01-02 19:47:44 +01:00
bors
687d3d15ba Auto merge of #47105 - matthewjasper:dont-panic-for-mut-in-static, r=estebank
Delay panic for aliasing violation for static items.

Closes #46604
2018-01-02 15:40:20 +00:00
bors
a37126b90c Auto merge of #47042 - redox-os:redox, r=estebank
Redox - Implement rename using new system call

This does the following:

- Update syscall module to match upstream
- Implement rename using new system call
- Make readlink and symlink utilize O_CLOEXEC
- Make readlink and symlink not leave dangling file handles on failure
2018-01-02 11:22:40 +00:00
David Ross
d5acd23565 Mention SliceConcatExt's stability in its docs
SliceConcatExt's status as an unstable trait with stable methods is
documented in the compiler error for using it, and in
https://doc.rust-lang.org/std/prelude/, but it is not mentioned in the
trait itself.

Mentioning the methods can be used in stable rust today should help
users who are looking for a `join` method while working on stable rust.
2018-01-02 00:38:03 -08:00
bors
5873a74d8f Auto merge of #47111 - rkruppe:repr-transparent, r=estebank
Check all repr hints together when checking for mis-applied attributes

Fixes #47094

Besides fixing that bug, this change has a user-visible effect on the spans in the "incompatible repr hints" warning and another error: they now point at `foo` and/or `bar` in `repr(foo, bar)` instead of the whole attribute. This is sometimes more precise (e.g., `#[repr(C, packed)]` on an enum points at the `packed`) but sometimes not. I moved a compile-fail test to a ui test to illustrate how it now looks in the common case of only one attribute.
2018-01-02 08:34:27 +00:00
Sebastian Dröge
c096b3a451 Use assert!(chunk_size != 0) instead of > 0 for usize value 2018-01-02 10:00:58 +02:00
Sebastian Dröge
9957cf6023 Consistently use chunk_size as the field name for Chunks and ChunksMut
Previously Chunks used size and ChunksMut used chunk_size
2018-01-02 10:00:58 +02:00
Corey Farwell
301e457989 Fix panic condition docs for Vec::insert.
Fixes https://github.com/rust-lang/rust/issues/47065.
2018-01-01 19:06:59 -08:00
tinaun
5c25b0c594 prevent generating duplicate stubs 2018-01-01 19:56:40 -05:00
bors
b9cf26c38a Auto merge of #47106 - EdSchouten:compiletest-cloudabi, r=alexcrichton
Tiny fixes to make compiletest work for CloudABI cross builds

I'm currently working toward getting a `src/ci/docker` container working to do isolated/automated builds and testing of `x86_64-unknown-cloudabi`. This is working pretty well, but still requires some fixes to `libtest` and `compiletest`. Here is the first set of fixes that I had to apply.
2018-01-02 00:31:07 +00:00
Robin Kruppe
03936115ef Check all repr hints together when checking for mis-applied attributes
Fixes #47094

Besides fixing that bug, this change has a user-visible effect on the spans in the "incompatible repr hints" warning and another error: they now point at `foo` and/or `bar` in `repr(foo, bar)` instead of the whole attribute. This is sometimes more precise (e.g., `#[repr(C, packed)]` on an enum points at the `packed`) but sometimes not. I moved a compile-fail test to a ui test to illustrate how it now looks in the common case of only one attribute.
2018-01-01 22:05:29 +01:00
Who? Me?!
05cbe6d7db
Fix typo 2018-01-01 13:17:25 -06:00
bors
b65f0bedd2 Auto merge of #46735 - Manishearth:memchr-find, r=burntsushi
Use memchr for str::find(char)

This is a 10x improvement for searching for characters.

This also contains the patches from https://github.com/rust-lang/rust/pull/46713 . Feel free to land both separately or together.

cc @mystor @alexcrichton

r? @bluss

fixes #46693
2018-01-01 19:04:33 +00:00
Ed Schouten
7b5543d7b6 Move the TestPaths structure from libtest to compiletest.
This structure doesn't seem to be used by libtest itself. It is used by
compiletest, but never passed on to anything externally. This makes it
easier to get the testing framework to work for CloudABI crossbuilds, as
CloudABI currently lacks PathBuf, which is used by TestPaths.
2018-01-01 19:30:19 +01:00
Ed Schouten
79b25c666f Add CloudABI to the list of supported targets in compiletest.
Without this change, compiletest will fail to run when targetting
CloudABI.
2018-01-01 19:27:58 +01:00
matthewjasper
f26c0b41d2 Delay panic for aliasing violation for static items. 2018-01-01 17:53:12 +00:00
matthewjasper
31a4cba010 Delay panic from incoherent drop implementation 2018-01-01 17:51:37 +00:00
bors
5deba220d4 Auto merge of #46278 - MaloJaffre:ci-compiler-docs, r=kennytm
Add compiler docs testing to CI.

Fixes #47025.
I don't know if `x86_64-gnu` is the right builder for this, but there seems to be time left on [Travis](https://travis-ci.org/rust-lang/rust/jobs/307488864).

Remaining problems blocking this PR:
- [x] broken links caused by rustdoc issues:
  - [x] `pub use self::Enum::...`: #46766 and #46767 (fixed by #47050, thanks @ollie27!)
  - [x] `impl Deref for DerefToStdType`: #32129 (ignored in linkchecker)
  - [x] `#[feature(decl_macro)]` and `use std::vec`: #47038 (ignored in linkchecker)
  - [x]  `rustc_data_structures::sync::{Lrc, RwLock}` aliases `std` types: #32130 (ignored in linkchecker)
- [x] markdown differences, in rust repository and in external crates, now failing the build with #46880 merged (all fixed)
- [x] multiple crate updates needed: `rand`, `log`, `parking_lot_core`, `flate2`
  - [x] submodule updates needed to deduplicate dependencies: `rust-installer`, ~`cargo`~ (done by #47052)
  - [x] #44953 test broken by `log` update (removed, this can be controversial)
- [x] Waiting `x86_64-gnu` build results ([done](https://travis-ci.org/rust-lang/rust/builds/323451069))

See individual commits for more details.
2018-01-01 16:22:26 +00:00
Manish Goregaokar
5cf55165fa handle overflow/underflow in index offsets 2018-01-01 19:55:21 +05:30
Malo Jaffré
2449230cce Enable compiler docs testing in x86_64-gnu 2018-01-01 14:44:13 +01:00
Malo Jaffré
cbb32a9418 Fix docs for future pulldown migration 2018-01-01 14:44:12 +01:00
Malo Jaffré
8395798d1a Ignore remaining broken links caused by rustdoc bugs
As pointed out by @ollie27.
2018-01-01 14:44:11 +01:00
Malo Jaffré
7249539de9 Fix broken links in internal docs 2018-01-01 14:44:11 +01:00
Malo Jaffré
8ed13d643a Update crates and submodules to pull doc fixes
Update `rand` crate to `0.3.19`.
Update `log` crate to `0.3.9` and `0.4.1`.
Update `parking_lot_core` crate to `0.2.9`.
Upgrade all flate2 dependencies to `1.0.1`.
- Update `rust-installer` submodule.
2018-01-01 14:44:10 +01:00