Update books
## rust-lang/book
1 commits in 39aeceaa3aeab845bc4517e7a44e48727d3b9dbe..05d114287b7d6f6c9253d5242540f00fbd6172ab
2026-02-03 15:19:04 UTC to 2026-02-03 15:19:04 UTC
- Temporarily remove the link to `Drop::drop` (rust-lang/book#4576)
## rust-lang/nomicon
1 commits in 050c002a360fa45b701ea34feed7a860dc8a41bf..b8f254a991b8b7e8f704527f0d4f343a4697dfa9
2026-01-29 12:15:01 UTC to 2026-01-29 12:15:01 UTC
- Fix deprecation warning for compare_and_swap in atomics.md (rust-lang/nomicon#519)
## rust-lang/reference
12 commits in 990819b86c22bbf538c0526f0287670f3dc1a67a..addd0602c819b6526b9cc97653b0fadca395528c
2026-02-04 14:35:59 UTC to 2026-01-26 18:02:14 UTC
- const-eval.const-expr.field: make paragraph more clear (rust-lang/reference#2157)
- make more clear what the link target is (rust-lang/reference#2156)
- Update two URLs (rust-lang/reference#2154)
- Add a chapter on divergence (rust-lang/reference#2067)
- Guarantee `repr(C)` union field offset (rust-lang/reference#2128)
- Reference updates for forbidding object lifetime changing pointer casts (rust-lang/reference#1951)
- Clarify only arrays undergo unsized coercion during dispatch (rust-lang/reference#2139)
- Split the textual chapter into separate char and str chapters (rust-lang/reference#2145)
- Document ppc inline asm support (rust-lang/reference#2056)
- Unwrap items, expressions, patterns, and types (rust-lang/reference#2141)
- undefined behavior: add missing plural in `undefined.misaligned.ptr` (rust-lang/reference#2146)
- inline-assembly: add a space to the `asm.abi-clobbers.many` example (rust-lang/reference#2144)
BikeshedGuaranteedNoDrop trait: add comments indicating that it can be observed on stable
Not sure if that's worth it, maybe this goes without saying for all these builtin traits?
style: remove unneeded trailing commas
Make format-like macro calls look similar to what `cargo fmt` does automatically - remove trailing commas. When removing a comma, I also inlined some variables for consistency and clarity.
I'm working on a [clippy lint](https://github.com/rust-lang/rust-clippy/pull/16530) to make this process automatic.
Move more query system code
Towards the goal of eliminating `rustc_query_system`, this commit moves some code from `rustc_query_system` to `rustc_middle` and `rustc_query_impl`, and from `rustc_middle` to `rustc_query_impl`.
r? @Zalathar
Clean up query macros for `cache_on_disk_if`
This PR aims to make the macros for dealing with `cache_on_disk_if` a bit easier to read and work with.
There should be no change to compiler behaviour.
Handle race when coloring nodes concurrently as both green and red
This fixes a race where a duplicate dep node gets written to the dep graph if a node was marked as green and promoted during execution, then marked as red after execution.
This can occur when a `no_hash` query A depends on a query B which cannot be forced so it was not colored when starting execution of query A. During the execution of query A it will execute query B and color it green. Before A finishes another thread tries to mark A green, this time succeeding as B is now green, and A gets promoted and written to metadata. Execution of A then finishes and because it's `no_hash` we assume the result changed and thus we color the node again, now as red and write it to metadata again. This doesn't happen with non-`no_hash` queries as they will be green if all their dependencies are green.
This changes the code coloring nodes red to also use `compare_exchange` to deal with this race ensuring that the coloring of nodes only happens once.
Fixesrust-lang/rust#150018Fixesrust-lang/rust#142778Fixesrust-lang/rust#141540
Rollup of 10 pull requests
Successful merges:
- rust-lang/rust#152364 (Port a lot of attributes to the new parser)
- rust-lang/rust#151954 (Add help message suggesting explicit reference cast for From/TryFrom)
- rust-lang/rust#152148 (Move `impl Interner for TyCtxt` to its own submodule)
- rust-lang/rust#152226 (Modernize diagnostic for indeterminate trait object lifetime bounds)
- rust-lang/rust#152351 (Remove `SubdiagMessage` in favour of the identical `DiagMessage`)
- rust-lang/rust#152417 (Move the needs-drop check for `arena_cache` queries out of macro code)
- rust-lang/rust#150688 (typeck: Make it clearer that `check_pat_lit` only handles literal patterns)
- rust-lang/rust#152293 (Format heterogeneous try blocks)
- rust-lang/rust#152355 (Update documentation of rustc_macros)
- rust-lang/rust#152396 (Uplift `Predicate::allow_normalization` to `rustc_type_ir`)
Format heterogeneous try blocks
The tracking issue for `try_blocks_heterogeneous` is https://github.com/rust-lang/rust/issues/149488.
This follows the formatting of homogeneous try blocks (feature `try_blocks`) by considering `try bikeshed <type>` to be the equivalent of `try` (in particular a single "token").
An alternative would be to permit breaking between `bikeshed` and `<type>`, but given that those 2 elements are an explicitly temporary part of the syntax, it doesn't seem worth it. There also doesn't seem to be any existing precedent breaking between a keyword and a type. It also doesn't seem to be useful in practice, given that the type itself doesn't break (which is how it works for the return type of closures) and has more chances to dominate the length in case a break is necessary.
Happy to adapt anything in case this formatting is not optimal.
The test is also copied from homogeneous try blocks with 2 additional test cases to demonstrate the behavior with long types.
See [#t-lang > try blocks @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/try.20blocks/near/572387493) for context.
typeck: Make it clearer that `check_pat_lit` only handles literal patterns
Nowadays, the `hir::PatExprKind` enum guarantees that “expressions” in patterns can only be paths or literals.
`PatExprKind::Path` is already handled by the previous match arm, so we can make this match arm explicitly match on `PatExprKind::Lit` without losing exhaustiveness.
There should be no actual change to compiler behaviour.
Move the needs-drop check for `arena_cache` queries out of macro code
This is slightly simpler than before, because now the macro only needs to call a single function, and can just unconditionally supply `tcx` and a typed arena.
There should be no actual change to compiler behaviour.
Remove `SubdiagMessage` in favour of the identical `DiagMessage`
For https://github.com/rust-lang/rust/issues/151366
Just some more cleanup :)
SubdiagMessage is now identical to DiagMessage, so there's no point in having both of them
Modernize diagnostic for indeterminate trait object lifetime bounds
* remove suggestion from the diagnostic message (bad style, too long) and turn it into a structured suggestion
* replace *object type* with *trait object type* since the former is an outdated term
Move `impl Interner for TyCtxt` to its own submodule
This impl is several hundred lines of mostly self-contained, mostly boilerplate code that can be extracted out of the dauntingly large `rustc_middle::ty::context` module.
- The trait and its impl were introduced by https://github.com/rust-lang/rust/pull/97287.
---
There should be no change to compiler behaviour.
Add help message suggesting explicit reference cast for From/TryFrom
Closesrust-lang/rust#109829
Improves E0277 diagnostics when a `From` or `TryFrom` implementation is expected, but the provided type is a reference that can be explicitly cast to a type the trait can convert from.
The latter is a new module.
As well as the code motion, some other changes were required.
- `QueryJobId` methods became free functions so they could move while
`QueryJobId` itself stayed put. This was so `QueryMap` and
`QueryJobInfo` could be moved.
- Some visibilities in `rustc_query_system` required changing.
- `collect_active_jobs_from_all_queries` is no longer required in `trait
QueryContext`.