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 8 pull requests #50003

Merged
merged 20 commits into from
Apr 16, 2018
Merged

Rollup of 8 pull requests #50003

merged 20 commits into from
Apr 16, 2018

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Apr 16, 2018

Successful merges:

Failed merges:

nox and others added 14 commits April 1, 2018 11:56
This helps with the specific problem described in rust-lang#49541, obviously without
making any large change to how inlining works in the general case.

Everything involved in the conversions is made `#[inline]`, except for the
`<Vec<T>>::into_boxed_slice` entry point which is made `#[inline(always)]`
after checking that duplicating the function mentioned in the issue prevented
its inlining if I only annotate it with `#[inline]`.

For the record, that function was:

```rust
pub fn foo() -> Box<[u8]> {
    vec![0].into_boxed_slice()
}
```

To help the inliner's job, we also hoist a `self.capacity() != self.len` check
in `<Vec<T>>::shrink_to_fit` and mark it as `#[inline]` too.
The Box::new(mem::uninitialized()) pattern actually actively copies
uninitialized bytes from the stack into the box, which is a waste of
time. Using the box syntax instead avoids the useless copy.
Debugging information for the extended tools is currently disabled for
concerns about the size.  This patch adds `--enable-debuginfo-tools` to
let one opt into having that debuginfo.

This is useful for debugging the tools in distro packages.  We always
strip debuginfo into separate packages anyway, so the extra size is not
a concern in regular use.
As discussed in rust-lang#15536, the LLVM documentation incorrect described
overflowing f64->f32 casts as being undefined behavior. LLVM never
treated them as such, and the documentation has been adjusted in
https://reviews.llvm.org/rL329065. As such, this warning can now
be removed.

Closes rust-lang#49622.
Inline most of the code paths for conversions with boxed slices

This helps with the specific problem described in rust-lang#49541, obviously without making any large change to how inlining works in the general case.

Everything involved in the conversions is made `#[inline]`, except for the `<Vec<T>>::into_boxed_slice` entry point which is made `#[inline(always)]` after checking that duplicating the function mentioned in the issue prevented its inlining if I only annotate it with
`#[inline]`.

For the record, that function was:

```rust
pub fn foo() -> Box<[u8]> {
    vec![0].into_boxed_slice()
}
```

To help the inliner's job, we also hoist a `self.capacity() != self.len` check in `<Vec<T>>::shrink_to_fit` and mark it as `#[inline]` too.
Prevent broken pipes causing ICEs

As the private `std::io::print_to` panics if there is an I/O error, which is used by `println!`, the compiler would ICE if one attempted to use a broken pipe (e.g. `rustc --help | false`). This introduces a new (private) macro `try_println!` which allows us to avoid this.

As a side note, it seems this macro might be useful publicly (and actually there seems to be [a crate specifically for this purpose](https://crates.io/crates/try_print/)), though that can probably be left for a future discussion.

One slight alternative approach would be to simply early exit without an error (i.e. exit code `0`), which [this comment](rust-lang#34376 (comment)) suggests is the usual approach. I've opted not to take that approach initially, because I think it's more helpful to know when there is a broken pipe.

Fixes rust-lang#34376.
…richton

Use box syntax instead of Box::new in Mutex::remutex on Windows

The Box::new(mem::uninitialized()) pattern actually actively copies
uninitialized bytes from the stack into the box, which is a waste of
time. Using the box syntax instead avoids the useless copy.
@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 16, 2018
@kennytm
Copy link
Member Author

kennytm commented Apr 16, 2018

@bors r+ p=8

@bors
Copy link
Contributor

bors commented Apr 16, 2018

📌 Commit 38677e6 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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 16, 2018
@rust-highfive
Copy link
Collaborator

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.
Resolving deltas: 100% (616283/616283), completed with 4912 local objects.
---
[00:00:43] configure: rust.quiet-tests     := True
---
[00:30:57] error: this feature has been stable since 1.26.0. Attribute no longer needed
[00:30:57]   --> librustc_typeck/lib.rs:85:12
---
[00:30:57]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_typeck librustc_typeck/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=5a70b5edf99aa8eb -C extra-filename=-5a70b5edf99aa8eb --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-a7e4568ae4f6d310.so --extern rustc_platform_intrinsics=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_platform_intrinsics-7c8f07fcfb43dd0e.so --extern fmt_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libfmt_macros-3d30704c9bf94823.so --extern rustc_const_math=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_const_math-c4c7b11d5784a197.so --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-4acf4151e5e9c3f9.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-4751eaacfa9b82b1.so --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-e7f38b02feb371ba.so --extern arena=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libarena-dfd6e9728ffc83dd.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-caf863901ba00d4d.so --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-94d776423bcbc65e.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-306b41e2ad232afa/out/.libs -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-21ebc33766ad71e1/out` (exit code: 101)
[00:30:57] warning: build failed, waiting for other jobs to finish...
[00:32:27] error: build failed
[00:32:27] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:32:27] expected success, got: exit code: 101
[00:32:27] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1085:9
[00:32:27] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:32:27] travis_fold:end:stage1-rustc
[00:32:27] travis_time:end:stage1-rustc:start=1523902617869707036,finish=1523903159683132825,duration=541813425789
[00:32:27] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:32:27] Build completed unsuccessfully in 0:27:15
[00:32:27] Makefile:28: recipe for target 'all' failed
[00:32:27] make: *** [all] Error 1
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:0a0115c4:start=1523903160262982064,finish=1523903160269929049,duration=6946985
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:13920ce4
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:13920ce4:start=1523903160276530852,finish=1523903160282932519,duration=6401667
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:02944794
$ dmesg | grep -i kill
[   10.660438] init: failsafe main process (1094) killed by TERM signal

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)

@bors
Copy link
Contributor

bors commented Apr 16, 2018

⌛ Testing commit 38677e6a21c5032c638f7ce4c9ae3b3ba1e5fdcd with merge 852a95bb7757123078a017dac48aa8ae6c47d8a4...

@kennytm
Copy link
Member Author

kennytm commented Apr 16, 2018

@bors r- retry

CI is failing

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

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:30:49] error: this feature has been stable since 1.26.0. Attribute no longer needed
[00:30:49]   --> librustc_typeck/lib.rs:85:12
---
[00:30:49]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_typeck librustc_typeck/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=5a70b5edf99aa8eb -C extra-filename=-5a70b5edf99aa8eb --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-4acf4151e5e9c3f9.so --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-e7f38b02feb371ba.so --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-94d776423bcbc65e.rlib --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-a7e4568ae4f6d310.so --extern arena=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libarena-dfd6e9728ffc83dd.so --extern rustc_platform_intrinsics=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_platform_intrinsics-7c8f07fcfb43dd0e.so --extern fmt_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libfmt_macros-3d30704c9bf94823.so --extern rustc_const_math=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_const_math-c4c7b11d5784a197.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-caf863901ba00d4d.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-4751eaacfa9b82b1.so -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-306b41e2ad232afa/out/.libs -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-21ebc33766ad71e1/out` (exit code: 101)
[00:30:49] warning: build failed, waiting for other jobs to finish...
[00:30:56] [RUSTC-TIMING] rustc_incremental test:false 37.562
[00:31:25] [RUSTC-TIMING] rustc_metadata test:false 66.485
[00:32:17] [RUSTC-TIMING] rustc_mir test:false 118.862
[00:32:17] error: build failed
[00:32:17] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:32:17] expected success, got: exit code: 101
[00:32:17] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1085:9
[00:32:17] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:32:17] travis_fold:end:stage1-rustc
[00:32:17] travis_time:end:stage1-rustc:start=1523906209382754318,finish=1523906742820585771,duration=533437831453
[00:32:17] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:32:17] Build completed unsuccessfully in 0:26:55
[00:32:17] Makefile:28: recipe for target 'all' failed
[00:32:17] make: *** [all] Error 1
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:159ba327:start=1523906743475436094,finish=1523906743480820525,duration=5384431
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:03a9c358
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:03a9c358:start=1523906743486063342,finish=1523906743491865062,duration=5801720
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:01ee10ff
$ dmesg | grep -i kill
[   10.414241] init: failsafe main process (1095) killed by TERM signal

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)

…e feature list

These are already stabilized in 1.26.
Fix incorrect span in `&mut` suggestion

Fixes rust-lang#49859
…ulacrum

rustbuild: allow building tools with debuginfo

Debugging information for the extended tools is currently disabled for
concerns about the size.  This patch adds `--enable-debuginfo-tools` to
let one opt into having that debuginfo.

This is useful for debugging the tools in distro packages.  We always
strip debuginfo into separate packages anyway, so the extra size is not
a concern in regular use.
Remove warning about f64->f32 cast being potential UB

As discussed in rust-lang#15536, the LLVM documentation incorrect described overflowing f64->f32 casts as being undefined behavior. LLVM never treated them as such, and the documentation has been adjusted in https://reviews.llvm.org/rL329065. As such, this warning can now be removed.

Closes rust-lang#49622.

---

I could not find any existing test checking for this warning. Should I be adding a test for the absence of the warning instead?
…tMisdreavus

Remove unnecessary indentation in rustdoc book codeblock.

None
Remove `underscore_lifetimes` and `match_default_bindings` from active feature list

These are already stabilized in 1.26.
@kennytm
Copy link
Member Author

kennytm commented Apr 16, 2018

@bors r+

Updated #49647

@bors
Copy link
Contributor

bors commented Apr 16, 2018

📌 Commit bf16e4b 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 Apr 16, 2018
@bors
Copy link
Contributor

bors commented Apr 16, 2018

⌛ Testing commit bf16e4b with merge 4a3ab8b...

bors added a commit that referenced this pull request Apr 16, 2018
Rollup of 8 pull requests

Successful merges:

 - #49555 (Inline most of the code paths for conversions with boxed slices)
 - #49606 (Prevent broken pipes causing ICEs)
 - #49646 (Use box syntax instead of Box::new in Mutex::remutex on Windows)
 - #49647 (Remove `underscore_lifetimes` and `match_default_bindings` from active feature list)
 - #49931 (Fix incorrect span in `&mut` suggestion)
 - #49959 (rustbuild: allow building tools with debuginfo)
 - #49965 (Remove warning about f64->f32 cast being potential UB)
 - #49994 (Remove unnecessary indentation in rustdoc book codeblock.)

Failed merges:
@bors
Copy link
Contributor

bors commented Apr 16, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: kennytm
Pushing 4a3ab8b 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.