Rollup of 6 pull requests
Successful merges:
- #102300 (Use a macro to not have to copy-paste `ConstFnMutClosure::new(&mut fold, NeverShortCircuit::wrap_mut_2_imp)).0` everywhere)
- #102475 (unsafe keyword: trait examples and unsafe_op_in_unsafe_fn update)
- #102760 (Avoid repeated re-initialization of the BufReader buffer)
- #102764 (Check `WhereClauseReferencesSelf` after all other object safety checks)
- #102779 (Fix `type_of` ICE)
- #102780 (run Miri CI when std::sys changes)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (#1477)
- Update running tests with the new flags (#1476)
- Rename typeck to hir_analysis (#1475)
- fix typo and make paragraph consistent (#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos
Update motivated in large part by the most recent commit, to fix `git
grep`.
Check `WhereClauseReferencesSelf` after all other object safety checks
This fixes the ICE because it causes us to detect another *non-lint* `MethodViolationCode` first, instead of breaking on `WhereClauseReferencesSelf`.
We could also approach this issue by instead returning a vector of *all* of the `MethodViolationCode`s, and just reporting the first one we see, but treating it as a hard error if we return both `WhereClauseReferencesSelf` and some other violation code -- let me know if this is desired.
Fixes#102762
Avoid repeated re-initialization of the BufReader buffer
Fixes https://github.com/rust-lang/rust/issues/102727
We accidentally removed this in https://github.com/rust-lang/rust/pull/98748. It looks so redundant. But it isn't.
The default `Read::read_buf` will defensively initialize the whole buffer, if any of it is indicated to be uninitialized. In uses where reads from the wrapped `Read` impl completely fill the `BufReader`, `initialized` and `filled` are the same, and this extra member isn't required. But in the reported issue, the `BufReader` wraps a `Read` impl which will _never_ fill the whole buffer. So the default `Read::read_buf` implementation repeatedly re-initializes the extra space in the buffer.
This adds back the extra `initialized` member, which ensures that the default `Read::read_buf` only zero-initialized the buffer once, and I've tried to add a comment which explains this whole situation.
unsafe keyword: trait examples and unsafe_op_in_unsafe_fn update
Having a safe `fn` in an `unsafe trait` vs an `unsafe fn` in a safe `trait` are pretty different situations, but the distinction is subtle and can confuse even seasoned Rust developers. So let's have explicit examples of both. I also removed the existing `unsafe trait` example since it was rather strange.
Also the `unsafe_op_in_unsafe_fn` lint can help disentangle the two sides of `unsafe`, so update the docs to account for that.
Use a macro to not have to copy-paste `ConstFnMutClosure::new(&mut fold, NeverShortCircuit::wrap_mut_2_imp)).0` everywhere
Also use that macro to replace a bunch of places that had custom closure-wrappers.
+35 -114 sounds good to me.
- UPDATE - revert migration of logs
- UPDATE - use derive on LinkRlibError enum
- [Gardening] UPDATE - alphabetically sort fluent_messages
- UPDATE - use PathBuf and unify both AddNativeLibrary to use Display (which is what PathBuf uses when conforming to IntoDiagnosticArg)
- UPDATE - fluent messages sort after rebase
Remove `TypeckResults` from `InferCtxt`
`InferCtxt` currently has `in_progress_typeck_results` which is only used for some diagnostics during typeck. It adds a lifetime which propagates through a lot of code. This PR moves that field into a new helper struct `TypeErrCtxt`.
fix: Make go-to-def work for `#[doc = include_str!("path")]`
See the added test, go-to-def on `#[doc = include_str!("path$0")]` should navigate to `path`.
let-else: test else block with non-never uninhabited type
let else currently does not allow uninhabited types for the `else` block that aren't `!`. One can maybe think about relaxing this in the future, but if it is done, it should be an explicit choice and not an unexpected side effect of e.g. a refactor. Thus, I'm extending a test that will fail if the behaviour changes.
Disable compressed debug sections on i586-gnu
Compressed debug is enabled by default for gas (assembly) on Linux/x86
targets, and we started building our own in #102530, but that made our
`compiler_builtins` incompatible with binutils < 2.32. Add an explicit
option to disable that in our crosstool-ng config. Fixes#102703.
rustdoc: remove unused CSS `.docblock a:not(.srclink)`
This selector was added in c7312fbae4, because the list of impl items could be nested below `docblock`.
c7312fbae4/src/librustdoc/html/render.rs (L3841-L3845)
Now that rustdoc toggles have been switched to `<details>`, there shouldn't be any need to put things inside docblock containers just to give them disclosure toggles.
rustdoc: remove unused CSS `.content .item-list`
When these rules were added in 4fd061c426 (yeah, that's the very first commit of rustdoc_ng), `.item-list` was a `<ul>`, and this would override the default style for that tag.
In c1b1d6804b, it was changed to use a `<div>` tag, so these rules are both no-ops.