This commit allows it to stop manually specifying pixel heights for the tabs
on search result pages. There's less messing with manual breakpoints and
less complex CSS selectors.
Migrate write.rs to a late pass
changelog: Migrates write.rs from a pre expansion pass to a late pass
changelog: [`positional_named_format_parameters`] is renamed in favour of the rustc lint `named_arguments_used_positionally`
- Macros are now identified by diagnostic items, so will no longer lint user defined macros named, e.g. a custom `print!`
- `print_literal`/`write_literal` no longer lint no longer lint literals that come from macro expansions, e.g. `env!("FOO")`
- `print_with_newline`/`write_with_newline` no longer lint strings with any internal `\r` or `\n`s
~~A false negative, `print_literal`/`write_literal` don't lint format strings that produce `FormatSpec`s, e.g. ones containing pretty print/width/align specifiers~~
Suggestion changes:
- ~~`print_literal`/`write_literal` no longer have suggestions, as the spans for the `{}`s were not easily obtainable~~
- `print_with_newline`/`write_with_newline` has a better suggestion for a sole literal newline, but no longer has suggestions for len > 1 strings that end in a literal newline
- ~~`use_debug` spans are less precise, now point to the whole format string~~
The diff for write.rs is pretty unwieldy, other than for the `declare_clippy_lint!`s I think you'd be better off viewing it as a brand new file rather than looking at the diff, as it's mostly written from scratch
cc #6610, fixes#5721, fixes#7195, fixes#8615
Fix `unused_peekable` closure and `f(&mut peekable)` false positives
changelog: Fix [`unused_peekable`] false positive when peeked in a closure or called as `f(&mut peekable)`
The `return`/`break` changes aren't part of the fix, they allow an earlier return in some cases. `break` is replaced with `return` for style purposes as they do the same thing in this case
Fixes#9456Fixes#9462
Update test output for drop tracking
#97334 has a lot of updates to test outputs that makes the PR larger than it needs to be. This PR pulls those changes out so we can keep the other one as simple as possible.
r? `@jyn514`
rustdoc: remove outdated CSS `.content table` etc
# Screenshot before
![image](https://user-images.githubusercontent.com/1593513/189992665-238aab28-d224-4466-901c-6e35e79182fb.png)
# Screenshot after
![image](https://user-images.githubusercontent.com/1593513/189992762-35c8efe4-e980-40bd-b72c-3ae4cfd6f830.png)
# Description
The `.content table` / `.content td` / `.content tr` family of selectors date back to 4fd061c426902b0904c65e64a3780b21f9ab3afb, when module indexes and other parts of rustdoc used `<table>` tags for layout and content presentation. The `.content td h1, .content td h2` has only been changed since then to tweak the font size in dd5ff428edbc7cd4fa600b81f27bbec28589704f.
4fd061c426/src/rustdoc_ng/html/static/main.css (L155-L162)
This CSS would have affected:
* search result tables, which were removed in b615c0c85469c94041a5e68b9d8b68dcf799f9f1
* module item tables, which were removed in 6020c79ddeafe8d9760b27c14c39da81bac9b4a6
* docblock tables from markdown, which still exist
It may also have affected a few other tables over the last decade, but they've been gradually replaced with grid layouts and flexbox to make layouts that work better on narrow viewports. For example, 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9.
These rules have no affect on the appearance of docblock tables
---------------------------------------------------------------
.content table {
border-spacing: 0 5px;
}
According to MDN, [border-spacing] only has an effect when `border-collapse` is `separate`. However, `border-collapse: collapse` is set globally for all tables, so this rule does nothing.
[border-spacing]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-spacing
.content td p:first-child { margin-top: 0; }
Tables with paragraphs in them are impossible without dropping down to raw HTML. Also, the rustdoc stylesheet sets paragraphs to have no top margin anyway, so this rule is a no-op.
.content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
Tables with headers in them are impossible without dropping down to raw HTML. This is considered unlikely, especially since it looks weird right now (`.docblock h2` has an underline that is redundant with the table cell's own border).
.content tr:first-child td { border-top: 0; }
This has no effect because of border collapsing.
This rule is removed, because tables look fine without it
---------------------------------------------------------
.content td:first-child { padding-right: 20px; }
By removing this rule, the first cell in each row has the same padding as all other cells in the row.
This rule is kept, and converted to directly target `.docblock`
---------------------------------------------------------------
.content td { vertical-align: top; }
Removing this rule would cause it to be aligned to the middle instead.
rustdoc: remove redundant CSS `.out-of-band > span.since { position }`
At the time this CSS was added, it was just `span.since`, because the version info could be rendered in two different ways:
1. `<div class='since'>` was used for associated items like methods. It was absolutely positioned, and the selector in rustdoc.css that targetted it was just `.since`.
a5a2f2b951/src/librustdoc/html/static/rustdoc.css (L522-L529)
2. `<span class='since'>` was introduced in a5a2f2b951ea982a666eaf52b1874d8f1b17290b for page-global version info, so that it could be laid out alongside the `[-]`/`[+]` button. This CSS rule was added to override the absolute position introduced in (1).
a5a2f2b951/src/librustdoc/html/static/rustdoc.css (L637-L641)
The selector was changed in 8fc6e420d16dc882f2047e6ec1b981cac5ef0d14 so that everything could use a `<span>` tag, but the dichotomy of the absolutely-positioned version info for associated items and the static positioned item version info remained.
The absolutely positioned `.since` was changed to one nested below a `<div class="rightside">` container in 5de1391b88007a1d4f7b1517657a86aae352af1e, so the version information is now always statically-positioned, and, as described in the commit message, "their DOM representation is consistent."
Emit a note that static bounds from HRTBs are a bug
This note isn't perfect, but opening this to either 1) land as is or 2) get some feedback on how to improve it
Let r? `@compiler-errors` and cc. `@nikomatsakis`
Add support for MIPS VZ ISA extension
[Link to relevant LLVM line where virt extension is specified](83fab8cee9/llvm/lib/Target/Mips/Mips.td (L172-L173))
This has been tested on mips-unknown-linux-musl with a target-cpu that is >= MIPS32 5 and `target-features=+virt`. The example was checked in a disassembler to ensure the correct assembly sequence was being generated using the virtualization instructions.
Needed additional work:
* MIPS is missing from [the Rust reference CPU feature lists](https://doc.rust-lang.org/reference/attributes/codegen.html#available-features)
Example docs for later:
```md
#### `mips` or `mips64`
This platform requires that `#[target_feature]` is only applied to [`unsafe`
functions][unsafe function]. This target's feature support is currently unstable
and must be enabled by `#![feature(mips_target_feature)]` ([Issue #44839])
[Issue #44839]: https://github.com/rust-lang/rust/issues/44839
Further documentation on these features can be found in the [MIPS Instruction Set
Reference Manual], or elsewhere on [mips.com].
[MIPS Instruction Set Reference Manual]: https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00086-2B-MIPS32BIS-AFP-6.06.pdf
[developer.arm.com]: https://www.mips.com/products/architectures/ase/
Feature | Implicitly Enables | Description
---------------|--------------------|-------------------
`fp64` | | 64-bit Floating Point
`msa` | | "MIPS SIMD Architecture"
`virt` | | Virtualization instructions (VZ ASE)
```
If the above is good I can also submit a PR for that if there's interest in documenting it while it's still unstable. Otherwise that can be dropped, I just wrote it before realizing it was possibly not a good idea.
Relevant to #44839
Simplify caching and storage for queries
I highly recommend reviewing commit-by-commit; each individual commit is quite small but it can be hard to see looking at the overall diff that the behavior is the same. Each commit depends on the previous.
r? `@cjgillot`