]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAdd transpose conversions for Option and Result
Taylor Cramer [Thu, 4 Jan 2018 19:34:03 +0000 (11:34 -0800)]
Add transpose conversions for Option and Result

These impls are useful when working with combinator
methods that expect an option or a result, but you
have a Result<Option<T>, E> instead of an Option<Result<T, E>>
or vice versa.

6 years agoAuto merge of #46916 - michaelwoerister:generate-dead-code-plz, r=alexcrichton
bors [Thu, 4 Jan 2018 14:04:27 +0000 (14:04 +0000)]
Auto merge of #46916 - michaelwoerister:generate-dead-code-plz, r=alexcrichton

Generate code for unused const- and inline-fns if -Clink-dead-code is specified.

Fixes https://github.com/rust-lang/rust/issues/46467.

r? @alexcrichton

6 years agoAuto merge of #47147 - projektir:to_ptr_cast, r=eddyb
bors [Thu, 4 Jan 2018 09:54:15 +0000 (09:54 +0000)]
Auto merge of #47147 - projektir:to_ptr_cast, r=eddyb

Force appropriate extension when converting from int to ptr #43291

Fixes #43291.

Looking for feedback if I've missed something and/or need to add more tests.

@eddyb @retep998 @nagisa @oli-obk

6 years agoGenerate code for const- and inline-fns if -Clink-dead-code is specified.
Michael Woerister [Thu, 21 Dec 2017 16:49:24 +0000 (17:49 +0100)]
Generate code for const- and inline-fns if -Clink-dead-code is specified.

6 years agoAuto merge of #47124 - estebank:loan-paths, r=nikomatsakis
bors [Thu, 4 Jan 2018 05:52:39 +0000 (05:52 +0000)]
Auto merge of #47124 - estebank:loan-paths, r=nikomatsakis

Reword reason for move note

On move errors, when encountering an enum variant, be more ambiguous and do not refer to the type on the cause note, to avoid referring to `(maybe as std::prelude::v1::Some).0`, and instead refer to `the value`.

Sidesteps part of the problem with #41962:

```
error[E0382]: use of partially moved value: `maybe`
 --> file.rs:5:30
  |
5 |         if let Some(thing) = maybe {
  |                     -----    ^^^^^ value used here after move
  |                     |
  |                     value moved here
  = note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0`
 --> file.rs:5:21
  |
5 |         if let Some(thing) = maybe {
  |                     ^^^^^ value moved here in previous iteration of loop
  = note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error: aborting due to 2 previous errors
```

Previous discussion: #44360

r? @arielb1

6 years agoAuto merge of #47132 - cramertj:impl-trait-camel-case, r=nikomatsakis
bors [Thu, 4 Jan 2018 03:12:39 +0000 (03:12 +0000)]
Auto merge of #47132 - cramertj:impl-trait-camel-case, r=nikomatsakis

Limit style lint to non-synthetic generic params

Fix https://github.com/rust-lang/rust/issues/46959

r? @nikomatsakis

6 years agoTweak to mir borrow in a loop diagnostic
Esteban Küber [Wed, 3 Jan 2018 22:13:32 +0000 (14:13 -0800)]
Tweak to mir borrow in a loop diagnostic

6 years agoAdd mir test, review comments
Esteban Küber [Wed, 3 Jan 2018 21:55:40 +0000 (13:55 -0800)]
Add mir test, review comments

6 years agoAuto merge of #46984 - arielb1:pre-statement-effect, r=nikomatsakis
bors [Wed, 3 Jan 2018 21:06:21 +0000 (21:06 +0000)]
Auto merge of #46984 - arielb1:pre-statement-effect, r=nikomatsakis

NLL fixes

First, introduce pre-statement effects to dataflow to fix #46875. Edge dataflow effects might make that redundant, but I'm not sure of the best way to integrate them with liveness etc., and if this is a hack, this is one of the cleanest hacks I've seen.

And I want a small fix to avoid the torrent of bug reports.

Second, fix linking of projections to fix #46974

r? @pnkfelix

6 years agoAuto merge of #47127 - EdSchouten:cloudabi-tests, r=kennytm
bors [Wed, 3 Jan 2018 17:00:24 +0000 (17:00 +0000)]
Auto merge of #47127 - EdSchouten:cloudabi-tests, r=kennytm

First cut at getting some part of the test suite working for CloudABI

I am currently working on creating a Docker container for automated CI for CloudABI. Here are some of the trivial changes that need to land to make tests pass.

6 years agoRestore a FIXME that was removed by one of my previous changes.
Ed Schouten [Wed, 3 Jan 2018 14:40:37 +0000 (15:40 +0100)]
Restore a FIXME that was removed by one of my previous changes.

Requested by: kennytm

6 years agoAuto merge of #46913 - Eh2406:master, r=eddyb
bors [Wed, 3 Jan 2018 12:59:52 +0000 (12:59 +0000)]
Auto merge of #46913 - Eh2406:master, r=eddyb

CStore switch FxHashMap to IndexVec

This is a first attempt to fix #46876.

6 years agoAuto merge of #47151 - kennytm:rollup, r=kennytm
bors [Wed, 3 Jan 2018 10:07:39 +0000 (10:07 +0000)]
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:

6 years agoRollup merge of #47145 - frewsxcv:frewsxcv-linewriter-error, r=QuietMisdreavus
kennytm [Wed, 3 Jan 2018 08:58:04 +0000 (16:58 +0800)]
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.

6 years agoRollup merge of #47134 - Sogomn:master, r=QuietMisdreavus
kennytm [Wed, 3 Jan 2018 08:58:03 +0000 (16:58 +0800)]
Rollup merge of #47134 - Sogomn:master, r=QuietMisdreavus

Defocus search bar in rustdoc pages

rust-lang/rfcs#2265

6 years agoRollup merge of #47125 - daboross:patch-3, r=estebank
kennytm [Wed, 3 Jan 2018 08:58:02 +0000 (16:58 +0800)]
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.

6 years agoRollup merge of #47121 - frewsxcv:frewsxcv-vec, r=kennytm
kennytm [Wed, 3 Jan 2018 08:58:01 +0000 (16:58 +0800)]
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.

6 years agoRollup merge of #47118 - hdhoang:patch-2, r=BurntSushi
kennytm [Wed, 3 Jan 2018 08:58:00 +0000 (16:58 +0800)]
Rollup merge of #47118 - hdhoang:patch-2, r=BurntSushi

memchr: fix variable name in docstrings

upstream BurntSushi/rust-memchr#24

r=BurntSushi

6 years agoRollup merge of #47117 - tinaun:no_more_dups, r=frewsxcv
kennytm [Wed, 3 Jan 2018 08:57:58 +0000 (16:57 +0800)]
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

6 years agoRollup merge of #47113 - sdroege:chunks-size-field, r=dtolnay
kennytm [Wed, 3 Jan 2018 08:57:57 +0000 (16:57 +0800)]
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.

6 years agoRollup merge of #47107 - mark-i-m:patch-1, r=steveklabnik
kennytm [Wed, 3 Jan 2018 08:57:56 +0000 (16:57 +0800)]
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?

6 years agoRollup merge of #47104 - matthewjasper:dont-panic-on-generic-drop, r=estebank
kennytm [Wed, 3 Jan 2018 08:57:55 +0000 (16:57 +0800)]
Rollup merge of #47104 - matthewjasper:dont-panic-on-generic-drop, r=estebank

Delay panic from incoherent drop implementation

Closes #41974

6 years agoAuto merge of #47088 - clarcharr:cleanup_unicode_py, r=alexcrichton
bors [Wed, 3 Jan 2018 06:24:23 +0000 (06:24 +0000)]
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.

6 years agoForce appropriate extension when converting from int to ptr #43291
projektir [Tue, 2 Jan 2018 20:44:54 +0000 (12:44 -0800)]
Force appropriate extension when converting from int to ptr #43291

6 years agoMove static code outside of unciode.py.
Clar Charr [Sun, 31 Dec 2017 07:08:15 +0000 (02:08 -0500)]
Move static code outside of unciode.py.

6 years agoBe ambiguous when type cannot be properly mentioned
Esteban Küber [Tue, 2 Jan 2018 06:23:13 +0000 (22:23 -0800)]
Be ambiguous when type cannot be properly mentioned

6 years agoAuto merge of #47146 - ereslibre:issue-42106, r=estebank
bors [Wed, 3 Jan 2018 03:37:47 +0000 (03:37 +0000)]
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).

6 years agoOnly bump error count when we are sure that the diagnostic is not a repetition.
Rafael Fernández López [Tue, 2 Jan 2018 19:00:12 +0000 (20:00 +0100)]
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

6 years agoDocument when LineWriter flushes; document errors for into_inner.
Corey Farwell [Tue, 2 Jan 2018 21:30:44 +0000 (13:30 -0800)]
Document when LineWriter flushes; document errors for into_inner.

Fixes https://github.com/rust-lang/rust/issues/42468.

6 years agoIndentation fix
Johannes Boczek [Tue, 2 Jan 2018 18:58:06 +0000 (19:58 +0100)]
Indentation fix

Fixed intentaion (tabs -> spaces)
Added trailing newline

6 years agoDefocus search bar in rustdoc pages
Johannes Boczek [Tue, 2 Jan 2018 18:47:44 +0000 (19:47 +0100)]
Defocus search bar in rustdoc pages

Escape now removes focus from the search bar

6 years agoLimit style lint to non-synthetic generic params
Taylor Cramer [Tue, 2 Jan 2018 17:08:49 +0000 (09:08 -0800)]
Limit style lint to non-synthetic generic params

6 years agoCorrect for changes in line numbers in expected stderr output.
Ed Schouten [Tue, 2 Jan 2018 16:19:20 +0000 (17:19 +0100)]
Correct for changes in line numbers in expected stderr output.

Due to the disable-cloudabi tags being added to the source files, the
expected output of the compiler is altered slightly.

6 years agoAuto merge of #47105 - matthewjasper:dont-panic-for-mut-in-static, r=estebank
bors [Tue, 2 Jan 2018 15:40:20 +0000 (15:40 +0000)]
Auto merge of #47105 - matthewjasper:dont-panic-for-mut-in-static, r=estebank

Delay panic for aliasing violation for static items.

Closes #46604

6 years agoProvide a copy of stdout_isatty() on CloudABI.
Ed Schouten [Tue, 2 Jan 2018 13:22:37 +0000 (14:22 +0100)]
Provide a copy of stdout_isatty() on CloudABI.

CloudABI doesn't make any distinction between TTYs and ordinary pipes.
While there, remove the redundant implementation used by Redox. It can
use the same stub function.

6 years agoForce the creation of libs instead of dylibs on CloudABI.
Ed Schouten [Tue, 2 Jan 2018 13:18:40 +0000 (14:18 +0100)]
Force the creation of libs instead of dylibs on CloudABI.

CloudABI doesn't support the creation of dynamic libraries. Any test
making use of auxiliary libraries will fail without this change applied.

6 years agoAdd 'ignore-cloudabi' to tests that don't and won't build on CloudABI.
Ed Schouten [Tue, 2 Jan 2018 13:11:41 +0000 (14:11 +0100)]
Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI.

It looks like many of these tests are already disabled on emscripten,
which also doesn't seem to support environment variables and subprocess
spawning. Just add a similar tag for CloudABI. While there, sort some of
the lists of operating systems alphabetically.

6 years agoAuto merge of #47042 - redox-os:redox, r=estebank
bors [Tue, 2 Jan 2018 11:22:40 +0000 (11:22 +0000)]
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

6 years agoMention SliceConcatExt's stability in its docs
David Ross [Tue, 2 Jan 2018 03:14:32 +0000 (19:14 -0800)]
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.

6 years agoAuto merge of #47111 - rkruppe:repr-transparent, r=estebank
bors [Tue, 2 Jan 2018 08:34:27 +0000 (08:34 +0000)]
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.

6 years agoUse assert!(chunk_size != 0) instead of > 0 for usize value
Sebastian Dröge [Mon, 1 Jan 2018 23:57:46 +0000 (01:57 +0200)]
Use assert!(chunk_size != 0) instead of > 0 for usize value

6 years agoConsistently use chunk_size as the field name for Chunks and ChunksMut
Sebastian Dröge [Mon, 1 Jan 2018 23:46:50 +0000 (01:46 +0200)]
Consistently use chunk_size as the field name for Chunks and ChunksMut

Previously Chunks used size and ChunksMut used chunk_size

6 years agoAddress review comments: make label shorter
Esteban Küber [Tue, 2 Jan 2018 06:10:04 +0000 (22:10 -0800)]
Address review comments: make label shorter

6 years agoMove reason for move to label
Esteban Küber [Wed, 6 Sep 2017 06:36:34 +0000 (23:36 -0700)]
Move reason for move to label

6 years agoFix panic condition docs for Vec::insert.
Corey Farwell [Tue, 2 Jan 2018 03:06:59 +0000 (19:06 -0800)]
Fix panic condition docs for Vec::insert.

Fixes https://github.com/rust-lang/rust/issues/47065.

6 years agoprevent generating duplicate stubs
tinaun [Tue, 2 Jan 2018 00:32:44 +0000 (19:32 -0500)]
prevent generating duplicate stubs

6 years agoAuto merge of #47106 - EdSchouten:compiletest-cloudabi, r=alexcrichton
bors [Tue, 2 Jan 2018 00:31:07 +0000 (00:31 +0000)]
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.

6 years agoCheck all repr hints together when checking for mis-applied attributes
Robin Kruppe [Mon, 1 Jan 2018 20:42:12 +0000 (21:42 +0100)]
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.

6 years agoFix typo
Who? Me?! [Mon, 1 Jan 2018 19:17:25 +0000 (13:17 -0600)]
Fix typo

6 years agoAuto merge of #46735 - Manishearth:memchr-find, r=burntsushi
bors [Mon, 1 Jan 2018 19:04:33 +0000 (19:04 +0000)]
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

6 years agoMove the TestPaths structure from libtest to compiletest.
Ed Schouten [Mon, 1 Jan 2018 18:30:19 +0000 (19:30 +0100)]
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.

6 years agoAdd CloudABI to the list of supported targets in compiletest.
Ed Schouten [Mon, 1 Jan 2018 18:27:58 +0000 (19:27 +0100)]
Add CloudABI to the list of supported targets in compiletest.

Without this change, compiletest will fail to run when targetting
CloudABI.

6 years agoDelay panic for aliasing violation for static items.
matthewjasper [Mon, 1 Jan 2018 17:53:12 +0000 (17:53 +0000)]
Delay panic for aliasing violation for static items.

6 years agoDelay panic from incoherent drop implementation
matthewjasper [Mon, 1 Jan 2018 17:51:37 +0000 (17:51 +0000)]
Delay panic from incoherent drop implementation

6 years agoAuto merge of #46278 - MaloJaffre:ci-compiler-docs, r=kennytm
bors [Mon, 1 Jan 2018 16:22:26 +0000 (16:22 +0000)]
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.

6 years agohandle overflow/underflow in index offsets
Manish Goregaokar [Mon, 1 Jan 2018 14:25:21 +0000 (19:55 +0530)]
handle overflow/underflow in index offsets

6 years agoEnable compiler docs testing in x86_64-gnu
Malo Jaffré [Fri, 29 Dec 2017 15:07:37 +0000 (16:07 +0100)]
Enable compiler docs testing in x86_64-gnu

6 years agoFix docs for future pulldown migration
Malo Jaffré [Sun, 31 Dec 2017 16:17:01 +0000 (17:17 +0100)]
Fix docs for future pulldown migration

6 years agoIgnore remaining broken links caused by rustdoc bugs
Malo Jaffré [Fri, 29 Dec 2017 10:31:13 +0000 (11:31 +0100)]
Ignore remaining broken links caused by rustdoc bugs

As pointed out by @ollie27.

6 years agoFix broken links in internal docs
Malo Jaffré [Sun, 31 Dec 2017 16:08:04 +0000 (17:08 +0100)]
Fix broken links in internal docs

6 years agoUpdate crates and submodules to pull doc fixes
Malo Jaffré [Fri, 29 Dec 2017 10:24:38 +0000 (11:24 +0100)]
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.

6 years agoRemove a test blocking the update of the `log` crate
Malo Jaffré [Sat, 30 Dec 2017 18:58:37 +0000 (19:58 +0100)]
Remove a test blocking the update of the `log` crate

It tested #44953.
`log` macros in newer versions are no longer recursive, so these duplicated
error messages (about unstable feature uses) previously occurring at each
level of recursion are no longer possible, even with the fix by #45540.
Furthermore this test breaks when multiple versions of `log` are in the
sysroot (`log 0.3.9` depends on`log 0.4.1`)

6 years agoAuto merge of #47098 - estebank:immutable-field, r=nagisa
bors [Mon, 1 Jan 2018 12:51:54 +0000 (12:51 +0000)]
Auto merge of #47098 - estebank:immutable-field, r=nagisa

Reword trying to operate in immutable fields

The previous message ("cannot assign/mutably borrow immutable field")
when trying to modify a field of an immutable binding gave the
(incorrect) impression that fields can be mutable independently of their
ADT's binding. Slightly reword the message to read "cannot
assign/mutably borrow field of immutable binding".

Re #35937.

6 years agoAuto merge of #47095 - leodasvacas:clarify-is-import, r=jseyfried
bors [Mon, 1 Jan 2018 10:02:45 +0000 (10:02 +0000)]
Auto merge of #47095 - leodasvacas:clarify-is-import, r=jseyfried

Clarify where `is_import` is used

So it's not mistaken for dead code.

6 years agoAuto merge of #46895 - ricochet1k:macro-lifetimes, r=jseyfried
bors [Mon, 1 Jan 2018 07:21:23 +0000 (07:21 +0000)]
Auto merge of #46895 - ricochet1k:macro-lifetimes, r=jseyfried

Allow lifetimes in macros

This is a resurrection of PR #41927 which was a resurrection of #33135, which is intended to fix #34303.

In short, this allows macros_rules! to use :lifetime as a matcher to match 'lifetimes.

Still to do:
- [x]  Feature gate

6 years agomemchr: fix variable name in docstrings
Hoàng Đức Hiếu [Mon, 1 Jan 2018 07:03:49 +0000 (14:03 +0700)]
memchr: fix variable name in docstrings

6 years agoAuto merge of #47064 - kennytm:force-trailing-newlines, r=estebank
bors [Mon, 1 Jan 2018 04:09:51 +0000 (04:09 +0000)]
Auto merge of #47064 - kennytm:force-trailing-newlines, r=estebank

Add a tidy check for missing or too many trailing newlines.

I've noticed recently there are lots of review comments requesting to fix trailing newlines. If this is going to be an official style here, it's better to let the CI do this repetitive check.

6 years agoAuto merge of #47052 - fschutt:master, r=estebank
bors [Mon, 1 Jan 2018 01:00:24 +0000 (01:00 +0000)]
Auto merge of #47052 - fschutt:master, r=estebank

Improved error messages for linking failure

Partial fix for #46998

It's unnecessary to print the linker options if there is no linker installed in the first place. Currently, for libraries, the output is still printed, but that should be cleaned up in the future. If you don't have gcc or g++ installed, so that no linker is installed on the system, the output is now this:

```
$ ./rustc hello.rs
error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error
```

For libraries, the linker arguments are still printed, but they should be cleaned up in further commits.

6 years agoReword trying to operate in immutable fields
Esteban Küber [Sun, 31 Dec 2017 23:32:41 +0000 (15:32 -0800)]
Reword trying to operate in immutable fields

The previous message ("cannot assign/mutably borrow immutable field")
when trying to modify a field of an immutable binding gave the
(incorrect) impression that fields can be mutable independently of their
ADT's binding. Slightly reword the message to read "cannot
assign/mutably borrow field of immutable binding".

6 years agoAuto merge of #47089 - EdSchouten:cloudabi-is-not-unix, r=kennytm
bors [Sun, 31 Dec 2017 22:21:20 +0000 (22:21 +0000)]
Auto merge of #47089 - EdSchouten:cloudabi-is-not-unix, r=kennytm

Don't announce CloudABI as being UNIX.

This was originally brought in, because the definitions are based on
those of FreeBSD, Linux, etc. Even though CloudABI is based on POSIX, it
uses a subset that is so small that it's not reasonable to call it POSIX.

Now that I'm porting libstd, I'm running into some spots where I have to
explicitly disable code paths that were enabled by cfg(unix).

6 years agoUpdate cargo
Felix Schütt [Sun, 31 Dec 2017 14:34:29 +0000 (15:34 +0100)]
Update cargo

6 years agoRemoved unnecessary output of linker options when linker is not installed
Felix Schütt [Thu, 28 Dec 2017 19:05:33 +0000 (20:05 +0100)]
Removed unnecessary output of linker options when linker is not installed

It's unnecessary to print the linker options if there is no linker installed.
Currently, for libraries, the output is still printed, see #46998 for
discussion

6 years agoClarify where `is_import` is used.
leonardo.yvens [Sun, 31 Dec 2017 19:25:56 +0000 (17:25 -0200)]
Clarify where `is_import` is used.

So it's not mistaken for dead code.

6 years agoAuto merge of #47072 - EdSchouten:cloudabi-jemalloc, r=kennytm
bors [Sun, 31 Dec 2017 19:25:05 +0000 (19:25 +0000)]
Auto merge of #47072 - EdSchouten:cloudabi-jemalloc, r=kennytm

Add CloudABI to the list of systems on which we stub out alloc_jemalloc.

The official jemalloc sources don't build cleanly on CloudABI yet, for
the reason that some of its tracing frameworks try to access the global
filesystem namespace, which CloudABI doesn't provide.

Always make use of the malloc implementation used by the C library,
which already happens to be jemalloc with some tiny build fixes.

6 years agoAuto merge of #46713 - Manishearth:memchr, r=bluss
bors [Sun, 31 Dec 2017 16:38:10 +0000 (16:38 +0000)]
Auto merge of #46713 - Manishearth:memchr, r=bluss

Use memchr to speed up [u8]::contains 3x

None

6 years agoUse memchr for [i8]::contains as well
Manish Goregaokar [Mon, 18 Dec 2017 18:22:53 +0000 (10:22 -0800)]
Use memchr for [i8]::contains as well

6 years agoAuto merge of #47084 - zackmdavis:and_the_case_of_the_bloated_tuple_struct_indices...
bors [Sun, 31 Dec 2017 13:54:24 +0000 (13:54 +0000)]
Auto merge of #47084 - zackmdavis:and_the_case_of_the_bloated_tuple_struct_indices, r=petrochenkov

in which leading zeroes on tuple-struct accesses are abjured

Resolves #47073. If accepted, a point in the compatibility section of the release notes is warranted.

6 years agoAuto merge of #47004 - nvzqz:rc-conversions, r=bluss,kennytm
bors [Sun, 31 Dec 2017 10:36:28 +0000 (10:36 +0000)]
Auto merge of #47004 - nvzqz:rc-conversions, r=bluss,kennytm

Remove transmute in From<&str> impls for Arc/Rc

Performs conversion via raw pointer casts.

6 years agoDon't announce CloudABI as being UNIX.
Ed Schouten [Sun, 31 Dec 2017 10:14:38 +0000 (11:14 +0100)]
Don't announce CloudABI as being UNIX.

This was originally brought in, because the definitions are based on
those of FreeBSD, Linux, etc. Even though CloudABI is based on POSIX, it
uses a subset that is so small that it's not reasonable to call it POSIX.

Now that I'm porting libstd, I'm running into some spots where I have to
explicitly disable code paths that were enabled by cfg(unix).

6 years agoAuto merge of #47079 - varkor:contrib-11, r=Mark-Simulacrum
bors [Sun, 31 Dec 2017 07:29:16 +0000 (07:29 +0000)]
Auto merge of #47079 - varkor:contrib-11, r=Mark-Simulacrum

Fix doc typo for is_ascii_graphic

Fixes #47067.

6 years agoin which leading zeroes on tuple-struct accesses are abjured
Zack M. Davis [Sun, 31 Dec 2017 05:16:16 +0000 (21:16 -0800)]
in which leading zeroes on tuple-struct accesses are abjured

Resolves #47073.

6 years agoAuto merge of #47044 - topecongiro:fixed-ices, r=estebank
bors [Sun, 31 Dec 2017 04:46:26 +0000 (04:46 +0000)]
Auto merge of #47044 - topecongiro:fixed-ices, r=estebank

Add tests on fixed ICEs

Closes #29924. Closes #38857. Closes #39665. Closes #39872.
Closes #41210. Closes #41880. Closes #43483.

Note that compile-fail/E0599.rs is for #41210.

6 years agorefactor lifetime out of is_lifetime
Matt Peterson [Sun, 31 Dec 2017 02:47:45 +0000 (21:47 -0500)]
refactor lifetime out of is_lifetime

6 years agoAuto merge of #47080 - varkor:contrib-12, r=rkruppe
bors [Sun, 31 Dec 2017 00:09:18 +0000 (00:09 +0000)]
Auto merge of #47080 - varkor:contrib-12, r=rkruppe

Optimise min/max

Swapping the conditions generates more efficient x86 assembly. See
https://github.com/rust-lang/rust/pull/46926#issuecomment-354567412.

r? @rkruppe

6 years agoOptimise min/max
varkor [Sat, 30 Dec 2017 21:38:43 +0000 (21:38 +0000)]
Optimise min/max

Swapping the conditions generates more efficient x86 assembly. See
https://github.com/rust-lang/rust/pull/46926#issuecomment-354567412.

6 years agoFix doc typo for is_ascii_graphic
varkor [Sat, 30 Dec 2017 21:27:43 +0000 (21:27 +0000)]
Fix doc typo for is_ascii_graphic

Fixes #47067.

6 years agoAuto merge of #47063 - kennytm:gate-tools-on-update, r=alexcrichton
bors [Sat, 30 Dec 2017 19:38:24 +0000 (19:38 +0000)]
Auto merge of #47063 - kennytm:gate-tools-on-update, r=alexcrichton

Requires tools to test-pass if the corresponding submodule is updated.

Follow up of #46554. Breaking a tool would not stop bors from accepting a merge, but this also means when we intend to *fix* a tool but failed, bors will *still* accept the PR. This behavior is not helpful to the tool maintainers.

This PR attempts to fix this by rejecting the tool-update merge when a tool failed. It recognizes a PR as "tool-updating" when the corresponding submodule is changed, compared with the previous commit.

6 years agoAuto merge of #47076 - steveklabnik:update-books, r=frewsxcv
bors [Sat, 30 Dec 2017 17:04:27 +0000 (17:04 +0000)]
Auto merge of #47076 - steveklabnik:update-books, r=frewsxcv

update books for next release

6 years agoupdate books for next release
steveklabnik [Sat, 30 Dec 2017 14:36:15 +0000 (09:36 -0500)]
update books for next release

6 years agoAdd tests on fixed ICEs
Seiichi Uchida [Tue, 26 Dec 2017 13:11:18 +0000 (22:11 +0900)]
Add tests on fixed ICEs

Closes #29924. Closes #38857. Closes #39665. Closes #39872.
Closes #39553. Closes #41210. Closes #41880. Closes #43483.

6 years agoRequires tools to test-pass if the corresponding submodule is updated.
kennytm [Fri, 29 Dec 2017 16:05:15 +0000 (00:05 +0800)]
Requires tools to test-pass if the corresponding submodule is updated.

If a PR intends to update a tool but its test has failed, abort the merge
regardless of current channel. This should help the tool maintainers if the
update turns out to be failing due to changes in latest master.

6 years agoAdd CloudABI to the list of systems on which we stub out alloc_jemalloc.
Ed Schouten [Sat, 30 Dec 2017 09:00:35 +0000 (10:00 +0100)]
Add CloudABI to the list of systems on which we stub out alloc_jemalloc.

The official jemalloc sources don't build cleanly on CloudABI yet, for
the reason that some of its tracing frameworks try to access the global
filesystem namespace, which CloudABI doesn't provide.

Always make use of the malloc implementation used by the C library,
which already happens to be jemalloc with some tiny build fixes.

6 years agoAdd a tidy check to ensure all files have 1 or 2 trailing newlines.
kennytm [Sat, 30 Dec 2017 07:47:00 +0000 (15:47 +0800)]
Add a tidy check to ensure all files have 1 or 2 trailing newlines.

6 years agoRemove excessive trailing newlines.
kennytm [Sat, 30 Dec 2017 07:50:33 +0000 (15:50 +0800)]
Remove excessive trailing newlines.

6 years agoAdd trailing newlines to files which have no trailing newlines.
kennytm [Fri, 29 Dec 2017 18:25:40 +0000 (02:25 +0800)]
Add trailing newlines to files which have no trailing newlines.

6 years agoAuto merge of #47026 - EdSchouten:cloudabi-unwind, r=kennytm
bors [Fri, 29 Dec 2017 23:07:42 +0000 (23:07 +0000)]
Auto merge of #47026 - EdSchouten:cloudabi-unwind, r=kennytm

Link against -lunwind on CloudABI.

CloudABI makes use of LLVM's libunwind to do stack unwinding. It is
installed under the name libunwind.a.

6 years agoAuto merge of #46327 - Aaronepower:master, r=alexcrichton
bors [Fri, 29 Dec 2017 20:23:02 +0000 (20:23 +0000)]
Auto merge of #46327 - Aaronepower:master, r=alexcrichton

Updated RELEASES.md for 1.23.0

[Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

6 years agoAuto merge of #47049 - eddyb:submodules, r=alexcrichton
bors [Fri, 29 Dec 2017 17:32:17 +0000 (17:32 +0000)]
Auto merge of #47049 - eddyb:submodules, r=alexcrichton

Always name git submodules by their paths.

Two submodules didn't follow the convention and they kept breaking rebases in GitKraken.

r? @alexcrichton

6 years agoAuto merge of #47051 - Xanewok:update-rls, r=kennytm
bors [Fri, 29 Dec 2017 14:02:32 +0000 (14:02 +0000)]
Auto merge of #47051 - Xanewok:update-rls, r=kennytm

Update RLS and Rustfmt

Essentially https://github.com/rust-lang/rust/pull/46929 with only RLS update that fixes the build.

The rls wasn't included in the recent nightlies and a lot of people have been wondering what to do about it, so it'd be good to include the RLS back with the nightly builds as soon as we can.

r? @alexcrichton

6 years agoUpdate rustfmt to 0.3.4
Igor Matuszewski [Fri, 29 Dec 2017 09:12:30 +0000 (10:12 +0100)]
Update rustfmt to 0.3.4