Rollup of 12 pull requests
Successful merges:
- #84013 (Replace all `fmt.pad` with `debug_struct`)
- #84119 (Move `sys::vxworks` code to `sys::unix`)
- #84212 (Replace `Void` in `sys` with never type)
- #84251 (fix 'const-stable since' for NonZeroU*::new_unchecked)
- #84301 (Document that `index` and `index_mut` can panic)
- #84365 (Improve the docstrings of the `Lto` struct.)
- #84378 (Fix broken doc link)
- #84379 (Add GAT related tests)
- #84380 (Write Rustdoc titles like "x in crate::mod - Rust")
- #84390 (Format `Struct { .. }` on one line even with `{:#?}`.)
- #84393 (Support `x.py doc std --open`)
- #84406 (Remove `delete` alias from `mem::drop`.)
Failed merges:
- #84387 (Move `sys_common::poison` to `sync::poison`)
r? `@ghost`
`@rustbot` modify labels: rollup
bump jobserver dependency
the newest jobserver version should slightly reduce context switches
in highly parallel build environments on linux kernels >= 5.6
Support `x.py doc std --open`
I usually run this command:
```
./x.py doc std --stage 1 --jobs 8
```
Then I gave a try to `--open` and realized it wasn't working. I finally realized it was simply because it was only handling paths starting with `library`. This PR allows to handle both kinds of paths.
cc ``@jyn514``
r? ``@Mark-Simulacrum``
Format `Struct { .. }` on one line even with `{:#?}`.
The result of `debug_struct("A").finish_non_exhaustive()` before this change:
```
A {
..
}
```
And after this change:
```
A { .. }
```
If there's any fields, the result stays unchanged:
```
A {
field: value,
..
}
Write Rustdoc titles like "x in crate::mod - Rust"
This makes Rustdoc titles for items be like "Widget in cratename::blah::foo - Rust". Titles for modules and other non-items are unchanged, and still read like "cratename::blah::foo - Rust". This makes managing several open Rustdoc tabs easier.
![A screenshot of several open Rustdoc tabs](https://user-images.githubusercontent.com/10530973/115457675-d608f180-a1f2-11eb-87a8-838a32b4e3f7.png)
This also adds some tests for the new title behavior.
Closes#84371.
fix 'const-stable since' for NonZeroU*::new_unchecked
For the unsigned `NonZero` types, `new_unchecked` was const-stable from the start with https://github.com/rust-lang/rust/pull/50808. Fix the docs to accurately reflect that.
I think this `since` is also incorrect:
```rust
#[stable(feature = "from_nonzero", since = "1.31.0")]
impl From<$Ty> for $Int {
```
The signed nonzero types were only stabilized in 1.34, so that `From` impl certainly didn't exist before. But I had enough of digging through git histories after I figured out when `new_unchecked` became const-stable...^^
Replace `Void` in `sys` with never type
This PR replaces several occurrences in `sys` of the type `enum Void {}` with the Rust never type (`!`).
The name `Void` is unfortunate because in other languages (C etc.) it refers to a unit type, not an uninhabited type.
Note that the previous stabilization of the never type was reverted, however all uses here are implementation details and not publicly visible.
Move `sys::vxworks` code to `sys::unix`
Follow-up to #77666, `sys::vxworks` is almost identical to `sys::unix`, the only differences are the `rand`, `thread_local_dtor`, and `process` implementation. Since `vxworks` is `target_family = unix` anyway, there is no reason for the code not to live inside of `sys::unix` like all the other unix-OSes.
e41f378f82/compiler/rustc_target/src/spec/vxworks_base.rs (L12)
``@rustbot`` label: +T-libs-impl
Replace all `fmt.pad` with `debug_struct`
This replaces any occurrence of:
- `f.pad("X")` with `f.debug_struct("X").finish()`
- `f.pad("X { .. }")` with `f.debug_struct("X").finish_non_exhaustive()`
This is in line with existing formatting code such as
1255053067/library/std/src/sync/mpsc/mod.rs (L1470-L1475)
Upgrade `expat` dependency in riscv64 to newer version.
The old version was renamed to `expat-2.2.6-RENAMED-VULNERABLE-PLEASE-USE-2.3.0-INSTEAD`. :)
r? `@Mark-Simulacrum`
This makes Rustdoc titles for items read like
"x in cratename::blah::foo - Rust". Title for modules and other
non-items are unchanged, and still read like
"doccratenameconst::blah::foo - Rust". This makes managing several open
Rustdoc tabs easier.
Closes#84371.
Suggest `.as_ref()` on borrow error involving `Option`/`Result`
When encountering a E0382 borrow error involving an `Option` or `Result`
provide a suggestion to use `.as_ref()` on the prior move location to
avoid the move.
Fix#84165.
rustdoc: Simplify some document functions
* Remove `prefix` param of `document_short/full`, `render_markdown`, as its always an empty string.
* Remove `Option` wrapping of `document_short` `parent`, as its always `Some`.
rustdoc: Show nag box on IE11
Rustdoc doesn't work on IE11. It's been broken for months, it isn't supported by the [tiered browser support list], it's even more severely broken on other Rust websites, and IE11 doesn't support the `<details>` tag that we want to use.
In the interest of honesty, let's give an actual error message for anyone on IE11.
[tiered browser support list]: https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md
coverage of async function bodies should match non-async
This fixes some missing coverage within async function bodies.
Commit 1 demonstrates the problem in the fixed issue, and commit 2 corrects it.
Fixes: #83985
Add coverage to continue statements
`continue` statements were missing coverage. This was particularly
noticeable in a match pattern that contained only a `continue`
statement, leaving the branch appear uncounted. This PR addresses the
problem and adds tests to prove it.
r? `@tmandry`
cc: `@wesleywiser`