[rustdoc] Box ItemKind to reduce the size of `Item`
This brings the size of `Item` from
```
[src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 536
```
to
```
[src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 136
```
This is an alternative to https://github.com/rust-lang/rust/pull/79967; I don't think it makes sense to make both changes.
Helps with #79103.
Rollup of 11 pull requests
Successful merges:
- #80383 (clarify wrapping ptr arithmetic docs)
- #80390 (BTreeMap: rename the area access methods)
- #80393 (Add links to the source for the rustc and rustdoc books.)
- #80398 (Use raw version of align_of in rc data_offset)
- #80402 (Document `InferTy` & co.)
- #80403 (fix: small typo error in chalk/mod.rs)
- #80410 (rustdoc book: fix example)
- #80419 (Add regression test for #80375)
- #80430 (Add "length" as doc alias to len methods)
- #80431 (Add "chr" as doc alias to char::from_u32)
- #80448 (Fix stabilization version of deque_range feature.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
NatVis files describe how to display types in some Windows debuggers,
such as Visual Studio, WinDbg, and VS Code.
This commit makes several improvements:
* Adds visualizers for Rc<T>, Weak<T>, and Arc<T>.
* Changes [size] to [len], for consistency with the Rust API.
Visualizers often use [size] to mirror the size() method on C++ STL
collections.
* Several visualizers used the PVOID and ULONG typedefs. These are part
of the Windows API; they are not guaranteed to always be defined in a
pure Rust DLL/EXE. I converted PVOID to `void*` and `ULONG` to
`unsigned long`.
* Cosmetic change: Removed {} braces around the visualized display
for `Option` types. They now display simply as `Some(value)` or
`None`, which reflects what is written in source code.
* The visualizer for `alloc::string::String` makes assumptions about
the layout of `String` (it casts `String*` to another type), rather
than using symbolic expressions. This commit changes the visualizer
so that it simply uses symbolic expressions to access the string
data and string length.
Add "chr" as doc alias to char::from_u32
Many programming languages provide a function called `chr` - Perl, Python, PHP, Visual Basic, SQL. This change makes `char::from_u32` easier to discover in the documentation.
`ord` is not added as its name conflicts with `Ord` trait, and it's not exactly clear what it could point to (`<u32 as From<char>>::from`?). I don't think it's exactly necessary, as `char::from_u32` documentation page says you can do reverse conversion with `as` operator anyway.
Add "length" as doc alias to len methods
Currently when searching for `length` there are no results: https://doc.rust-lang.org/std/?search=length. This makes `len` methods appear when searching for `length`.
Add regression test for #80375
This will also make sure that #80375 is handled if #79135 has to be reverted (which won't happen 🤞).
Closes#80375.
r? `@lcnr`
Document `InferTy` & co.
I finally figured out what `TyVid` means! The name is quite opaque, so I
decided to document it and related types.
I don't know that much about `InferTy` & co., but I was able to *infer*
( :) ) from the names and what I know generally about type inference to
add some basic documentation.
Add links to the source for the rustc and rustdoc books.
This adds a little icon in the upper-right corner of the books so that readers can find the source if they want to make changes or file issues. This is already included in several of the other books.
Rollup of 11 pull requests
Successful merges:
- #79662 (Move some more code out of CodegenBackend::{codegen_crate,link})
- #79815 (Update RELEASES.md for 1.49.0)
- #80284 (Suggest fn ptr rather than fn item and suggest to use `Fn` trait bounds rather than the unique closure type in E0121)
- #80331 (Add more comments to trait queries)
- #80344 (use matches!() macro in more places)
- #80353 (BTreeMap: test split_off (and append) more thoroughly)
- #80362 (Document rustc_macros on nightly-rustc)
- #80399 (Remove FIXME in rustc_privacy)
- #80408 (Sync rustc_codegen_cranelift)
- #80411 (rustc_span: Remove `Symbol::with`)
- #80434 (bootstrap: put the component name in the tarball temp dir path)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
bootstrap: put the component name in the tarball temp dir path
This should not matter right now, but if we ever parallelize rustbuild this will avoid tarball contents being merged together.
r? `@Mark-Simulacrum`
Sync rustc_codegen_cranelift
The highlight of this sync are two JIT mode improvements. The first is that it is now possible to use JIT mode when using `-Zcodegen-backend` instead of the custom driver using `-Cllvm-args=mode=jit`. The second one is a new JIT mode that lazily compiles functions when they are called the first time: https://github.com/bjorn3/rustc_codegen_cranelift/pull/1120
In addition this includes a few small runtime performance improvements and various fixes for rustc changes that didn't cause compilation to fail.
r? ``@ghost``
``@rustbot`` label +A-codegen +A-cranelift +T-compiler