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
Add rust_analyzer to check-cfg names
Add rust_analyzer as a known cfg name, set to expect no values
Add test to verify name is recognized and warned on setting a value
Fixesrust-lang/rust#160736
r? @Urgau
Fix, simplify, and document doc meta finalize mode
Follow up https://github.com/rust-lang/rust/pull/159415#discussion_r3605070232
Get rid of the mode where you can finalize the CCI and generate more docs at the same time. It isn't used in Cargo, and probably won't be used elsewhere?
Fixes a bug where the crate index, settings page, and help page aren’t generated at finalize time.
Update documentation.
Move CCI tests to run-make, so that we can test the finalize step’s CLI.
[rustdoc] Correctly handle output options with --show-coverage
Fixes https://github.com/rust-lang/rust/issues/158929.
The `-o` option was ignored with `--show-coverage`. This PR takes it into account and makes it closer to how these options are handled in the rest of rustdoc.
Considering `calculate_doc_coverage` was never really a pass and that I needed `RenderOptions` (for the `-o` option), I moved it out of passes.
r? @camelid
Improve workings of attribute suggestions
`AttrItem` span tracking improved in rust-lang/rust#159587, which lets us slightly simplify the workings of attribute suggestions.
r? @JonathanBrouwer
rustdoc: warn on improperly interleaved HTML/MD
Enhances the `rustdoc::invalid_html_tags` lint to warn in cases where pulldown-cmark will produce invalid HTML because the Markdown and HTML are improperly nested.
As an extreme example, this code does not do what it looks like it does, and it doesn't produce a warning under current nightly, either:
```markdown
Figure 1: an X
<svg viewBox="0 0 10 10">
<path
d="M0 10L10 0M10 10L0 0"
stroke="black"
>
</svg>
```
This pull request makes it warn:
```text
error: unopened HTML tag `svg`
--> $DIR/invalid-html-tags.rs:285:5
|
LL | /// <svg viewBox="0 0 10 10">
| ---- does not match this unclosed tag
...
LL | /// >
| - because the Markdown paragraph is interrupted by this block quote
LL | /// </svg>
| ^^^^^^ this unopened tag
```
See also: https://talk.commonmark.org/t/thoughts-on-changing-supported-html-syntax-to-include-the-dangling-closing-angle-bracket/3827
This is probably not what the user wants:
error: nested Markdown emphasis in HTML `style` tag
--> $DIR/invalid-html-tags-correct-script-style.rs:11:16
|
LL | /// One <style>*emph*</style>
| ^^^^^^ Markdown translates this into HTML, but the browser parses it as CSS
|
help: to turn off Markdown parsing, put the tag at the start of the line
|
LL ~ /// One
LL ~ /// <style>*emph*</style>
|
rustdoc: do not include extra stuff in span
This change prevents our lints from returning a span with stuff in it that isn't actually part of the doc comment. When that happens, it returns `None` instead.
Fixes https://github.com/rust-lang/rust-clippy/issues/16169, since the bug was reported against the `clippy::doc_paragraphs_missing_punctuation` lint but is actually a bug in `source_span_for_markdown_range_inner`.
`--output-format=json` does a few different things:
- By itself, it emits a JSON representation of a crate's API ("IR
JSON").
- When used with `--show-coverage`, it prints the doc coverage as JSON,
instead of an ASCII table ("Coverage JSON").
These two cases need to be handled entirely differently. There's no
overlapping code, they just are called the same way.
By making these separate variants, we don't need to check the
`show_coverage` variable each time we check `is_json`, which makes it
harder to write a bug that checks for IR JSON, and accidentally happens in
coverage JSON too.
Also, as a driveby, improves some instability error messages, and cleans
up their tests, and adds other related tests.
* add regression test for deprecated note on inlined reexport chain
* resolve deprecated-note links from the owning reexport
* add a comment to regression test
Fix ICE on non-ident path in `doc(auto_cfg values)`
Fixesrust-lang/rust#158744
`#[doc(auto_cfg(hide(a, values(::b))))]` could ICE while parsing `values(...)` because the malformed nested meta item did not have a single identifier, but the error path still called `unwrap()` on `sub_item.ident()`.
The standard library has fallback code for targets without threads
(e.g., using a Cell-based Mutex and similar). Today there's no
enforcement in std that those targets truly don't have threads which
makes that code potentially unsound. This will let us add a
static assertion that the target spec agrees that the target is
non-threaded.
This change prevents our lints from returning a span with stuff in it
that isn't actually part of the doc comment. When that happens, it
returns `None` instead.