This reverts commit d4e6b8f246.
Reverted commit contains incorrect comments,
does not implement all the functionality it claims to,
and lacks test coverage.
Prevent `should-fail` to be used in `rustdoc-ui` testsuite
Follow-up of https://github.com/rust-lang/rust/pull/162030 and discussion with @fmease.
There is no reason to use `should-fail` for `rustdoc-ui` (or `rustdoc-html`) testsuite, so let's prevent it.
r? @fmease
Move rustdoc ui doctests into the right testsuite
When working on https://github.com/rust-lang/rust/pull/161944#discussion_r3886415477, I realized that a lot of doctests in `rustdoc-html` testsuite were not in the correct testsuite, so moving them in the right location.
Because you're the one who made me realize it, here goes @fmease (thanks!) :p
r? @fmease
Check `redundant_explicit_links` against generated URLs
Fixesrust-lang/rust#155458.
`rustdoc::redundant_explicit_links` checked explicit link destinations by resolving both the label and the destination as intra-doc paths. That misses links written as local rustdoc page URLs, such as `struct.B.html`, because those URLs do not appear in `doc_link_resolutions`.
This PR keeps the existing path-resolution check and falls back to comparing the explicit destination with the local href that rustdoc would generate for the resolved label.
The essential problem is that, with this table:
```text
one |
----|
a | b | c
a | b |
a | b
a |
```
And this logic:
```rust
let too_many_pipes = divider_count > expected_cells + 1;
```
`expected_cells + 1` winds up as 2, so you get this warning:
```text
error: unused content after last table cell
--> $DIR/invalid_markdown_table.rs:81:14
|
LL | //! a | b | c
| ^^^^^^ this content is discarded
error: unused content after last table cell
--> $DIR/invalid_markdown_table.rs:83:14
|
LL | //! a | b |
| ^^^^ this content is discarded
error: unused content after last table cell
--> $DIR/invalid_markdown_table.rs:85:14
|
LL | //! a | b
| ^^ this content is discarded
```
We really want our warning to give the suggest-escaping flow, like this:
```text
error: table row has too many columns
--> $DIR/invalid_markdown_table.rs:81:13
|
LL | //! a | b | c
| ^ any content after this column divider is discarded
|
= help: to escape `|` characters in tables, add a `\` before them like `\|`
error: table row has too many columns
--> $DIR/invalid_markdown_table.rs:83:13
|
LL | //! a | b |
| ^ any content after this column divider is discarded
|
= help: to escape `|` characters in tables, add a `\` before them like `\|`
error: unused content after last table cell
--> $DIR/invalid_markdown_table.rs:85:14
|
LL | //! a | b
| ^^ this content is discarded
```
By only scanning the text between the end of the last cell and the row,
instead of doing the entire row, we don't have to re-implement as much
of pulldown-cmark's logic.
Rollup of 8 pull requests
Successful merges:
- rust-lang/rust#159593 (merge ambiguity errors that blame the same inference variable)
- rust-lang/rust#160687 (Experiment: Add `core::cmp::smallest` and `core::cmp::largest`)
- rust-lang/rust#160856 (Replace infers and non-rigid aliases with `Ty/Const::Error` if param env normalization fails)
- rust-lang/rust#160961 (bootstrap: Overhaul matching of command-line selectors to steps)
- rust-lang/rust#160975 (Remove target argument from get_proc_macros)
- rust-lang/rust#161023 (bootstrap: Replace the `exit!` macro with a function `helpers::exit_process`)
- rust-lang/rust#160932 (Make tidy::Version public)
- rust-lang/rust#161029 (mailmap: Update my default email)
Replace infers and non-rigid aliases with `Ty/Const::Error` if param env normalization fails
Fixesrust-lang/rust#160196Fixesrust-lang/rust#148630
Previously we use unnormalized param env if we fail to normalize it. This causes problem for places which expect normalized param env, like in lexical region solving.
I also sneak in a one-line change that we resolve regions with normalized param env in param env normalization now.
This fixes ICEs in `polkadot` and `zerocopy` which had non-rigid const aliases in type outlive env before. I can split it into another PR if that's preferred.
r? lcnr
Add new `unused_footnote_definition` rustdoc lint
Follow-up of rust-lang/rust#137803 (where the two first commits come from).
It adds a new lint which checks for unused footnote definitions.
r? @notriddle