rustdoc: remove no-op CSS `#source-sidebar { z-index }`
This rule became redundant in 07e3f998b1. When `#source-sidebar` became nested below `.sidebar`, it went from being `position: fixed` to `position: static`, and according to MDN's [z-index] documentation, this means it has no effect.
[z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
Add const_closure, Constify Try trait
Adds a struct for creating const `FnMut` closures (for now just copy pasted form my [const_closure](https://crates.io/crates/const_closure) crate).
I'm not sure if this way is how it should be done.
The `ConstFnClosure` and `ConstFnOnceClosure` structs can probably also be entirely removed.
This is then used to constify the try trait.
Not sure if i should add const_closure in its own pr and maybe make it public behind a perma-unstable feature gate.
cc ```@fee1-dead``` ```@rust-lang/wg-const-eval```
resolve: Set effective visibilities for imports more precisely
Instead of setting them for all primary and additional IDs of the import, only set them for the binding's true ID.
Refactor some `std` code that works with pointer offstes
This PR replaces `pointer::offset` in standard library with `pointer::add` and `pointer::sub`, [re]moving some casts and using `.addr()` while we are at it.
This is a more complicated refactor than all other sibling PRs, so take a closer look when reviewing, please 😃 (though I've checked this multiple times and it looks fine).
r? ````@scottmcm````
_split off from #100746, continuation of #100822_
Add `#[inline]` to trivial functions on `core::sync::Exclusive`
When optimizing for size things like these sometimes don't inlined even though they're generic. This is bad because they're no-ops.
Only dodgy one is poll I guess since it forwards to the inner poll, but it's not like we're doing `#[inline(always)]` here.
Document some missing command-line arguments
The rustc command-line arguments docs should document all of the stable arguments for rustc. Two were missing, `--force-warn` which was somewhat documented in the lint-levels chapter, but should also include a mention in the arguments list. `--diagnostic-width` was stabilized in #95635, but the docs weren't updated.
Improve rustdoc GUI tests
I finally finished the update so we can now store values in variables and use them. It improves things nicely.
r? ``@notriddle``
Update doc after renaming `fn is_zero`
`fn is_zero` has been renamed to `fn count_is_zero` in 1b1bf24636.
This patch updates the documentation accordingly.
Add `llvm-dis` to the set of tools in `ci-llvm`
The LLVM disassembler is needed for the test introduced in https://github.com/rust-lang/rust/pull/97550.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Remove `RtlGenRandom` (take two)
First try to use the system preferred RNG but if that fails (e.g. due to a broken system configuration) then fallback to manually opening an algorithm handle.
Use internal iteration in `Iterator` comparison methods
Updates the `Iterator` methods `cmp_by`, `partial_cmp_by`, and `eq_by` to use internal iteration on `self`. I've also extracted their shared logic into a private helper function `iter_compare`, which will either short-circuit once the comparison result is known or return the comparison of the lengths of the iterators.
This change also indirectly benefits calls to `cmp`, `partial_cmp`, `eq`, `lt`, `le`, `gt`, and `ge`.
Unsurprising benchmark results: iterators that benefit from internal iteration (like `Chain`) see a speedup, while other iterators are unaffected.
```
name before ns/iter after ns/iter diff ns/iter diff % speedup
iter::bench_chain_partial_cmp 208,301 54,978 -153,323 -73.61% x 3.79
iter::bench_partial_cmp 55,527 55,702 175 0.32% x 1.00
iter::bench_lt 55,502 55,322 -180 -0.32% x 1.00
```
Always print '_, even for erased lifetimes.
Explicit lifetime arguments are now the recommended syntax in rust 2018 and rust 2021. This PR applies this discipline to rustc itself.
This rule became redundant in 07e3f998b1.
When `#source-sidebar` became nested below `.sidebar`, it went from being
`position: fixed` to `position: static`, and according to MDN's [z-index]
documentation, this means it has no effect.
[z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
This rule became redundant in 07e3f998b1.
When `#source-sidebar` became nested below `.sidebar`, it went from being
`position: fixed` to `position: static`, and according to MDN's [z-index]
documentation, this means it has no effect.
[z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
This commit makes the `width` and `min-width` of the sidebar the same. They
originally were when cad0fce205 added the
`min-width` rule, but 6a5f8b1aef changed the
width without changing the `min-width`, causing it to sometimes oscilate
between 200 and 250 pixels depending on the main content.
Fix a typo in `std`'s root docs
Remarkably, this typo has been present for *seven years.* I was so surprised that I reread the text five times and then asked people on the rust Zulip to double-check. :)