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 13 pull requests #59046

Closed
wants to merge 80 commits into from
Closed

Rollup of 13 pull requests #59046

wants to merge 80 commits into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Mar 9, 2019

Successful merges:

Failed merges:

r? @ghost

RalfJung and others added 30 commits February 22, 2019 22:37
Also remove a no-longer accurate comments
Co-Authored-By: RalfJung <post@ralfj.de>
Simplify input validation for `#[unwind]`, add tests
Make `Unique::as_ptr` const without feature attribute as it's unstable
Make `NonNull::dangling` and `NonNull::cast` const with `feature = "const_ptr_nonnull"`
oli-obk and others added 15 commits March 7, 2019 10:27
This commit deletes the `connect_timeout_unbound` test from the standard
library which, unfortunately, is by definition eventually going to be a
spuriously failing test. There's no way to reserve a port as unbound so
we can rely on ecosystem testing for this feature for now.

Closes rust-lang#52590
…r=RalfJung

Use early unwraps instead of bubbling up errors just to unwrap in the end

r? @RalfJung
…llaumeGomez

rustdoc: add option to calculate "documentation coverage"

This PR adds a new flag to rustdoc, `--show-coverage`. When passed, this flag will make rustdoc count the number of items in a crate with documentation instead of generating docs. This count will be output as a table of each file in the crate, like this (when run on my crate `egg-mode`):

```
+-------------------------------------+------------+------------+------------+
| File                                | Documented |      Total | Percentage |
+-------------------------------------+------------+------------+------------+
| src/auth.rs                         |         16 |         16 |     100.0% |
| src/common/mod.rs                   |          1 |          1 |     100.0% |
| src/common/response.rs              |          9 |          9 |     100.0% |
| src/cursor.rs                       |         24 |         24 |     100.0% |
| src/direct/fun.rs                   |          6 |          6 |     100.0% |
| src/direct/mod.rs                   |         41 |         41 |     100.0% |
| src/entities.rs                     |         50 |         50 |     100.0% |
| src/error.rs                        |         27 |         27 |     100.0% |
| src/lib.rs                          |          1 |          1 |     100.0% |
| src/list/fun.rs                     |         19 |         19 |     100.0% |
| src/list/mod.rs                     |         22 |         22 |     100.0% |
| src/media/mod.rs                    |         27 |         27 |     100.0% |
| src/place/fun.rs                    |          8 |          8 |     100.0% |
| src/place/mod.rs                    |         35 |         35 |     100.0% |
| src/search.rs                       |         26 |         26 |     100.0% |
| src/service.rs                      |         74 |         74 |     100.0% |
| src/stream/mod.rs                   |         49 |         49 |     100.0% |
| src/tweet/fun.rs                    |         15 |         15 |     100.0% |
| src/tweet/mod.rs                    |         73 |         73 |     100.0% |
| src/user/fun.rs                     |         24 |         24 |     100.0% |
| src/user/mod.rs                     |         87 |         87 |     100.0% |
+-------------------------------------+------------+------------+------------+
| Total                               |        634 |        634 |     100.0% |
+-------------------------------------+------------+------------+------------+
```

Trait implementations are not counted because by default they "inherit" the docs from the trait, even though an impl can override those docs. Similarly, inherent impl blocks are not counted at all, because for the majority of cases such docs are not useful. (The usual pattern for inherent impl blocks is to throw all the methods on a type into a single impl block. Any docs you would put on that block would be better served on the type itself.)

In addition, `--show-coverage` can be combined with `--document-private-items` to get the coverage counts for everything in the crate, not just public items.

The coverage calculation is implemented as a late pass and two new sets of passes which strip out most of the work that rustdoc otherwise does when generating docs. The is because after the new pass is executed, rustdoc immediately closes instead of going on to generate documentation.

Many examples of coverage calculations have been included as `rustdoc-ui` tests.

r? @rust-lang/rustdoc
rust-lldb: fix crash when printing empty string

Fixes rust-lang#52185.

~Re-enables the pretty-std debuginfo test and tweaks the test as necessary to get it to pass again. This reveals that lldb's formatting of enums is broken (rust-lang#58492). I also removed the emoji from the test because I couldn't get the docker image's gdb to print the emoji, just octal escapes (https://github.com/rust-lang/rust/pull/53154/files#r208263904).~
MaybeUninit: add read_initialized, add examples

This adds a new `read_initialized` method, similar to suggestions by @Amanieu and @shepmaster. I also added examples to this and other methods.
…hton

look for python2 symlinks before bootstrap python

Before this commit, if you're running x.py directly on a system where
`python` is symlinked to Python 3, then the `python` config option will
default to a Python 3 interpreter. This causes debuginfo tests to fail
with an opaque error message, since they have a hard requirement on
Python 2.

This commit modifies the Python probe behavior to look for python2.7 and
python2 *before* using the interpreter used to execute `x.py`.
…ister

Refactor passes and pass execution to be more parallel

For `syntex_syntax` (with 16 threads and 8 cores):
- Cuts `misc checking 1` from `0.096s` to `0.08325s`.
- Cuts `misc checking 2` from `0.3575s` to `0.2545s`.
- Cuts `misc checking 3` from `0.34625s` to `0.21375s`.
- Cuts `wf checking` from `0.3085s` to `0.05025s`.

Reduces overall execution time for `syntex_syntax` (with 8 threads and cores) from `4.92s` to `4.34s`.

Subsumes rust-lang#58494
Blocked on rust-lang#58250

r? @michaelwoerister
…hton

Add tests for several E-needstest issues

This PR adds a number of tests for various `E-needstest` errors. These tend to have been left open for a long time and seem unlikely to be closed otherwise.

Closes rust-lang#10876.
Closes rust-lang#22892.
Closes rust-lang#26448.
Closes rust-lang#26577.
Closes rust-lang#26619.
Closes rust-lang#27054.
Closes rust-lang#28587.
Closes rust-lang#44127.
Closes rust-lang#44255.
Closes rust-lang#55731.
Closes rust-lang#57781.
Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const
Mention `unwind(aborts)` in diagnostics for `#[unwind]`

Simplify input validation for `#[unwind]`, add tests

cc rust-lang#58760
r? @Mark-Simulacrum
Add as_slice() to slice::IterMut and vec::Drain

In indexmap-rs/indexmap#88, we found that there was no easy way to implement
`Debug` for our `IterMut` and `Drain` iterators. Those are built on
`slice::IterMut` and `vec::Drain`, which implement `Debug` themselves,
but have no other way to access their data. With a new `as_slice()`
method, we can read the data and customize its presentation.
std: Delete a by-definition spuriously failing test

This commit deletes the `connect_timeout_unbound` test from the standard
library which, unfortunately, is by definition eventually going to be a
spuriously failing test. There's no way to reserve a port as unbound so
we can rely on ecosystem testing for this feature for now.

Closes rust-lang#52590
@Centril
Copy link
Contributor Author

Centril commented Mar 9, 2019

@bors r+ p=13

@bors
Copy link
Contributor

bors commented Mar 9, 2019

📌 Commit aba3c79 has been approved by Centril

@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 Mar 9, 2019
@bors
Copy link
Contributor

bors commented Mar 9, 2019

⌛ Testing commit aba3c79 with merge 3ddad405b8d7982cf684ded604f6dd59baa24b78...

@bors
Copy link
Contributor

bors commented Mar 9, 2019

💔 Test failed - checks-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 9, 2019
@rust-highfive
Copy link
Collaborator

The job armhf-gnu 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.
[01:27:28] failures:
[01:27:28] 
[01:27:28] ---- [ui] ui/asm/invalid-inline-asm.rs stdout ----
[01:27:28] 
[01:27:28] error: Error: expected failure status (Some(1)) but received status None.
[01:27:28] status: signal: 6
[01:27:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/asm/invalid-inline-asm.rs" "-Zthreads=1" "--target=arm-unknown-linux-gnueabihf" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/asm/invalid-inline-asm/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/arm-unknown-linux-gnueabihf/native/rust-test-helpers" "-Clinker=arm-linux-gnueabihf-gcc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/asm/invalid-inline-asm/auxiliary" "-A" "unused"
[01:27:28] ------------------------------------------
[01:27:28] 
[01:27:28] ------------------------------------------
[01:27:28] stderr:
[01:27:28] stderr:
[01:27:28] ------------------------------------------
[01:27:28] rustc: /checkout/src/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:7828: void llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite): Assertion `(OpInfo.ConstraintType == TargetLowering::C_RegisterClass || OpInfo.ConstraintType == TargetLowering::C_Register) && "Unknown constraint type!"' failed.
[01:27:28] ------------------------------------------
[01:27:28] 
[01:27:28] thread '[ui] ui/asm/invalid-inline-asm.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
[01:27:28] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:27:28] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:27:28] 
[01:27:28] ---- [ui] ui/asm/invalid-inline-asm-2.rs stdout ----
[01:27:28] 
[01:27:28] error: Error: expected failure status (Some(1)) but received status None.
[01:27:28] status: signal: 6
[01:27:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/asm/invalid-inline-asm-2.rs" "-Zthreads=1" "--target=arm-unknown-linux-gnueabihf" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/asm/invalid-inline-asm-2/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/arm-unknown-linux-gnueabihf/native/rust-test-helpers" "-Clinker=arm-linux-gnueabihf-gcc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/asm/invalid-inline-asm-2/auxiliary" "-A" "unused"
[01:27:28] ------------------------------------------
[01:27:28] 
[01:27:28] ------------------------------------------
[01:27:28] stderr:
[01:27:28] stderr:
[01:27:28] ------------------------------------------
[01:27:28] rustc: /checkout/src/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:7671: void llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite): Assertion `OpInfo.isIndirect && "Memory output must be indirect operand"' failed.
[01:27:28] ------------------------------------------
[01:27:28] 
[01:27:28] thread '[ui] ui/asm/invalid-inline-asm-2.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
[01:27:28] 
---
[01:27:28] 
[01:27:28] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:27:28] 
[01:27:28] 
[01:27:28] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/arm-unknown-linux-gnueabihf/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-arm-unknown-linux-gnueabihf" "--mode" "ui" "--target" "arm-unknown-linux-gnueabihf" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--linker" "arm-linux-gnueabihf-gcc" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/arm-unknown-linux-gnueabihf/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--llvm-version" "8.0.0\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--remote-test-client" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/remote-test-client" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:27:28] 
[01:27:28] 
[01:27:28] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target arm-unknown-linux-gnueabihf
[01:27:28] Build completed unsuccessfully in 1:24:10
---
travis_time:end:00efa900:start=1552148010045800738,finish=1552148010059162085,duration=13361347
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:15b0c4a2
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:start:crashlog
obj/cores/core.32708.!checkout!obj!build!x86_64-unknown-linux-gnu!stage2!bin!rustc
/home/travis/build/rust-lang/rust/obj/cores/core.32708.!checkout!obj!build!x86_64-unknown-linux-gnu!stage2!bin!rustc: Permission denied.
No stack.
travis_fold:start:crashlog
travis_fold:start:crashlog
obj/cores/core.32710.!checkout!obj!build!x86_64-unknown-linux-gnu!stage2!bin!rustc
/home/travis/build/rust-lang/rust/obj/cores/core.32710.!checkout!obj!build!x86_64-unknown-linux-gnu!stage2!bin!rustc: Permission denied.
No stack.
travis_time:end:15b0c4a2:start=1552148010068364785,finish=1552148010351614701,duration=283249916
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:06b85802
travis_time:start:06b85802
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:1950e564
$ dmesg | grep -i kill

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)

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-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor away the TypeckTables::cast_kinds field