This uses exactly the same types for query results as `typeck`, which doesn't have custom code.
It's not clear to me why this code exists (it goes back even before queries used a proc macro),
but it compiles fine without the custom loader. Remove it for simplicity.
In practice, it was only ever used with `ArenaCacheSelector`. Change it to a single boolean
`arena_cache` rather than allowing queries to specify an arbitrary type.
Rollup of 5 pull requests
Successful merges:
- #101475 (Use futex-based locks and thread parker on Hermit)
- #101492 (Suggest adding array lengths to references to arrays if possible)
- #101495 (Compile spin_loop_hint as pause on x86 even without sse2 enabled)
- #101529 (Fix the example code and doctest for Formatter::sign_plus)
- #101600 (rustdoc: simplify the codeblock tooltip)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
rustdoc: simplify the codeblock tooltip
**https://github.com/rust-lang/rust/pull/101593 needs merged first**
This PR moves the tooltip into example-wrap, simplifying several overly-complex aspects of how these tooltips work:
* The mousover javascript can be removed, because hovering example-wrap can style the tooltip inside.
* The sibling selecor can be removed, because hovering the tooltip also hovers the wrapper, which can hover the codeblock itself.
* The relative positioning of the `<li>` tag, which was added in e861efd9f9 to fix the positioning of the code tooltip, can now be removed, because example-wrap itself already has relative positioning.
Fix the example code and doctest for Formatter::sign_plus
The provided example to the `sign_plus` method on `fmt` was broken, it displays the `-` sign twice for negative numbers.
This pull request should fix the issue by `.abs()` ing the number so that the negative sign appears only once. It is just one possible solution to the issue, not sure if it's the best. However, this one will behave as expected when combined with fill and alignment operators.
Compile spin_loop_hint as pause on x86 even without sse2 enabled
The x86 `pause` instruction was introduced with sse2, but because it is encoded as `rep nop`, it works just fine on cpu's without sse2 support. It just doesn't do anything.
Use futex-based locks and thread parker on Hermit
[Hermit now has futex syscalls](https://github.com/hermitcore/libhermit-rs/pull/534), which means Hermit can share the well-tested and performant locks and thread parker used on Linux.
Ping `@mkroening,` `@stlankes`
r? `@m-ou-se`
This commit moves the tooltip into example-wrap, simplifying allowing several
overly-complex things to be fixed:
* The mousover javascript can be removed, because hovering example-wrap can
style the tooltip inside.
* The sibling selecor can be removed, because hovering the tooltip also
hovers the wrapper, which can hover the codeblock itself.
* The relative positioning of the `<li>` tag, which was added in
e861efd9f9 to fix the positioning of the code
tooltip, can now be removed, because example-wrap itself already has
relative positioning.
Update LLVM used in x86 CI dist builds to `15.0.0`
LLVM 15.0.0 has been released, so we can use it in CI builds. We need (at least) LLVM 15 for BOLT, and we regularly update to most recent stable versions. It would also be good to first see the perf. effect of upgrading by itself, to have a better baseline for BOLT.
r? `@Mark-Simulacrum`
Cleanup themes (tooltip)
No changes in the UI. I used this opportunity to unify the dark theme with the others for the alpha parameter though.
r? `@notriddle`
Tweak future opaque ty pretty printing
1. The `Return` type of a generator doesn't need to be a lang item just for diagnostic printing of types
2. We shouldn't suppress the `Output = Ty` of a opaque future if the type is a int or float var.
Initial implementation of return-position `impl Trait` in traits
* Create a new item kind, called `ImplTraitPlaceholder`, which is used to lower `ast::TyKind::ImplTrait` in trait method returns.
* This item is the child of the trait method, which simplifies the way we calculate bounds and stuff.
* Use the def-id of this type to construct a projection type that we use during astconv for the return type of the trait method signature.
* Implement logic to normalize this `ImplTraitPlaceholder` projection type when we know its concrete impl (this is pretty limited currently, but really there are no other selection candidates that make sense -- for now!)
* Check that the `impl Trait`'s bounds are satisfied on the concrete type provided in the impl.
This is obviously nowhere near complete, but I wanted to at least get some initial support landed so we can start playing around with it.
What works:
* async fn in trait and RPITIT, including multiple `impl Trait`s and `impl Trait` nested in associated type bindings, like `impl Future<Output = impl Sized>`
Reimplement `carrying_add` and `borrowing_sub` for signed integers.
As per the discussion in #85532, this PR reimplements `carrying_add` and `borrowing_sub` for signed integers.
It also adds unit tests for both unsigned and signed integers, emphasing on the behaviours of the methods.
Make `Debug` impl for `Term` useful
because `Term { ptr: 78942378998734298342, maker: PhantomData, }` does not excel at communicating the necessary information
rustdoc: remove unused CSS `div.impl-items > div`
This was added in 9077d540da to override the style on `<div>` tags that were acting as headers. These `<div>` tags were replaced with `<section>` tags in 32f62607c3, but this CSS was probably already redundant even then (the headers had already been replaced with real `<h3>` and `<h4>` tags in 76a3b609d0).
rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`
This was added in 51f26acaea to help with the display of an `<h3>` tag that has a `<span class='in-band'>` inside.
The way implementation lists were rendered was changed in 34bd2b845b to have `<code class='in-band'>`, making this CSS unused.
Then it was turned into a `<div>` in 9077d540da without issue.
Finally, the header itself acquired the `in-band` class in 76a3b609d0.