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.
Rollup of 7 pull requests
Successful merges:
- #98933 (Opaque types' generic params do not imply anything about their hidden type's lifetimes)
- #101041 (translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2)
- #101424 (Adjust and slightly generalize operator error suggestion)
- #101496 (Allow lower_lifetime_binder receive a closure)
- #101501 (Allow lint passes to be bound by `TyCtxt`)
- #101515 (Recover from typo where == is used in place of =)
- #101545 (Remove unnecessary `PartialOrd` and `Ord`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Allow lint passes to be bound by `TyCtxt`
This will allow storing things like `Ty<'tcx>` inside late lint passes. It's already possible to store various id types so they're already implicitly bound to a specific `TyCtxt`.
r? rust-lang/compiler
Adjust and slightly generalize operator error suggestion
(in no particular order)
* Stop passing around a whole extra `ProjectionPredicate`
* Add spaces around `=` in `Trait<..., Output = Ty>` suggestion
* Some code clean-ups, including
* add `lang_item_for_op` to turn a `Op` into a `DefId`
* avoid `SourceMap` because we don't really need to render an expr
* Remove `TypeParamVisitor` in favor of just checking `ty.has_param_types_or_consts` -- this acts a bit differently, but shouldn't cause erroneous suggestions (actually might generalize them a bit)
* We now suggest `Output = Ty` in the `where` clause suggestion when we fail to add `Struct<T>` and `T`.
I can split this out into more PRs if needed, but they're all just miscellaneous generalizations, changes, and nitpicks I saw when messing with this operator code.
translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2
# Description
This is the second part of the `rustc_session` [migration](https://github.com/rust-lang/rust/issues/100717#issuecomment-1220279883).
**Please only review this [commit](5018581957) that belongs to the part 2. The other ones are from the PR [#100753](https://github.com/rust-lang/rust/pull/100753) that is not yet merged.**
In this PR, we migrate the files `session.rs` and `config.rs`.
Please not that we have to `allow` the lints rules in some functions from `session.rs` because they are (at least I believe) part of the diagnostic machinery.
const_generics: correctly deal with bound variables
removes the hack in `resolve` which was needed because we evaluated constants without caring about their bound variables.
Each commit should be fairly self-contained, even if they build on each other
r? `@jackh726`
Rollup of 6 pull requests
Successful merges:
- #101153 (Migrate another part of rustc_infer to session diagnostic)
- #101399 (Shrink span for bindings with subpatterns.)
- #101422 (Hermit: Add File::set_time stub)
- #101455 (Avoid UB in the Windows filesystem code in... bootstrap?)
- #101498 (rustc: Parameterize `ty::Visibility` over used ID)
- #101549 (Use HashStable_Generic in rustc_type_ir)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
This commit removes the allows rules for the SessionDiagnostic lint
that were being used in the session.rs file.
Thanks to the PR #101230 we do not need to annotate the methods with
the allow rule as they are part of the diagnostic machinery.
Use HashStable_Generic in rustc_type_ir
A lot of the types in this crate implemented HashStable directly to avoid circular dependencies. One way around that is to use HashStable_Generic. We adopt that here to avoid a lot of boilerplate.
This doesn't update all the types, because some would require `I: Interner + HashStable`.
r? `@cjgillot`
rustc: Parameterize `ty::Visibility` over used ID
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
Avoid UB in the Windows filesystem code in... bootstrap?
This basically a subset of the changes from https://github.com/rust-lang/rust/pull/101171. I didn't think to look in src/bootstrap for more windows filesystem API usage, which was apparently a mistake on my part. It's kinda goofy that stuff like this is in here, but what are you gonna do, computers are awful.
I also added `winbase` to the `winapi` dep -- I tested this in a tmp crate but needed to add this to your Cargo.toml -- you `use winapi::stuff::winbase` in this function, but are relying on something else turning on that feature.
Shrink span for bindings with subpatterns.
Bindings with nested patterns (`binding @ pat` syntax) currently point to the full pattern. This PR proposes to shrink the span to stop before the ````@`.``` This makes the diagnostics for move/mutability conflicts clearer, as they not point to the `binding` only, instead of the full pat.
r? ```@estebank```
Migrate another part of rustc_infer to session diagnostic
Probably will migrate another file before marking this one as ready-to-merge.
`@rustbot` label +A-translation
r? rust-lang/diagnostics
cc https://github.com/rust-lang/rust/issues/100717
This shrinks `hir::Ty` from 72 to 48 bytes.
`visit_lifetime` is added to the HIR stats collector because these types
are now stored in memory on their own, instead of being within other
types.
Fix `-Zgcc-ld=lld`
`-Zgcc-ld=lld` is currently broken. CI is currently ignoring its tests.
cc `@Mark-Simulacrum` on the `compiletest` change: I'm not sure which of `bootstrap`'s test step or `compiletest` is currently incorrect wrt windows' `--compile-lib-path`. Since `sysroot/bin` is passed on windows, that means that `compiletest` can't find `rust-lld` on windows and tests are currently ignored: it's looking for something that is in `sysroot/lib` instead.
They are currently ignored on unixes for a different reason: the lld wrapper has a different name than what is checked.
(I've changed `compiletest` in this PR, just because I could make a very targeted change there, whereas completely changing the intentional lib path that is passed seemed it'd have wider reaching implications on all tests.)
And in both unix/win cases, I've changed the detection to look for `rust-lld` rather than the wrappers in `bin/gcc-ld/`. It seems like the more stable of all these executable names.
r? `@petrochenkov`
I've tested the `lld-wrapper` change on linux and osx, but couldn't test on windows gnu targets (I only have MSVC targets, and these can't use `rust-lld` via `-Zgcc-ld=lld`, nor do they use the lld wrapper IIUC).
I'd expect it to work whether or not the wrapper is called with or without an executable suffix. But at least now CI should test it in these targets.
Fixes#101370.
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.
A lot of the types in this crate implemented HashStable directly to
avoid circular dependencies. One way around that is to use
HashStable_Generic. We adopt that here to avoid a lot of boilerplate.
This doesn't update all the types, because some would require
`I: Interner + HashStable`.