]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoincr.comp.: Track expanded spans instead of FileMaps.
Michael Woerister [Tue, 23 May 2017 14:21:24 +0000 (16:21 +0200)]
incr.comp.: Track expanded spans instead of FileMaps.

7 years agoAuto merge of #42023 - nikomatsakis:issue-36799-ostn15_phf, r=arielb1
bors [Tue, 23 May 2017 09:55:40 +0000 (09:55 +0000)]
Auto merge of #42023 - nikomatsakis:issue-36799-ostn15_phf, r=arielb1

introduce local-scope to prevent `StorageLive`/`StorageDead` in statics

In investigating #36799, I found that we were creating storage-live/storage-dead instructions in statics/constants, where they are not needed. This arose due to the fix for local scopes. This PR tries to fix that (and adds a test -- I'm curious if there is a way to make that test more targeted, though).

r? @arielb1

7 years agoAuto merge of #42015 - nikomatsakis:chalk-trait-env-2, r=eddyb
bors [Tue, 23 May 2017 07:14:42 +0000 (07:14 +0000)]
Auto merge of #42015 - nikomatsakis:chalk-trait-env-2, r=eddyb

remove interior mutability of type-flags

We were previously using the flags on `Ty<'tcx>` instances to do some ad-hoc caching schemes around things like `is_sized()`, `is_freeze()`, and `moves_by_default()`. This PR replaces those schemes with a proper query; the query key is based on the pair of a `(ParameterEnvironment<'tcx>, Ty<'tcx>)` pair. This is also intended to be a preliminary template for what trait-selection and projection will eventually look like.

I did some performance measurements. In the past, I observed a noticeable speedup (6%) for building rustc, but since I've rebased, the numbers appear to be more of a wash:

| Crate | Before | After | Percentage |
| --- | --- | --- | -- |
| syntax | 167s | 166s | 0.6% faster |
| rustc | 376s | 382s | 1.5% slower |

Some advantages of this new scheme:

- `is_sized` etc are proper queries
- we get caching across generic fns, so long as trait environment is identical
- dependency tracking is correct

7 years agoAuto merge of #42165 - frewsxcv:rollup, r=frewsxcv
bors [Tue, 23 May 2017 04:48:15 +0000 (04:48 +0000)]
Auto merge of #42165 - frewsxcv:rollup, r=frewsxcv

Rollup of 8 pull requests

- Successful merges: #42016, #42122, #42144, #42145, #42151, #42152, #42160, #42163
- Failed merges:

7 years agoRollup merge of #42163 - projektir:option_links, r=frewsxcv
Corey Farwell [Tue, 23 May 2017 04:15:48 +0000 (00:15 -0400)]
Rollup merge of #42163 - projektir:option_links, r=frewsxcv

Adding links to option::Option

Just adding some links.

7 years agoRollup merge of #42160 - venkatagiri:issue_38821, r=Mark-Simulacrum
Corey Farwell [Tue, 23 May 2017 04:15:47 +0000 (00:15 -0400)]
Rollup merge of #42160 - venkatagiri:issue_38821, r=Mark-Simulacrum

regression test for #38821

Closes #38821

r? @Mark-Simulacrum

7 years agoRollup merge of #42152 - GuillaumeGomez:cstr-docs, r=frewsxcv
Corey Farwell [Tue, 23 May 2017 04:15:46 +0000 (00:15 -0400)]
Rollup merge of #42152 - GuillaumeGomez:cstr-docs, r=frewsxcv

Add missing links for CStr and CString

r? @rust-lang/docs

7 years agoRollup merge of #42151 - Wallacoloo:docfix_into_vec, r=frewsxcv
Corey Farwell [Tue, 23 May 2017 04:15:45 +0000 (00:15 -0400)]
Rollup merge of #42151 - Wallacoloo:docfix_into_vec, r=frewsxcv

Mention Vec::into_boxed_slice in documentation of [T]::into_vec

This is a documentation fix.

`Vec::into_boxed_slice` and `[T]::into_vec` are inverses, so it makes sense to mention the other in their respective documentation for visibility. `Vec::into_boxed_slice` already mentions `[T]::into_vec`, but not the other way around until now.

Tagging @steveklabnik per his request.

7 years agoRollup merge of #42145 - ollie27:rustdoc_inline_renamed, r=steveklabnik
Corey Farwell [Tue, 23 May 2017 04:15:44 +0000 (00:15 -0400)]
Rollup merge of #42145 - ollie27:rustdoc_inline_renamed, r=steveklabnik

rustdoc: Fix names of items in cross crate reexported modules

For renamed reexports the new name should be used.

An example of this (as pointed out in https://github.com/rust-lang/rust/issues/27741#issuecomment-302850721) is two instances of `StepBy` in [`std::iter`](https://doc.rust-lang.org/nightly/std/iter/index.html#structs). [`core::iter`](https://doc.rust-lang.org/nightly/core/iter/index.html#structs) is correct.

Fixes #37608

7 years agoRollup merge of #42144 - cengizIO:master, r=nikomatsakis
Corey Farwell [Tue, 23 May 2017 04:15:43 +0000 (00:15 -0400)]
Rollup merge of #42144 - cengizIO:master, r=nikomatsakis

make ui test output patch compatible #41948

Hello!

Previously with #41474 I've changed the internals of UI test output comparison mechanism.

That change didn't change the diff format that we were producing but we needed to improve it anyway.

This makes unified diff lines a little bit more `patch` compatible.

Also I tried to introduce a unit test to check this but couldn't decide which of the following to implement:

1. Should I replace `println` macros with `Writer`s? And access the produced output within a test?
2. Should I add an external test (something like `src/test/run-pass/command-exec.rs`)
3. There are crates that capture `stdout`. Are they safe to use here? (I don't think so)

Thanks!

cc @nikomatsakis

7 years agoRollup merge of #42122 - rust-lang:frewsxcv/unstable-book, r=steveklabnik
Corey Farwell [Tue, 23 May 2017 04:15:42 +0000 (00:15 -0400)]
Rollup merge of #42122 - rust-lang:frewsxcv/unstable-book, r=steveklabnik

Add a few entries to the Unstable Book.

7 years agoRollup merge of #42016 - pietroalbini:stabilize/loop_break_value, r=nikomatsakis
Corey Farwell [Tue, 23 May 2017 04:15:41 +0000 (00:15 -0400)]
Rollup merge of #42016 - pietroalbini:stabilize/loop_break_value, r=nikomatsakis

Stabilize the loop_break_value feature

Tracking issue: #37339.

Documentation PRs already sent to the various repositories.

7 years agoAdding links to option::Option
projektir [Tue, 23 May 2017 01:59:42 +0000 (21:59 -0400)]
Adding links to option::Option

7 years agoAuto merge of #41559 - GuillaumeGomez:partial-eq-msg, r=estebank
bors [Tue, 23 May 2017 00:36:56 +0000 (00:36 +0000)]
Auto merge of #41559 - GuillaumeGomez:partial-eq-msg, r=estebank

Add better error message when == operator is badly used

Part of #40660.

With the following code:

```rust
fn foo<T: PartialEq>(a: &T, b: T) {
    a == b;
}

fn main() {
    foo(&1, 1);
}
```

It prints:

```
error[E0277]: the trait bound `&T: std::cmp::PartialEq<T>` is not satisfied
 --> test.rs:2:5
  |
2 |     a == b;
  |     ^^^^^^ can't compare `&T` with `T`
  |
  = help: the trait `std::cmp::PartialEq<T>` is not implemented for `&T`
  = help: consider adding a `where &T: std::cmp::PartialEq<T>` bound

error: aborting due to previous error
```

7 years agoSlice::into_vec: Don't link to Vec::into_boxed_slice
Colin Wallace [Mon, 22 May 2017 23:39:31 +0000 (16:39 -0700)]
Slice::into_vec: Don't link to Vec::into_boxed_slice

The documentation for this method appears on multiple different pages,
which causes the relative links to not always work.

7 years agoregression test for #38821
Venkata Giri Reddy [Mon, 22 May 2017 23:09:18 +0000 (17:09 -0600)]
regression test for #38821

Closes #38821

r? @Mark-Simulacrum

7 years agoAdd missing links for CStr and CString
Guillaume Gomez [Mon, 22 May 2017 14:55:00 +0000 (16:55 +0200)]
Add missing links for CStr and CString

7 years agofix `atomic_lock_free` test case
Niko Matsakis [Tue, 16 May 2017 12:43:23 +0000 (08:43 -0400)]
fix `atomic_lock_free` test case

7 years agofix DepNode
Niko Matsakis [Tue, 16 May 2017 03:23:40 +0000 (23:23 -0400)]
fix DepNode

Ideally, we'd have the `Ty` inserted directly in the dep-node, but since
we can't do that yet, we extract the characteristic def-id of the type
in question.

7 years agotwo more style nits
Niko Matsakis [Mon, 15 May 2017 23:36:45 +0000 (19:36 -0400)]
two more style nits

7 years agorename `parameter_environment` to `param_env`
Niko Matsakis [Mon, 15 May 2017 22:00:35 +0000 (18:00 -0400)]
rename `parameter_environment` to `param_env`

7 years agouse `ParamEnv` from `ty` rather than importing
Niko Matsakis [Mon, 15 May 2017 21:58:58 +0000 (17:58 -0400)]
use `ParamEnv` from `ty` rather than importing

7 years agorename `ParameterEnvironment` to `ParamEnv`
Niko Matsakis [Mon, 15 May 2017 21:57:30 +0000 (17:57 -0400)]
rename `ParameterEnvironment` to `ParamEnv`

7 years agokill NEEDS_DROP_CACHED
Niko Matsakis [Fri, 12 May 2017 16:04:27 +0000 (12:04 -0400)]
kill NEEDS_DROP_CACHED

7 years agokill FREEZENESS_CACHED
Niko Matsakis [Fri, 12 May 2017 16:04:07 +0000 (12:04 -0400)]
kill FREEZENESS_CACHED

7 years agokill SIZEDNESS_CACHED
Niko Matsakis [Fri, 12 May 2017 16:03:43 +0000 (12:03 -0400)]
kill SIZEDNESS_CACHED

7 years agoremove the cell from type flags completely
Niko Matsakis [Fri, 12 May 2017 16:01:43 +0000 (12:01 -0400)]
remove the cell from type flags completely

7 years agomove `needs_drop` into a query
Niko Matsakis [Fri, 12 May 2017 15:44:31 +0000 (11:44 -0400)]
move `needs_drop` into a query

7 years agorefactor common logic into `ParameterEnvironment::and()`
Niko Matsakis [Fri, 12 May 2017 15:44:00 +0000 (11:44 -0400)]
refactor common logic into `ParameterEnvironment::and()`

7 years agomake parameter-environment a query
Niko Matsakis [Thu, 11 May 2017 21:40:03 +0000 (17:40 -0400)]
make parameter-environment a query

7 years agocentralize the caching for is-copy, is-sized, and is-freeze
Niko Matsakis [Wed, 10 May 2017 14:28:06 +0000 (10:28 -0400)]
centralize the caching for is-copy, is-sized, and is-freeze

Use the trait-environment+type as the key. Note that these
are only invoked on types that live for the entire compilation
(no inference artifacts). We no longer need the various special-case
bits and caches that were in place before.

7 years agoadd arielb1 example
Niko Matsakis [Mon, 22 May 2017 18:40:47 +0000 (14:40 -0400)]
add arielb1 example

7 years agoMention Vec::into_boxed_slice in docs for [T]::into_vec.
Colin Wallace [Mon, 22 May 2017 12:23:47 +0000 (05:23 -0700)]
Mention Vec::into_boxed_slice in docs for [T]::into_vec.

`Vec::into_boxed_slice` and `[T]::into_vec` are inverses, so it makes sense
to mention the other in their respective documentation for visibility.
`Vec::into_boxed_slice` already mentions `[T]::into_vec`, but not the other
way around until now.

7 years agoAuto merge of #42147 - withoutboats:run-pass-test-for-static-in-assoc-const-ty-refs...
bors [Mon, 22 May 2017 06:22:52 +0000 (06:22 +0000)]
Auto merge of #42147 - withoutboats:run-pass-test-for-static-in-assoc-const-ty-refs, r=eddyb

Remove 'static bound in assoc const test.

Types do not have to be `'static` to be referenced in
associated consts.

Fixes #33573.

7 years agoRemove 'static bound in assoc const test.
Without Boats [Mon, 22 May 2017 06:10:01 +0000 (23:10 -0700)]
Remove 'static bound in assoc const test.

Types do not have to be `'static` to be referenced in
associated consts.

7 years agorustdoc: Fix names of items in cross crate reexported modules
Oliver Middleton [Mon, 22 May 2017 01:05:16 +0000 (02:05 +0100)]
rustdoc: Fix names of items in cross crate reexported modules

For renamed reexports the new name should be used.

7 years agoAuto merge of #42140 - anderspapitto:doc-typo-fixes, r=Mark-Simulacrum
bors [Mon, 22 May 2017 00:51:17 +0000 (00:51 +0000)]
Auto merge of #42140 - anderspapitto:doc-typo-fixes, r=Mark-Simulacrum

bootstrap: fix minor comment typos in lib.rs

I noticed these while reading through the build system
documentation. They're hardly worth fixing, but I'm also using this to
get my feet wet with the rustc contribution system.

7 years agomake ui test output patch compatible #41948
Cengiz Can [Sun, 21 May 2017 22:34:36 +0000 (01:34 +0300)]
make ui test output patch compatible #41948

7 years agoAuto merge of #41904 - sfackler:1.18-stabilization, r=alexcrichton
bors [Sun, 21 May 2017 22:06:08 +0000 (22:06 +0000)]
Auto merge of #41904 - sfackler:1.18-stabilization, r=alexcrichton

Stabilize library features for 1.18.0

Closes #38863
Closes #38980
Closes #38903
Closes #36648

r? @alexcrichton

@rust-lang/libs

7 years agobootstrap: fix minor comment typos in lib.rs
Anders Papitto [Thu, 18 May 2017 18:59:54 +0000 (19:59 +0100)]
bootstrap: fix minor comment typos in lib.rs

I noticed these while reading through the build system
documentation. They're hardly worth fixing, but I'm also using this to
get my feet wet with the rustc contribution system.

7 years agoAuto merge of #42131 - neosilky:doc-fix, r=frewsxcv
bors [Sun, 21 May 2017 08:28:05 +0000 (08:28 +0000)]
Auto merge of #42131 - neosilky:doc-fix, r=frewsxcv

Update to trait bounds CSS in rustdoc

Fixed re-submission of #40719.

7 years agoAuto merge of #42132 - cuviper:manifest-paths, r=alexcrichton
bors [Sun, 21 May 2017 06:00:22 +0000 (06:00 +0000)]
Auto merge of #42132 - cuviper:manifest-paths, r=alexcrichton

Update rust-installer to normalize manifest paths

This fixes the backslash-paths found in the manifests of installers that are built on Windows.  This is the most problematic part of #42121, leaving just the non-executable install.sh.

r? @alexcrichton

7 years agoStabilize library features for 1.18.0
Steven Fackler [Thu, 11 May 2017 04:17:24 +0000 (21:17 -0700)]
Stabilize library features for 1.18.0

Closes #38863
Closes #38980
Closes #38903
Closes #36648

7 years agoUpdate rust-installer to normalize manifest paths
Josh Stone [Sun, 21 May 2017 04:55:18 +0000 (21:55 -0700)]
Update rust-installer to normalize manifest paths

7 years agoUpdate to trait bounds CSS in rustdoc
Daniel Lockyer [Sun, 21 May 2017 03:35:26 +0000 (04:35 +0100)]
Update to trait bounds CSS in rustdoc

Fixed resubmission of #40719.

7 years agoAuto merge of #42130 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Sun, 21 May 2017 01:53:20 +0000 (01:53 +0000)]
Auto merge of #42130 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 6 pull requests

- Successful merges: #41892, #42062, #42091, #42093, #42098, #42127
- Failed merges:

7 years agoRollup merge of #42127 - clarcharr:lifetimes, r=Mark-Simulacrum
Mark Simulacrum [Sat, 20 May 2017 23:48:16 +0000 (17:48 -0600)]
Rollup merge of #42127 - clarcharr:lifetimes, r=Mark-Simulacrum

Remove unused lifetimes.

This was a typo that made it onto master. Noted by @dtolnay in #42127.

Also note #41960 which suggests warning these.

7 years agoRollup merge of #42098 - japaric:gh42097, r=Mark-Simulacrum
Mark Simulacrum [Sat, 20 May 2017 23:48:15 +0000 (17:48 -0600)]
Rollup merge of #42098 - japaric:gh42097, r=Mark-Simulacrum

core: fix unused_macro warning

when compiling the crate for a target with max-atomic-width = 0

fixes #42097

7 years agoRollup merge of #42093 - llogiq:clippy-librustc_errors, r=arielb1
Mark Simulacrum [Sat, 20 May 2017 23:48:14 +0000 (17:48 -0600)]
Rollup merge of #42093 - llogiq:clippy-librustc_errors, r=arielb1

fix some clippy warnings in librustc_errors

Again, those are small changes to improve readability.

7 years agoRollup merge of #42091 - maccoda:maccoda/env_docs, r=frewsxcv
Mark Simulacrum [Sat, 20 May 2017 23:48:13 +0000 (17:48 -0600)]
Rollup merge of #42091 - maccoda:maccoda/env_docs, r=frewsxcv

Improving std::env docs

Addresses #29351.
Hopefully this addresses the following points:
> -  iterators should use the standard iterator boilerplate like https://doc.rust-lang.org/std/iter/struct.Map.html, this applies to all structs except for JoinPathsError
> -  JoinPathsError should properly link the function it comes from and use language similar to https://doc.rust-lang.org/std/io/struct.Error.html
> -  same wording issues with VarError
> - functions need to ensure linkage to things they refer to in their descriptions
> - Explain the difference between `os` and non-`os` structs and methods

7 years agoRollup merge of #42062 - fhartwig:fix-off-by-one-span, r=nikomatsakis
Mark Simulacrum [Sat, 20 May 2017 23:48:12 +0000 (17:48 -0600)]
Rollup merge of #42062 - fhartwig:fix-off-by-one-span, r=nikomatsakis

Fix off-by-one error in column number in `explain_span`.

Fixes #41938

7 years agoRollup merge of #41892 - Gankro:needs_drop, r=alexcrichton
Mark Simulacrum [Sat, 20 May 2017 23:48:11 +0000 (17:48 -0600)]
Rollup merge of #41892 - Gankro:needs_drop, r=alexcrichton

expose needs_drop under mem

Note that I purposefully didn't update the intrinsic's documentation, because I think it makes sense for it be more... "honest" about its semantics.

7 years agoAdd stub entry to unstable book for needs_drop
Alexis Beingessner [Thu, 11 May 2017 14:15:56 +0000 (10:15 -0400)]
Add stub entry to unstable book for needs_drop

7 years agomigrate everything to using mem::needs_drop
Alexis Beingessner [Wed, 10 May 2017 17:13:42 +0000 (13:13 -0400)]
migrate everything to using mem::needs_drop

7 years agoAuto merge of #42124 - Keruspe:installer, r=alexcrichton
bors [Sat, 20 May 2017 23:27:07 +0000 (23:27 +0000)]
Auto merge of #42124 - Keruspe:installer, r=alexcrichton

update rust-installer

This fixes the default value for sysconfdir

Closes https://github.com/rust-lang/rust/issues/42102
Closes https://github.com/rust-lang/cargo/issues/4070

7 years agoexpose needs_drop under mem::
Alexis Beingessner [Wed, 10 May 2017 16:48:36 +0000 (12:48 -0400)]
expose needs_drop under mem::

7 years agoAuto merge of #42069 - QuietMisdreavus:low_pri, r=alexchrichton
bors [Sat, 20 May 2017 20:55:52 +0000 (20:55 +0000)]
Auto merge of #42069 - QuietMisdreavus:low_pri, r=alexchrichton

Add an option to run rustbuild on low priority on Windows and Unix

This is a resurrection of #40776, combining their Windows setup with an additional setup on Unix to set the program group's *nice*ness to +10 (low-but-not-lowest priority, mirroring the priority in the Windows setup) when the `low_priority` option is on.

7 years agoRemove unused lifetimes.
Clar Charr [Sat, 20 May 2017 19:32:11 +0000 (15:32 -0400)]
Remove unused lifetimes.

7 years agoAuto merge of #42123 - Mark-Simulacrum:revert-41967, r=alexcrichton
bors [Sat, 20 May 2017 18:26:53 +0000 (18:26 +0000)]
Auto merge of #42123 - Mark-Simulacrum:revert-41967, r=alexcrichton

Revert "Reenable opt-level 3"

This reverts commit 30383b2384864173b9238a121f8e83f8968f1e51, from #41967.

We believe that this is causing the failures when compiling rustc on 64 bit (which are probably segfaults).

cc @ishitatsuyuki

7 years agoupdate rust-installer
Marc-Antoine Perennou [Sat, 20 May 2017 16:52:49 +0000 (18:52 +0200)]
update rust-installer

This fixes the default value for sysconfdir

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
7 years agoRevert "Reenable opt-level 3"
Mark Simulacrum [Sat, 20 May 2017 16:33:53 +0000 (10:33 -0600)]
Revert "Reenable opt-level 3"

This reverts commit 30383b2384864173b9238a121f8e83f8968f1e51.

7 years agoAdd basic Unstable Book entry for `attr_literals`.
Corey Farwell [Sat, 20 May 2017 16:08:28 +0000 (12:08 -0400)]
Add basic Unstable Book entry for `attr_literals`.

7 years agoAdd basic Unstable Book entry for `catch_expr`.
Corey Farwell [Sat, 20 May 2017 15:47:51 +0000 (11:47 -0400)]
Add basic Unstable Book entry for `catch_expr`.

7 years agoAuto merge of #42111 - ollie27:stab, r=Mark-Simulacrum
bors [Sat, 20 May 2017 15:42:43 +0000 (15:42 +0000)]
Auto merge of #42111 - ollie27:stab, r=Mark-Simulacrum

Correct some stability versions

These were found by running tidy on stable versions of rust and finding
features stabilised with the wrong version numbers.

7 years agoAdd basic Unstable Book entry for `on_unimplemented`.
Corey Farwell [Sat, 20 May 2017 13:38:45 +0000 (09:38 -0400)]
Add basic Unstable Book entry for `on_unimplemented`.

7 years agoAuto merge of #42113 - segevfiner:fix-ole32-warning, r=petrochenkov
bors [Sat, 20 May 2017 12:05:33 +0000 (12:05 +0000)]
Auto merge of #42113 - segevfiner:fix-ole32-warning, r=petrochenkov

Fix: "warning: redundant linker flag specified for library `ole32`"

llvm-config seems to output this library name correctly now, removing
the need for the hack in "librustc_llvm/build.rs".

7 years agoFix: "warning: redundant linker flag specified for library `ole32`"
Segev Finer [Sat, 20 May 2017 10:57:41 +0000 (13:57 +0300)]
Fix: "warning: redundant linker flag specified for library `ole32`"

llvm-config seems to output this library name correctly now, removing
the need for the hack in "librustc_llvm/build.rs".

7 years agoCorrect some stability versions
Oliver Middleton [Sat, 20 May 2017 07:38:39 +0000 (08:38 +0100)]
Correct some stability versions

These were found by running tidy on stable versions of rust and finding
features stabilised with the wrong version numbers.

7 years agoAuto merge of #41967 - ishitatsuyuki:patch-1, r=alexcrichton
bors [Sat, 20 May 2017 02:13:26 +0000 (02:13 +0000)]
Auto merge of #41967 - ishitatsuyuki:patch-1, r=alexcrichton

Reenable opt-level 3

This comment is quite old, let's see what would happen with current MSVC.

Since there's no AppVeyor test for PR, the best way is to try if it get through homu. I don't recommend doing this in roll-up.

7 years agoMerge branch 'master' into maccoda/env_docs
Dylan Maccora [Fri, 19 May 2017 23:42:37 +0000 (09:42 +1000)]
Merge branch 'master' into maccoda/env_docs

7 years agoAuto merge of #41772 - GuillaumeGomez:fn-once-message, r=estebank
bors [Fri, 19 May 2017 23:38:49 +0000 (23:38 +0000)]
Auto merge of #41772 - GuillaumeGomez:fn-once-message, r=estebank

Add help message if a FnOnce is moved

Fixes #40855.

r? @eddyb

7 years agoFixed link issue.
Dylan Maccora [Fri, 19 May 2017 22:32:10 +0000 (08:32 +1000)]
Fixed link issue.

7 years agoAuto merge of #42105 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Fri, 19 May 2017 20:41:18 +0000 (20:41 +0000)]
Auto merge of #42105 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 17 pull requests

- Successful merges: #41870, #41910, #41958, #41971, #42006, #42024, #42037, #42056, #42067, #42070, #42079, #42080, #42082, #42089, #42092, #42096, #42100
- Failed merges:

7 years agoRollup merge of #42100 - michaelwoerister:fix-osx-multi-cgu-debuginfo, r=jdm
Mark Simulacrum [Fri, 19 May 2017 20:16:26 +0000 (14:16 -0600)]
Rollup merge of #42100 - michaelwoerister:fix-osx-multi-cgu-debuginfo, r=jdm

debuginfo: Generate unique DW_AT_names for compilation units to work around OSX linker bug

This should fix issue #39160 and does not seem to cause any problems.

cc @tromey, @Manishearth

r? @jdm

7 years agoRollup merge of #42096 - ollie27:rustdoc_js_impls, r=GuillaumeGomez
Mark Simulacrum [Fri, 19 May 2017 20:16:25 +0000 (14:16 -0600)]
Rollup merge of #42096 - ollie27:rustdoc_js_impls, r=GuillaumeGomez

rustdoc: Fix implementors list javascript

* Use a different loop variable, `i` was already taken. This caused
missing items in the implementors list.
* Use `.getAttribute('href')` rather than `.href` to get the relative
URL which is what it needs to actually fix the links.

More fallout from #41307.

r? @GuillaumeGomez

7 years agoRollup merge of #42092 - cuviper:args_os, r=Mark-Simulacrum
Mark Simulacrum [Fri, 19 May 2017 20:16:24 +0000 (14:16 -0600)]
Rollup merge of #42092 - cuviper:args_os, r=Mark-Simulacrum

Give a nicer error for non-Unicode arguments to rustc and rustdoc

Previously, any non-Unicode argument would panic rustc:

```
$ rustc $'foo\x80bar'
error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report:
https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value:
"foo�bar"', /checkout/src/libcore/result.rs:859 note: Run with
`RUST_BACKTRACE=1` for a backtrace.
```

Now it gives a clean error:

```
$ rustc $'foo\x80bar'
error: Argument 1 is not valid Unicode: "foo�bar"
```

Maybe fixes #15890, although we still can't *compile* arbitrary file names.

7 years agoRollup merge of #42089 - nagisa:xpy-broke-on-py3-again⁈, r=alexcrichton
Mark Simulacrum [Fri, 19 May 2017 20:16:24 +0000 (14:16 -0600)]
Rollup merge of #42089 - nagisa:xpy-broke-on-py3-again⁈, r=alexcrichton

Fix x.py

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

7 years agoRollup merge of #42082 - michaelwoerister:wider_def_path_hashes, r=eddyb
Mark Simulacrum [Fri, 19 May 2017 20:16:23 +0000 (14:16 -0600)]
Rollup merge of #42082 - michaelwoerister:wider_def_path_hashes, r=eddyb

incr. comp.: Use more bits for DefPath hashes

Use 128 instead of 64 bits for DefPath hashes, like we do for everything else. Collision probability is unnecessarily high with 64 bits.

Also change the representation of `ich::Fingerprint` from `Fingerprint([u8; 16])` to `Fingerprint(u64, u64)` which is better for hashers like `FxHasher`.

7 years agoRollup merge of #42080 - pravic:jquery-removal-fix, r=frewsxcv
Mark Simulacrum [Fri, 19 May 2017 20:16:22 +0000 (14:16 -0600)]
Rollup merge of #42080 - pravic:jquery-removal-fix, r=frewsxcv

Fix regression introduced by jQuery removal

Fixes #42078.
Follows #41307.

r? @steveklabnik
cc @frewsxcv

7 years agoRollup merge of #42079 - seeekr:patch-1, r=steveklabnik
Mark Simulacrum [Fri, 19 May 2017 20:16:21 +0000 (14:16 -0600)]
Rollup merge of #42079 - seeekr:patch-1, r=steveklabnik

fix typo in libstd/sync/mpsc/mod.rs docs

7 years agoRollup merge of #42070 - tshepang:env-misc, r=BurntSushi
Mark Simulacrum [Fri, 19 May 2017 20:16:20 +0000 (14:16 -0600)]
Rollup merge of #42070 - tshepang:env-misc, r=BurntSushi

misc doc improvements for std::env

7 years agoRollup merge of #42067 - Keruspe:master, r=alexcrichton
Mark Simulacrum [Fri, 19 May 2017 20:16:19 +0000 (14:16 -0600)]
Rollup merge of #42067 - Keruspe:master, r=alexcrichton

rustbuild: install improvements

Install rust-analysis and rust-src to get in par with what we can get from rustup.
Allow bypassing the vendoring of dependencies. When we only build to install and not to redistribute dist tarballs, that part is not necessary, so avoid trying to install cargo-vendor.

7 years agoRollup merge of #42056 - sylvestre:master, r=alexcrichton
Mark Simulacrum [Fri, 19 May 2017 20:16:18 +0000 (14:16 -0600)]
Rollup merge of #42056 - sylvestre:master, r=alexcrichton

Improve the error management when /proc is not mounted

This PR does two things:
* Triggers an error on GNU/Linux & Android when /proc/self/exe doesn't exist
* Handle the error properly

7 years agoRollup merge of #42037 - nagisa:charpat, r=sfackler
Mark Simulacrum [Fri, 19 May 2017 20:16:17 +0000 (14:16 -0600)]
Rollup merge of #42037 - nagisa:charpat, r=sfackler

Minor optimisation of the string operations

The interesting benchmarks are

<table cellspacing="0" border="0">
<tr>
<th height="17" align="right"><b> (&lt;100% → better than original )</b></th>
<th align="left" sdnum="2057;0;0.00%">Delta</th>
<th align="left">Original ns/i</th>
<th align="left">This Patch ns/i</th>
</tr>
<tr>
<td height="17" align="left">str::contains_bang_char::long_lorem_ipsum</td>
<td align="right" sdval="0.249775381850854" sdnum="2057;0;0.00%">24.98%</td>
<td align="right" sdval="5565" sdnum="2057;">5565</td>
<td align="right" sdval="1390" sdnum="2057;">1390</td>
</tr>
<tr>
<td height="17" align="left">str::contains_bang_char::short_ascii</td>
<td align="right" sdval="0.277777777777778" sdnum="2057;0;0.00%">27.78%</td>
<td align="right" sdval="144" sdnum="2057;">144</td>
<td align="right" sdval="40" sdnum="2057;">40</td>
</tr>
<tr>
<td height="17" align="left">str::contains_bang_char::short_mixed</td>
<td align="right" sdval="0.333333333333333" sdnum="2057;0;0.00%">33.33%</td>
<td align="right" sdval="120" sdnum="2057;">120</td>
<td align="right" sdval="40" sdnum="2057;">40</td>
</tr>
<tr>
<td height="17" align="left">str::contains_bang_char::short_pile_of_poo</td>
<td align="right" sdval="0.594202898550725" sdnum="2057;0;0.00%">59.42%</td>
<td align="right" sdval="69" sdnum="2057;">69</td>
<td align="right" sdval="41" sdnum="2057;">41</td>
</tr>
<tr>
<td height="17" align="left">str::ends_with_ascii_char::long_lorem_ipsum</td>
<td align="right" sdval="0.452629649990837" sdnum="2057;0;0.00%">45.26%</td>
<td align="right" sdval="5457" sdnum="2057;">5457</td>
<td align="right" sdval="2470" sdnum="2057;">2470</td>
</tr>
<tr>
<td height="17" align="left">str::ends_with_ascii_char::short_ascii</td>
<td align="right" sdval="0.450054684651841" sdnum="2057;0;0.00%">45.01%</td>
<td align="right" sdval="5486" sdnum="2057;">5486</td>
<td align="right" sdval="2469" sdnum="2057;">2469</td>
</tr>
<tr>
<td height="17" align="left">str::ends_with_ascii_char::short_mixed</td>
<td align="right" sdval="0.463132795304475" sdnum="2057;0;0.00%">46.31%</td>
<td align="right" sdval="5452" sdnum="2057;">5452</td>
<td align="right" sdval="2525" sdnum="2057;">2525</td>
</tr>
<tr>
<td height="17" align="left">str::ends_with_ascii_char::short_pile_of_poo</td>
<td align="right" sdval="0.453426419254088" sdnum="2057;0;0.00%">45.34%</td>
<td align="right" sdval="5443" sdnum="2057;">5443</td>
<td align="right" sdval="2468" sdnum="2057;">2468</td>
</tr>
<tr>
<td height="17" align="left">str::ends_with_unichar::long_lorem_ipsum</td>
<td align="right" sdval="0.459385290889133" sdnum="2057;0;0.00%">45.94%</td>
<td align="right" sdval="5466" sdnum="2057;">5466</td>
<td align="right" sdval="2511" sdnum="2057;">2511</td>
</tr>
<tr>
<td height="17" align="left">str::ends_with_unichar::short_ascii</td>
<td align="right" sdval="0.460593841642229" sdnum="2057;0;0.00%">46.06%</td>
<td align="right" sdval="5456" sdnum="2057;">5456</td>
<td align="right" sdval="2513" sdnum="2057;">2513</td>
</tr>
<tr>
<td height="17" align="left">str::ends_with_unichar::short_mixed</td>
<td align="right" sdval="0.454976303317536" sdnum="2057;0;0.00%">45.50%</td>
<td align="right" sdval="5486" sdnum="2057;">5486</td>
<td align="right" sdval="2496" sdnum="2057;">2496</td>
</tr>
<tr>
<td height="17" align="left">str::ends_with_unichar::short_pile_of_poo</td>
<td align="right" sdval="0.456497797356828" sdnum="2057;0;0.00%">45.65%</td>
<td align="right" sdval="5448" sdnum="2057;">5448</td>
<td align="right" sdval="2487" sdnum="2057;">2487</td>
</tr>
<tr>
<td height="17" align="left">str::find_underscore_char::long_lorem_ipsum</td>
<td align="right" sdval="0.622058559367703" sdnum="2057;0;0.00%">62.21%</td>
<td align="right" sdval="5567" sdnum="2057;">5567</td>
<td align="right" sdval="3463" sdnum="2057;">3463</td>
</tr>
<tr>
<td height="17" align="left">str::find_underscore_char::short_ascii</td>
<td align="right" sdval="0.664383561643836" sdnum="2057;0;0.00%">66.44%</td>
<td align="right" sdval="146" sdnum="2057;">146</td>
<td align="right" sdval="97" sdnum="2057;">97</td>
</tr>
<tr>
<td height="17" align="left">str::find_underscore_char::short_mixed</td>
<td align="right" sdval="0.762295081967213" sdnum="2057;0;0.00%">76.23%</td>
<td align="right" sdval="122" sdnum="2057;">122</td>
<td align="right" sdval="93" sdnum="2057;">93</td>
</tr>
<tr>
<td height="17" align="left">str::find_underscore_str::short_pile_of_poo</td>
<td align="right" sdval="0.476190476190476" sdnum="2057;0;0.00%">47.62%</td>
<td align="right" sdval="252" sdnum="2057;">252</td>
<td align="right" sdval="120" sdnum="2057;">120</td>
</tr>
<tr>
<td height="17" align="left">str::find_zzz_char::long_lorem_ipsum</td>
<td align="right" sdval="0.621655593463818" sdnum="2057;0;0.00%">62.17%</td>
<td align="right" sdval="5569" sdnum="2057;">5569</td>
<td align="right" sdval="3462" sdnum="2057;">3462</td>
</tr>
<tr>
<td height="17" align="left">str::find_zzz_char::short_ascii</td>
<td align="right" sdval="0.666666666666667" sdnum="2057;0;0.00%">66.67%</td>
<td align="right" sdval="147" sdnum="2057;">147</td>
<td align="right" sdval="98" sdnum="2057;">98</td>
</tr>
<tr>
<td height="17" align="left">str::find_zzz_char::short_mixed</td>
<td align="right" sdval="0.754098360655738" sdnum="2057;0;0.00%">75.41%</td>
<td align="right" sdval="122" sdnum="2057;">122</td>
<td align="right" sdval="92" sdnum="2057;">92</td>
</tr>
<tr>
<td height="17" align="left">str::find_zzz_str::long_lorem_ipsum</td>
<td align="right" sdval="0.728648648648649" sdnum="2057;0;0.00%">72.86%</td>
<td align="right" sdval="925" sdnum="2057;">925</td>
<td align="right" sdval="674" sdnum="2057;">674</td>
</tr>
<tr>
<td height="17" align="left">str::rfind_underscore_char::long_lorem_ipsum</td>
<td align="right" sdval="0.3418911335578" sdnum="2057;0;0.00%">34.19%</td>
<td align="right" sdval="7128" sdnum="2057;">7128</td>
<td align="right" sdval="2437" sdnum="2057;">2437</td>
</tr>
<tr>
<td height="17" align="left">str::rfind_underscore_char::short_ascii</td>
<td align="right" sdval="0.373056994818653" sdnum="2057;0;0.00%">37.31%</td>
<td align="right" sdval="193" sdnum="2057;">193</td>
<td align="right" sdval="72" sdnum="2057;">72</td>
</tr>
<tr>
<td height="17" align="left">str::rfind_underscore_char::short_mixed</td>
<td align="right" sdval="0.414201183431953" sdnum="2057;0;0.00%">41.42%</td>
<td align="right" sdval="169" sdnum="2057;">169</td>
<td align="right" sdval="70" sdnum="2057;">70</td>
</tr>
<tr>
<td height="17" align="left">str::rfind_underscore_char::short_pile_of_poo</td>
<td align="right" sdval="0.505050505050505" sdnum="2057;0;0.00%">50.51%</td>
<td align="right" sdval="99" sdnum="2057;">99</td>
<td align="right" sdval="50" sdnum="2057;">50</td>
</tr>
<tr>
<td height="17" align="left">str::rfind_zzz_char::long_lorem_ipsum</td>
<td align="right" sdval="0.341983447888904" sdnum="2057;0;0.00%">34.20%</td>
<td align="right" sdval="7129" sdnum="2057;">7129</td>
<td align="right" sdval="2438" sdnum="2057;">2438</td>
</tr>
<tr>
<td height="17" align="left">str::rfind_zzz_char::short_ascii</td>
<td align="right" sdval="0.371134020618557" sdnum="2057;0;0.00%">37.11%</td>
<td align="right" sdval="194" sdnum="2057;">194</td>
<td align="right" sdval="72" sdnum="2057;">72</td>
</tr>
<tr>
<td height="17" align="left">str::rfind_zzz_char::short_mixed</td>
<td align="right" sdval="0.409356725146199" sdnum="2057;0;0.00%">40.94%</td>
<td align="right" sdval="171" sdnum="2057;">171</td>
<td align="right" sdval="70" sdnum="2057;">70</td>
</tr>
<tr>
<td height="17" align="left">str::rfind_zzz_char::short_pile_of_poo</td>
<td align="right" sdval="0.548076923076923" sdnum="2057;0;0.00%">54.81%</td>
<td align="right" sdval="104" sdnum="2057;">104</td>
<td align="right" sdval="57" sdnum="2057;">57</td>
</tr>
<tr>
<td height="17" align="left">str::trim_right_ascii_char::short_mixed</td>
<td align="right" sdval="1.10416666666667" sdnum="2057;0;0.00%">110.42%</td>
<td align="right" sdval="48" sdnum="2057;">48</td>
<td align="right" sdval="53" sdnum="2057;">53</td>
</tr>
<tr>
<td height="17" align="left">string::bench_from</td>
<td align="right" sdval="1.17241379310345" sdnum="2057;0;0.00%">117.24%</td>
<td align="right" sdval="58" sdnum="2057;">58</td>
<td align="right" sdval="68" sdnum="2057;">68</td>
</tr>
<tr>
<td height="17" align="left">string::bench_from_str</td>
<td align="right" sdval="1.17241379310345" sdnum="2057;0;0.00%">117.24%</td>
<td align="right" sdval="58" sdnum="2057;">58</td>
<td align="right" sdval="68" sdnum="2057;">68</td>
</tr>
<tr>
<td height="17" align="left">string::bench_push_str</td>
<td align="right" sdval="1.11111111111111" sdnum="2057;0;0.00%">111.11%</td>
<td align="right" sdval="54" sdnum="2057;">54</td>
<td align="right" sdval="60" sdnum="2057;">60</td>
</tr>
<tr>
<td height="17" align="left">string::bench_to_string</td>
<td align="right" sdval="1.12068965517241" sdnum="2057;0;0.00%">112.07%</td>
<td align="right" sdval="58" sdnum="2057;">58</td>
<td align="right" sdval="65" sdnum="2057;">65</td>
</tr>
<tr>
<td height="17" align="left">string::from_utf8_lossy_100_invalid</td>
<td align="right" sdval="1.1131458469588" sdnum="2057;0;0.00%">111.31%</td>
<td align="right" sdval="1529" sdnum="2057;">1529</td>
<td align="right" sdval="1702" sdnum="2057;">1702</td>
</tr>
</table>

7 years agoRollup merge of #42024 - citizen428:docs/update-exitstatus, r=steveklabnik
Mark Simulacrum [Fri, 19 May 2017 20:16:16 +0000 (14:16 -0600)]
Rollup merge of #42024 - citizen428:docs/update-exitstatus, r=steveklabnik

Add documentation for `ExitStatus`

As requested in #29370. r? @steveklabnik

7 years agoRollup merge of #42006 - jseyfried:fix_include_regression, r=nrc
Mark Simulacrum [Fri, 19 May 2017 20:16:15 +0000 (14:16 -0600)]
Rollup merge of #42006 - jseyfried:fix_include_regression, r=nrc

Fix ICE on `include!(line!())` (regression)

Fixes #41776.
r? @nrc

7 years agoRollup merge of #41971 - japaric:pre-link-args, r=alexcrichton
Mark Simulacrum [Fri, 19 May 2017 20:16:14 +0000 (14:16 -0600)]
Rollup merge of #41971 - japaric:pre-link-args, r=alexcrichton

add -Z pre-link-arg{,s} to rustc

This PR adds two unstable flags to `rustc`: `-Z pre-link-arg` and `-Z
pre-link-args`. These are the counterpart of the existing `-C link-arg{,s}`
flags and can be used to pass extra arguments at the *beginning* of the linker
invocation, before the Rust object files are passed.

I have [started] a discussion on the rust-embedded RFCs repo about settling on a
convention for passing extra arguments to the linker and there are two options
on discussion: `.cargo/config`'s `target.$T.rustflags` and custom target
specification files (`{pre,,post}-link-args` fields). However, to compare these
two options on equal footing this `-Z pre-link-arg` feature is required.

[started]: https://github.com/rust-embedded/rfcs/pull/24

Therefore I'm requesting landing this `-Z pre-link-arg` flag as an experimental
feature to evaluate these two options.

cc @brson
r? @alexcrichton

7 years agoRollup merge of #41958 - malbarbo:docker-share, r=alexcrichton
Mark Simulacrum [Fri, 19 May 2017 20:16:14 +0000 (14:16 -0600)]
Rollup merge of #41958 - malbarbo:docker-share, r=alexcrichton

ci: allows files to be shared by docker images

Change `src/ci/docker/run.sh` to allow files to be shared when building docker containers. For while, only android related shell scripts are shared. Others containers can be updated at any time.

sccache is installed last, as it is frequently updated this avoids the need to rebuilt the whole container.

7 years agoRollup merge of #41910 - mersinvald:master, r=Mark-Simulacrum
Mark Simulacrum [Fri, 19 May 2017 20:16:13 +0000 (14:16 -0600)]
Rollup merge of #41910 - mersinvald:master, r=Mark-Simulacrum

Number of filtered out tests in tests summary

Closes #31905

7 years agoRollup merge of #41870 - excaliburHisSheath:iss29367-windows-docs, r=frewsxcv
Mark Simulacrum [Fri, 19 May 2017 20:16:12 +0000 (14:16 -0600)]
Rollup merge of #41870 - excaliburHisSheath:iss29367-windows-docs, r=frewsxcv

Improve docs in os::windows::ffi and os::windows::fs

Part of #29367

This PR makes changes to the documentation in `os::windows::ffi` and `os::windows::fs` with the goal of fleshing them out and bringing them in line with Rust's quality standards.

r? @steveklabnik

7 years agoAuto merge of #41439 - ivandardi:master, r=BurntSushi
bors [Fri, 19 May 2017 17:42:28 +0000 (17:42 +0000)]
Auto merge of #41439 - ivandardi:master, r=BurntSushi

Stabilize step_by by adding it to Iterator (issue #27741)

Inspired by itertools' `take()` method. See issue #27741

7 years agoFix doc test failure for OpenOptionsExt
David LeGare [Fri, 19 May 2017 12:29:52 +0000 (07:29 -0500)]
Fix doc test failure for OpenOptionsExt

7 years agodebuginfo: Generate unique DW_AT_names for compilation units to work around OSX linke...
Michael Woerister [Fri, 19 May 2017 08:55:25 +0000 (10:55 +0200)]
debuginfo: Generate unique DW_AT_names for compilation units to work around OSX linker bug.

7 years agoTry to optimise char patterns
Simonas Kazlauskas [Mon, 15 May 2017 09:17:17 +0000 (12:17 +0300)]
Try to optimise char patterns

7 years agocore: fix unused_macro warning
Jorge Aparicio [Fri, 19 May 2017 04:33:08 +0000 (23:33 -0500)]
core: fix unused_macro warning

when compiling the crate for a target with max-atomic-width = 0

fixes #42097

7 years agofix casting of PRIO_PGRP
QuietMisdreavus [Fri, 19 May 2017 03:24:34 +0000 (22:24 -0500)]
fix casting of PRIO_PGRP

7 years agoNormalize docs in windows::ffi and windows::fs
David LeGare [Fri, 19 May 2017 02:10:15 +0000 (21:10 -0500)]
Normalize docs in windows::ffi and windows::fs

- Remove `()` parens when referencing functions in docs.
- Change some examples to be no_run instead of ignore.
- Normalize style in examples for `OpenOptionsExt`.
- Fix typo in windows mod docs.

7 years agorustdoc: Fix implementors list javascript
Oliver Middleton [Fri, 19 May 2017 01:59:04 +0000 (02:59 +0100)]
rustdoc: Fix implementors list javascript

* Use a different loop variable, `i` was already taken. This caused
missing items in the implementors list.
* Use `.getAttribute('href')` rather than `.href` to get the relative
URL which is what it needs to actually fix the links.

7 years agofix some clippy warnings in librustc_errors
Andre Bogus [Thu, 18 May 2017 23:20:48 +0000 (01:20 +0200)]
fix some clippy warnings in librustc_errors

7 years agoGive a nicer error for non-Unicode arguments to rustc and rustdoc
Josh Stone [Thu, 18 May 2017 23:11:22 +0000 (16:11 -0700)]
Give a nicer error for non-Unicode arguments to rustc and rustdoc

Previously, any non-Unicode argument would panic rustc:

```
$ rustc $'foo\x80bar'
error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report:
https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value:
"foo�bar"', /checkout/src/libcore/result.rs:859 note: Run with
`RUST_BACKTRACE=1` for a backtrace.
```

Now it gives a clean error:

```
$ rustc $'foo\x80bar'
error: Argument 1 is not valid Unicode: "foo�bar"
```

Maybe fixes #15890, although we still can't *compile* arbitrary file names.