Update books
## rust-lang/nomicon
1 commits in 3ff384320598bbe8d8cfe5cb8f18f78a3a3e6b15..57ed4473660565d9357fcae176b358d7e8724ebf
2025-08-18 17:31:07 UTC to 2025-08-18 17:31:07 UTC
- Fix unknown field `author` error when building the book (rust-lang/nomicon#500)
## rust-lang/reference
11 commits in 59b8af811886313577615c2cf0e045f01faed88b..89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769
2025-08-22 07:16:52 UTC to 2025-08-14 18:42:19 UTC
- Update `instruction_set` to use the attribute template (rust-lang/reference#1912)
- Update `debugger_visualizer` to use the attribute template (rust-lang/reference#1922)
- Update `collapse_debuginfo` to use the attribute template (rust-lang/reference#1923)
- Clarify operand evaluation order in compound assignment with primitiv… (rust-lang/reference#1941)
- Switch to using native mdbook fragment redirects (rust-lang/reference#1965)
- Fix traits implemented for function items (rust-lang/reference#1969)
- Clarify that safe extern items do not require unsafe (rust-lang/reference#1970)
- Update `type_length_limit` to use the attribute template (rust-lang/reference#1917)
- Add missing rule identifier for const outer generics (rust-lang/reference#1962)
- Fix indentation of static path restriction text (rust-lang/reference#1961)
- Add doc for `sse4a` and `tbm` (rust-lang/reference#1949)
## rust-lang/rust-by-example
2 commits in adc1f3b9012ad3255eea2054ca30596a953d053d..ad27f82c18464525c761a4a8db2e01785da59e1f
2025-08-20 23:50:16 UTC to 2025-08-13 21:41:46 UTC
- Support building books using mdbook in main (v0.5.x) (rust-lang/rust-by-example#1952)
- Improve the hints in `fmt` (1.2.3. Formatting); mention type casting (rust-lang/rust-by-example#1951)
Make `x test distcheck` self-contained
Before, the checked components were extracted under the checked out source root, which caused us to test some weird combination of tarball + checkout sources/aritfacts/configuration.
Now `x test distcheck` works with an external temporary directory instead, which should make it self-contained. I also moved some config from the Dockerfile to the test itself, and fixed an issue in tidy that caused `x test tidy` to fail on tarball sources.
I also removed `.args(&builder.config.configure_args)`, because it was passing all kinds of crap from the CI config to the distcheck step, which was making it less reproducible.
Fixes: https://github.com/rust-lang/rust/issues/145183
r? ```@jieyouxu```
try-job: x86_64-gnu-distcheck
compiletest: if a compiler fails, show its output
Before, when working on something like a `rustdoc-js` test, if you made a syntax error in a rust file, you would not get that error output unless you ran with `--verbose`, which would also cause an enormous amount of other output to be printed as well. This can also lead to frustration in new contributors who don't think to run with `--verbose`.
Now, if rustc or rustdoc is run by compiletest and produces an non-zero exit code, its output will be printed.
test(rustfmt): Verify frontmatter is preserved
This is to prove that the frontmatter is preserved.
The choices in tests is intended for showing the different parts of the proposed Style Guide for frontmatters (rust-lang/rust#145617).
While rustfmt is developed in a different repo, work involving upstream integration is blocked on some work that is being finished up in that repo. I was told that it would be ok to post against this repo in the mean time.
Tracking issue: rust-lang/rust#136889
make rustdoc::invalid_html_tags more robust
best reviewed a commit at a time.
I kept finding more edge case so I ended up having to make quite significant changes to the parser in order to make it preserve state across events and handle multiline attributes correctly.
fixesrust-lang/rust#145529
Implement some more checks in `ptr_guaranteed_cmp`.
* Pointers with different residues modulo their allocations' least common alignment are never equal.
* Pointers to the same static allocation are equal if and only if they have the same offset.
* Pointers to different non-zero-sized static allocations are unequal if both point within their allocation, and not on opposite ends.
Tracking issue for `const_raw_ptr_comparison`: <https://github.com/rust-lang/rust/issues/53020>
This should not affect `is_null`, the only usage of this intrinsic on stable.
Closes https://github.com/rust-lang/rust/issues/144584
Allow linking a prebuilt optimized compiler-rt builtins library
Extend the <target>.optimized-compiler-builtins bootstrap option to accept a path to a prebuilt compiler-rt builtins library, and update compiler-builtins to enable optimized builtins without building compiler-rt builtins.
This commit implements more conformant, more comprehensive RISC-V ELF
flags handling when generating certain object files directly from rustc.
* Use "zca" instead of "c"
The "Zca" extension (a subset of "C") is the minimal configuration
for compressed instructions to set `EF_RISCV_RVC` flag.
* Set TSO flag from "ztso"
The "Ztso" extension denotes that the program depends on the RVTSO
(Total Store Ordering) memory consistency model, which is stronger
than the standard RVWMO (Weak Memory Ordering) consistency model and
on ELF targets, we need to set `EF_RISCV_TSO` flag.
The underlying implementation of `LLVMCreateConstantRangeAttribute` assumes
that each of `LowerWords` and `UpperWords` points to enough u64 values to
define an integer of the specified bit-length, and will encounter UB if that is
not the case.
Our safe wrapper function always passes pointers to `[u64; 2]` arrays,
regardless of the bit-length specified. That's fine in practice, because scalar
primitives never exceed 128 bits, but it is technically a soundness hole in a
safe function.
We can close the soundness hole by explicitly asserting `size_bits <= 128`.
This is effectively just a stricter version of the existing check that the
value must be small enough to fit in `c_uint`.
Having `const fn`s that take a `mut &` was unstable until Rust 1.83. Because of
this, not all methods on `FormattingOptions` were implemented as `const`. As
this has been stabilized now, there is no reason not to have all methods
`const`.
Thanks to Ternvein for bringing this to my attention (see [1]).
[1]: https://github.com/rust-lang/rust/issues/118117#issuecomment-2687470635
Support non-defining uses in HIR typeck
This changes the impl of `NormalizesTo` for opaque types to be structural during HIR typeck. The previous impl equated region variables of the opaque type key with existing entries which can result in spurious leak check errors and also results in mismatches with MIR borrowck, theoretically causing ICE.
The approach is very similar to rust-lang/rust#145244 in MIR typeck:
- we collect all uses of opaque types during HIR typeck
- before writeback, we search for *defining uses*
- the opaque type key has fully universal generic args modulo regions
- the hidden type has no infer vars
- we use these defining uses to compute the concrete type for the opaque and map it to the definition site
- we use this concrete type to check the type of all uses of opaques during HIR typeck. This also constrains infer vars in non-defining uses
Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/135, fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/49.
r? `@BoxyUwU`
This internal crate explicitly separates itself from the `rustc`
workspace, but it is needed for `./x test clippy` to work, including its
dependencies when building from a vendored `rustc-src` tarball.
Create a dedicated enum to abstract the different ways compiler-builtins
can be configured.
This also relaxes build.optimized-compiler-builtins to accept the path
of a library to match the behavior of <target>.optimized-compiler-builtins
override.
Extend the <target>.optimized-compiler-builtins bootstrap option to accept a
path to a prebuilt compiler-rt builtins library, and update compiler-builtins
to enable optimized builtins without building compiler-rt builtins.
Enforce in bootstrap that dist and install must have stage at least 1
This is a continuation of my efforts to fix staging in bootstrap after the stage0 redesign. This PR gets rid of all `compiler_for` usages in the `dist` steps 🎉 The only remaining usages are in the `test` steps, which are my next goal, and which will be the final boss.. both because they are quite tricky, and because most of the the rest of the steps have been already fixed.
The changes are relatively straightforward, `x dist` defaults to stage 2, so in that case we want to use a stage 1 build compiler for everything (except stdlib, but we usually use it even there because of uplifting).
What I didn't fix yet are the docs steps, because they are *very* implicit right now, and fixing them deserves its own PR.
The first commit reverts the tests that I accidentally removed in https://github.com/rust-lang/rust/pull/145340🤦♂️ I did it in this PR to avoid further git conflicts..
Best reviewed commit-by-commit.
r? `@jieyouxu`
try-job: dist-i686-linux
try-job: dist-armhf-linux
try-job: dist-x86_64-linux
try-job: dist-x86_64-msvc
try-job: dist-apple-various
try-job: dist-x86_64-apple
try-job: x86_64-msvc-2