Visitar URL original
Auto merge of #159802 - jhpratt:rollup-0P0tnuA, r=jhpratt · rust-lang/rustc-dev-guide@567da85 · GitHub
Skip to content

Commit 567da85

Browse files
committed
Auto merge of #159802 - jhpratt:rollup-0P0tnuA, r=jhpratt
Rollup of 20 pull requests Successful merges: - rust-lang/rust#150161 (Remove 'static requirement on try_as_dyn) - rust-lang/rust#159412 (Reorganize `tests/ui/issues` [26/N]) - rust-lang/rust#159466 (cmse: clear variant-dependent padding in `enum`s) - rust-lang/rust#157905 (Update comments and add tests for `-Zrandomize-layout` for some guaranteed ZSTs) - rust-lang/rust#158479 (Reject static item as direct const generic arg) - rust-lang/rust#159041 (Reorganize `tests/ui/issues` [22/N]) - rust-lang/rust#159108 (Reorganize `tests/ui/issues` [23/N]) - rust-lang/rust#159138 (doc: document wasm import symbol mangling) - rust-lang/rust#159531 (Reorganize `tests/ui/issues` [28/N]) - rust-lang/rust#159608 (early_otherwise: Don't hoist dereferences when the otherwise branch is reachable) - rust-lang/rust#159612 (Reorganize `tests/ui/issues` [29/N]) - rust-lang/rust#159653 (run `tests/assembly-llvm/asm/aarch64-types.rs` for `aarch64_be`) - rust-lang/rust#159719 (tests: add UI test for `.swap()` suggestion) - rust-lang/rust#159737 (rustfmt fix: allow file not found errors for external mods annotated with `#[my_macro]`) - rust-lang/rust#159759 (rustc-dev-guide subtree update) - rust-lang/rust#159761 (Remove outdated comment for resolve_vars_with_obligations) - rust-lang/rust#159764 (use `minicore::simd::Simd` more) - rust-lang/rust#159773 (Remove outdated workaround for `P` type) - rust-lang/rust#159778 (use lowest edition the test accepts) - rust-lang/rust#159788 (Avoid ICEing in RPIT method chain suggestion)
2 parents e0b0020 + 798b168 commit 567da85

22 files changed

Lines changed: 419 additions & 380 deletions

‎rust-version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7fb284d9037fa54f6a9b24261c82b394472cbfd7
1+
390279b302ca98ae270f434100ae3730531d1246

‎src/SUMMARY.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
- [Debugging bootstrap](./building/bootstrapping/debugging-bootstrap.md)
8787
- [cfg(bootstrap) in dependencies](./building/bootstrapping/bootstrap-in-dependencies.md)
8888

89-
# High-level Compiler Architecture
89+
# High-level compiler architecture
9090

9191
- [Prologue](./part-2-intro.md)
9292
- [Overview of the compiler](./overview.md)
@@ -115,7 +115,7 @@
115115
- [Autodiff flags](./autodiff/flags.md)
116116
- [Type Trees](./autodiff/type-trees.md)
117117

118-
# Source Code Representation
118+
# Source code representation
119119

120120
- [Prologue](./part-3-intro.md)
121121
- [Syntax and the AST](./syntax-intro.md)
@@ -140,7 +140,7 @@
140140
- [MIR queries and passes: getting the MIR](./mir/passes.md)
141141
- [Inline assembly](./asm.md)
142142

143-
# Supporting Infrastructure
143+
# Supporting infrastructure
144144

145145
- [Command-line arguments](./cli.md)
146146
- [rustc_driver and rustc_interface](./rustc-driver/intro.md)
@@ -167,8 +167,8 @@
167167
- [ADTs and Generic Arguments](./ty-module/generic-arguments.md)
168168
- [Parameter types/consts/regions](./ty-module/param-ty-const-regions.md)
169169
- [`TypeFolder` and `TypeFoldable`](./ty-fold.md)
170-
- [Aliases and Normalization](./normalization.md)
171-
- [Typing/Param Envs](./typing-parameter-envs.md)
170+
- [Aliases and normalization](./normalization.md)
171+
- [Typing/Param envs](./typing-parameter-envs.md)
172172
- [Type inference](./type-inference.md)
173173
- [Trait solving](./traits/resolution.md)
174174
- [Higher-ranked trait bounds](./traits/hrtb.md)
@@ -199,7 +199,7 @@
199199
- [HIR Type checking](./hir-typeck/summary.md)
200200
- [Coercions](./hir-typeck/coercions.md)
201201
- [Method lookup](./hir-typeck/method-lookup.md)
202-
- [Const Generics](./const-generics.md)
202+
- [Const generics](./const-generics.md)
203203
- [Opaque types](./opaque-types-type-alias-impl-trait.md)
204204
- [Inference details](./opaque-types-impl-trait-inference.md)
205205
- [Return Position Impl Trait In Trait](./return-position-impl-trait-in-trait.md)
@@ -239,18 +239,18 @@
239239
- [Debugging LLVM](./backend/debugging.md)
240240
- [Backend Agnostic Codegen](./backend/backend-agnostic.md)
241241
- [Implicit caller location](./backend/implicit-caller-location.md)
242-
- [Debug Info](./debuginfo/intro.md)
243-
- [Rust Codegen](./debuginfo/rust-codegen.md)
244-
- [LLVM Codegen](./debuginfo/llvm-codegen.md)
245-
- [Debugger Internals](./debuginfo/debugger-internals.md)
246-
- [LLDB Internals](./debuginfo/lldb-internals.md)
247-
- [GDB Internals](./debuginfo/gdb-internals.md)
248-
- [Debugger Visualizers](./debuginfo/debugger-visualizers.md)
242+
- [Debug info](./debuginfo/intro.md)
243+
- [Rust codegen](./debuginfo/rust-codegen.md)
244+
- [LLVM codegen](./debuginfo/llvm-codegen.md)
245+
- [Debugger internals](./debuginfo/debugger-internals.md)
246+
- [LLDB internals](./debuginfo/lldb-internals.md)
247+
- [GDB internals](./debuginfo/gdb-internals.md)
248+
- [Debugger visualizers](./debuginfo/debugger-visualizers.md)
249249
- [LLDB - Python Providers](./debuginfo/lldb-visualizers.md)
250250
- [GDB - Python Providers](./debuginfo/gdb-visualizers.md)
251251
- [CDB - Natvis](./debuginfo/natvis-visualizers.md)
252252
- [Testing](./debuginfo/testing.md)
253-
- [(Lecture Notes) Debugging support in the Rust compiler](./debugging-support-in-rustc.md)
253+
- [(Lecture notes) Debugging support in the Rust compiler](./debugging-support-in-rustc.md)
254254
- [Libraries and metadata](./backend/libs-and-metadata.md)
255255
- [Profile-guided optimization](./profile-guided-optimization.md)
256256
- [LLVM source-based code coverage](./llvm-coverage-instrumentation.md)

‎src/about-this-guide.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# About this guide
22

3+
<!-- date-check: Jul 2026 -->
4+
35
This guide is meant to help document how rustc – the Rust compiler – works,
46
as well as to help new contributors get involved in rustc development.
57

@@ -14,18 +16,18 @@ There are several parts to this guide:
1416
1. [Bootstrapping][p3]:
1517
Describes how the Rust compiler builds itself using previous versions, including
1618
an introduction to the bootstrap process and debugging methods.
17-
1. [High-level Compiler Architecture][p4]:
19+
1. [High-level compiler architecture][p4]:
1820
Discusses the high-level architecture of the compiler and stages of the compile process.
19-
1. [Source Code Representation][p5]:
21+
1. [Source code representation][p5]:
2022
Describes the process of taking raw source code from the user
2123
and transforming it into various forms that the compiler can work with easily.
22-
1. [Supporting Infrastructure][p6]:
24+
1. [Supporting infrastructure][p6]:
2325
Covers command-line argument conventions, compiler entry points like rustc_driver and
2426
rustc_interface, and the design and implementation of errors and lints.
2527
1. [Analysis][p7]:
2628
Discusses the analyses that the compiler uses to check various properties of the code
2729
and inform later stages of the compile process (e.g., type checking).
28-
1. [MIR to Binaries][p8]: How linked executable machine code is generated.
30+
1. [Mir to binaries][p8]: How linked executable machine code is generated.
2931
1. [Appendices][p9] at the end with useful reference information.
3032
There are a few of these with different information, including a glossary.
3133

‎src/autodiff/installation.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ rustup +nightly component add enzyme
2020

2121
Older rustup versions are not aware of this component, so if you run into issues try updating rustup itself:
2222
```console
23-
rustup update
23+
rustup self update
2424
rustup +nightly component add enzyme
2525
```
2626

‎src/const-generics.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Const Generics
1+
# Const generics
22

33
## Kinds of const arguments
44

@@ -15,9 +15,9 @@ Inference Variables are quite boring and treated equivalently to type inference
1515
Const Parameters are also similarly boring and equivalent to uses of type parameters almost everywhere.
1616
However, there are some interesting subtleties with how they are handled during parsing, name resolution, and AST lowering: [ambig-unambig-ty-and-consts].
1717

18-
## Anon Consts
18+
## Anon consts
1919

20-
Anon Consts (short for anonymous const items) are how arbitrary expression are represented in const generics, for example an array length of `1 + 1` or `foo()` or even just `0`.
20+
Anon consts (short for anonymous const items) are how arbitrary expression are represented in const generics, for example an array length of `1 + 1` or `foo()` or even just `0`.
2121
These are unique to const generics and have no real type equivalent.
2222

2323
### Desugaring
@@ -85,7 +85,7 @@ After all of this desugaring has taken place the final representation in the typ
8585

8686
This allows the representation for const "aliases" to be the same as the representation of `TyKind::Alias`. Having a proper HIR body also allows for a *lot* of code re-use, e.g. we can reuse HIR typechecking and all of the lowering steps to MIR where we can then reuse const eval.
8787

88-
### Enforcing lack of Generic Parameters
88+
### Enforcing lack of generic parameters
8989

9090
There are three ways that we enforce anon consts can't use generic parameters:
9191
1. Name Resolution will not resolve paths to generic parameters when inside of an anon const
@@ -134,7 +134,9 @@ fn foo<T: Sized>() {
134134
}
135135
```
136136

137-
However, to avoid most of the problems involved in allowing generic parameters in anon const const arguments we require that the constant be evaluated before monomorphization (e.g. during type checking). In some sense we only allow generic parameters here when they are semantically unused.
137+
However, to avoid most of the problems involved in allowing generic parameters in anon const const arguments,
138+
we require that the constant be evaluated before monomorphization (e.g. during type checking).
139+
In some sense we only allow generic parameters here when they are semantically unused.
138140

139141
In the previous example the anon const can be evaluated for any type parameter `T` because raw pointers to sized types always have the same size (e.g. `8` on 64bit platforms).
140142

@@ -182,7 +184,7 @@ It is currently unclear what the right way to make `generic_const_parameter_type
182184

183185
`min_generic_const_args` will allow for some expressions (for example array construction) to be representable without an anon const and therefore without running into these issues, though whether this is *enough* has yet to be determined.
184186

185-
## Checking types of Const Arguments
187+
## Checking types of const arguments
186188

187189
In order for a const argument to be well formed it must have the same type as the const parameter it is an argument to.
188190
For example, a const argument of type `bool` for an array length is not well formed, as an array's length parameter has type `usize`.

‎src/debuginfo/CodeView.pdf‎

-209 KB
Binary file not shown.
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# Debugger Internals
1+
# Debugger internals
22

3-
It is the debugger's job to convert the debug info into an in-memory representation. Both the
4-
interpretation of the debug info and the in-memory representation are arbitrary; anything will do
5-
so long as meaningful information can be reconstructed while the program is running. The pipeline
6-
from raw debug info to usable types can be quite complicated.
3+
It is the debugger's job to convert the debug info into an in-memory representation.
4+
Both the interpretation of the debug info and the in-memory representation are arbitrary;
5+
anything will do,
6+
so long as meaningful information can be reconstructed while the program is running.
7+
The pipeline from raw debug info to usable types can be quite complicated.
78

89
Once the information is in a workable format, the debugger front-end then must provide a way to
910
interpret and display the data, a way for users to interact with it, and an API for extensibility.
1011

11-
Debuggers are vast systems and cannot be covered completely here. This section will provide a brief
12-
overview of the subsystems directly relevant to the Rust debugging experience.
12+
Debuggers are vast systems and cannot be covered completely here.
13+
This section will provide a brief overview of the subsystems
14+
directly relevant to the Rust debugging experience.
1315

14-
Microsoft's debugging engine is closed source, so it will not be covered here.
16+
Microsoft's debugging engine is closed source, so it will not be covered here.

0 commit comments

Comments
 (0)