Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #54051

Merged
merged 32 commits into from
Sep 8, 2018
Merged

Rollup of 10 pull requests #54051

merged 32 commits into from
Sep 8, 2018

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Sep 8, 2018

Successful merges:

matthewjasper and others added 22 commits September 3, 2018 21:50
It now does one hash table lookup per basic block, instead of one per
statement. This is worthwhile because this function is hot for NLL
builds of `ucd`.
in order to avoid constantly zeroing memory when it's not needed.
…crates`

fixes the *first* false positive reported in rust-lang#53964
We're shipping a rust-enabled lldb, but the "lldb" executable is not
installed into the "bin" directory by rustup.  See the discussion in
rust-lang/rustup#1492 for
background on this decision.  There, we agreed to have rust-lldb
prefer the rust-enabled lldb if it is installed.

This patch changes dist.rs to put lldb into rustlib, following what
was done for the other LLVM tools in rust-lang#53955, and then fixes rust-lldb
to prefer that lldb, if it exists.

See issue rust-lang#48168
Also, adjust the MAX to be `u32::MAX - 1`, leaving room for `u32::MAX`
to become a sentinel value in the future.
This reverts (part of) commit cb9a336ae2cf6a75fdcc130853286349cb424c96.
This fixes building `bootstrap` using a local Rust nightly.
@kennytm
Copy link
Member Author

kennytm commented Sep 8, 2018

@bors r+ p=11

@bors
Copy link
Contributor

bors commented Sep 8, 2018

📌 Commit 46b5282 has been approved by kennytm

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 8, 2018
@bors
Copy link
Contributor

bors commented Sep 8, 2018

⌛ Testing commit 46b5282 with merge 16c1598...

bors added a commit that referenced this pull request Sep 8, 2018
Rollup of 11 pull requests

Successful merges:

 - #51366 (stabilize #[panic_handler])
 - #53162 (rustdoc: collect trait impls as an early pass)
 - #53932 ([NLL] Remove base_place)
 - #53942 (Rewrite `precompute_borrows_out_of_scope` for fewer hash table lookups.)
 - #53973 (Have rust-lldb look for the rust-enabled lldb)
 - #53981 (Implement initializer() for FileDesc)
 - #53987 (rustbuild: allow configuring llvm version suffix)
 - #53993 (rustc_resolve: don't record uniform_paths canaries as reexports.)
 - #54007 (crates that provide a `panic_handler` are exempt from the `unused_extern_crates` lint)
 - #54040 (update books for next release)
 - #54050 (Update `petgraph` dependency to 0.4.13 to fix build with nightly)

Failed merges:

r? @ghost
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:43:20]     Checking panic_abort v0.0.0 (file:///checkout/src/libpanic_abort)
[00:43:21] warning: `[String::push_str]` cannot be resolved, ignoring it...
[00:43:21]     --> liballoc/string.rs:1930:52
[00:43:21]      |
[00:43:21] 1930 | /// This has the same behavior as the [`push_str`][String::push_str] method.
[00:43:21]      |
[00:43:21]      = note: #[warn(intra_doc_link_resolution_failure)] on by default
[00:43:21]      = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
[00:43:21] 
[00:43:21] 
[00:43:21] warning: `[String::push_str]` cannot be resolved, ignoring it...
[00:43:21]     --> liballoc/string.rs:1930:52
[00:43:21]      |
[00:43:21] 1930 | /// This has the same behavior as the [`push_str`][String::push_str] method.
[00:43:21]      |
[00:43:21]      = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
[00:43:21] 
[00:43:21] warning: `[Weak]` cannot be resolved, ignoring it...
---
travis_time:start:test_rustdoc
Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:05:05] 
[01:05:05] running 261 tests
[01:06:16] .......................i..............................................................F.F...........
[01:07:53] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:497:22
[01:07:53] failures:
[01:07:53] 
[01:07:53] ---- [rustdoc] rustdoc/intra-link-extern-crate.rs stdout ----
[01:07:53] 
[01:07:53] 
[01:07:53] error: rustdoc failed!
[01:07:53] status: exit code: 1
[01:07:53] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/intra-link-extern-crate/auxiliary" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/intra-link-extern-crate" "/checkout/src/test/rustdoc/intra-link-extern-crate.rs"
[01:07:53] ------------------------------------------
[01:07:53] 
[01:07:53] ------------------------------------------
[01:07:53] stderr:
---
[01:07:53] ---- [rustdoc] rustdoc/intra-link-private.rs stdout ----
[01:07:53] 
[01:07:53] error: rustdoc failed!
[01:07:53] status: exit code: 1
[01:07:53] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/intra-link-private/auxiliary" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/intra-link-private" "/checkout/src/test/rustdoc/intra-link-private.rs"
[01:07:53] ------------------------------------------
[01:07:53] 
[01:07:53] ------------------------------------------
[01:07:53] stderr:
---
[01:07:53]     --> /checkout/src/test/rustdoc/intra-link-private.rs:15:9
[01:07:53]      |
[01:07:53] 15   | #![deny(intra_doc_link_resolution_failure)]
[01:07:53]      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[01:07:53]      = help: to escape `[`ons " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:07:53] 
[01:07:53] 
[01:07:53] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:07:53] Build completed unsuccessfully in 0:23:38
[01:07:53] Build completed unsuccessfully in 0:23:38
[01:07:53] Makefile:58: recipe for target 'check' failed
[01:07:53] make: *** [check] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:013e968a
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@kennytm
Copy link
Member Author

kennytm commented Sep 8, 2018

@bors r- retry

Intralink failure again 😡

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 8, 2018
@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 8, 2018
…ikomatsakis

[NLL] Remove base_place

This function was supposed to make `Box` less special. But

* I think that the consensus is that MIR borrowck is going to fully special case `Box`
* It wasn't implemented correctly, it's looking at the type of the wrong `Place`, resulting in weird behaviour:

```rust
#![feature(nll)]
type A = Box<i32>; // If this is changed to another type then this will compile.

pub fn foo(x: Box<(String, A)>) {
    let a = x.0; // This will compile if these lines are swapped
    let b = x.1;
}
```

r? @nikomatsakis
…komatsakis

Rewrite `precompute_borrows_out_of_scope` for fewer hash table lookups.

It now does one hash table lookup per basic block, instead of one per
statement. This is worthwhile because this function is hot for NLL
builds of `ucd`.

I haven't measured the effect of this yet because I'm having trouble doing optimized builds of rustc that are suitable for profiling (rust-lang#53916). I will do an online perf run instead.

r? @nikomatsakis
…alexcrichton

Have rust-lldb look for the rust-enabled lldb

We're shipping a rust-enabled lldb, but the "lldb" executable is not
installed into the "bin" directory by rustup.  See the discussion in
rust-lang/rustup#1492 for
background on this decision.  There, we agreed to have rust-lldb
prefer the rust-enabled lldb if it is installed.  This patch changes
rust-lldb to look in the sysroot and use the lldb found there, if any.

See issue rust-lang#48168
Implement initializer() for FileDesc

Here was my initial issue:

```rust
use std::process::{Command};

fn main() {
    let output = Command::new("curl").arg("-s").arg("http://ovh.net/files/100Mio.dat").output();
    println!("{:?}", output.unwrap().stdout.len());
}
```
```
~/stuff ❯❯❯ time ./dwl
104857600
./dwl  16.22s user 1.80s system 23% cpu 1:15.24 total
```

```rust
use std::process::{Command, Stdio};

fn main() {
    let child = Command::new("curl").arg("-s").arg("http://ovh.net/files/100Mio.dat").stdout(Stdio::piped()).spawn();
    let output = child.unwrap().wait_with_output().unwrap();
    println!("{:?}", output.stdout.len());
}
```

```
~/stuff ❯❯❯ time ./dwl2
104857600
./dwl2  0.64s user 2.18s system 5% cpu 53.072 total
```

As you can see the first version is spending much more time in userland and also uses more cpu. With the help of @programble, @talchas and @habnabit  on the rust IRC, we discovered that the slow version uses two pipes, one for `stdin` and one for `stderr` and in that case it polls when going through [this function](https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/pipe.rs#L82). The polling calls `read_to_end` on the pipes repetitively and this results in zeroing its internal buffer each time. To avoid this zeroing, `FileDesc` needs to implement `initializer`. We see no reason why it [wouldn't work with uninitialized memory](https://doc.rust-lang.org/1.26.1/src/std/io/mod.rs.html#534) so this PR fixes that.

Here is some tracing of the slow program:
![image](https://user-images.githubusercontent.com/147585/45133180-ed8a2d80-b161-11e8-9ec7-09979ec96145.png)

versus the fast program:
![image](https://user-images.githubusercontent.com/147585/45133216-0c88bf80-b162-11e8-908e-ff81d59239fb.png)

I have not tested the change yet but will try to build it tomorrow.
rustbuild: allow configuring llvm version suffix

Fixes rust-lang#53852 by allowing user to install different versions of rust to the same sysroot.
rustc_resolve: don't record uniform_paths canaries as reexports.

Fixes rust-lang#53691, fixes rust-lang#53484.
crates that provide a `panic_handler` are exempt from the `unused_extern_crates` lint

fixes the *first* false positive reported in rust-lang#53964
…y, r=alexcrichton

Update `petgraph` dependency to 0.4.13 to fix build with nightly

I wanted to build Rust from source using a local nightly compiler, but I was unable to get `bootstrap` to compile due to a naming conflict with the `find_map` function.

This PR updates the `petgraph` dependency of `bootstrap` to 0.4.13, fixing the issue.
…Simulacrum

use `NonZeroU32` in `newtype_index!`macro, change syntax

Various improvements to the `newtype_index!` macro:

- Use `NonZeroU32` so that `Option<T>` is cheap
- More ergonomic helper method, no need to import `Idx` trait all the time
- Improve syntax to use `struct` keyword so that ripgrep works to find type def'n

Fixes rust-lang#50337

I'm curious to see if this passes tests =)
@kennytm kennytm changed the title Rollup of 11 pull requests Rollup of 10 pull requests Sep 8, 2018
@kennytm
Copy link
Member Author

kennytm commented Sep 8, 2018

@bors r+

Removed #51366 (already testing)
Removed #53162 (removing anything rustdoc related)
Added #53315.

@bors
Copy link
Contributor

bors commented Sep 8, 2018

📌 Commit 51c3879 has been approved by kennytm

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 8, 2018
@bors
Copy link
Contributor

bors commented Sep 8, 2018

⌛ Testing commit 51c3879 with merge 05cb29e...

bors added a commit that referenced this pull request Sep 8, 2018
Rollup of 10 pull requests

Successful merges:

 - #53315 (use `NonZeroU32` in `newtype_index!`macro, change syntax)
 - #53932 ([NLL] Remove base_place)
 - #53942 (Rewrite `precompute_borrows_out_of_scope` for fewer hash table lookups.)
 - #53973 (Have rust-lldb look for the rust-enabled lldb)
 - #53981 (Implement initializer() for FileDesc)
 - #53987 (rustbuild: allow configuring llvm version suffix)
 - #53993 (rustc_resolve: don't record uniform_paths canaries as reexports.)
 - #54007 (crates that provide a `panic_handler` are exempt from the `unused_extern_crates` lint)
 - #54040 (update books for next release)
 - #54050 (Update `petgraph` dependency to 0.4.13 to fix build with nightly)
@bors
Copy link
Contributor

bors commented Sep 8, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: kennytm
Pushing 05cb29e to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.