Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
38ef5c1
improve cg_gcc.md a little
tshepang Dec 16, 2025
160e5d8
Merge pull request #2700 from rust-lang/tshepang-patch-4
tshepang Dec 16, 2025
a412446
Prepare for merging from rust-lang/rust
invalid-email-address Dec 17, 2025
58983c8
Merge ref '2dc30247c5d8' from rust-lang/rust
invalid-email-address Dec 17, 2025
7f16a1f
Merge pull request #2701 from rust-lang/rustc-pull
tshepang Dec 17, 2025
fd51310
output of "git diff" is better, and is what I use mostly
tshepang Dec 17, 2025
64c1e97
place it all in just 2 unit tests
tshepang Dec 17, 2025
e254e7e
match fn name
tshepang Dec 17, 2025
8b2c9d8
sembr src/about-this-guide.md
tshepang Dec 17, 2025
6a91174
sembr src/appendix/bibliography.md
tshepang Dec 17, 2025
f685b24
fix corner case
tshepang Dec 17, 2025
e1fe9c6
sembr src/appendix/bibliography.md (after fix from parent commit)
tshepang Dec 17, 2025
2dac444
sembr src/diagnostics/error-codes.md
tshepang Dec 17, 2025
5e1352b
sembr src/query.md
tshepang Dec 17, 2025
40d05f8
corner case
tshepang Dec 17, 2025
2fe2052
manual sembr
tshepang Dec 17, 2025
4673d56
sembr src/conventions.md
tshepang Dec 17, 2025
3aa4a79
that basically repeats the title
tshepang Dec 17, 2025
4b83a5b
Merge pull request #2703 from rust-lang/tshepang/sembr
tshepang Dec 17, 2025
186fc3c
Clarify serialization macros documentation
reddevilmidzy Dec 18, 2025
1dff3e7
stabilization_guide: add missing `)` in prose
DanielEScherzer Dec 18, 2025
728c376
Merge pull request #2705 from DanielEScherzer/patch-1
tshepang Dec 18, 2025
e1e8e06
fix typo
reddevilmidzy Dec 18, 2025
54a25b1
Clarify descriptions for BlobDecodable and LazyDecodable
reddevilmidzy Dec 18, 2025
7076d69
Merge pull request #2704 from reddevilmidzy/macro
jdonszelmann Dec 18, 2025
c3bd76b
Add Rustc Explore video link
reddevilmidzy Dec 20, 2025
f34a4ee
Merge pull request #2706 from reddevilmidzy/lecture
tshepang Dec 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions src/doc/rustc-dev-guide/ci/sembr/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"

[[package]]
name = "foldhash"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"

[[package]]
name = "globset"
version = "0.4.18"
Expand All @@ -167,15 +161,6 @@ dependencies = [
"regex-syntax",
]

[[package]]
name = "hashbrown"
version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
"foldhash",
]

[[package]]
name = "heck"
version = "0.5.0"
Expand All @@ -198,16 +183,6 @@ dependencies = [
"winapi-util",
]

[[package]]
name = "imara-diff"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f01d462f766df78ab820dd06f5eb700233c51f0f4c2e846520eaf4ba6aa5c5c"
dependencies = [
"hashbrown",
"memchr",
]

[[package]]
name = "is_terminal_polyfill"
version = "1.70.2"
Expand Down Expand Up @@ -295,7 +270,6 @@ dependencies = [
"anyhow",
"clap",
"ignore",
"imara-diff",
"regex",
]

Expand Down
1 change: 0 additions & 1 deletion src/doc/rustc-dev-guide/ci/sembr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition = "2024"
[dependencies]
anyhow = "1"
ignore = "0.4"
imara-diff = "0.2"

[dependencies.regex]
version = "1"
Expand Down
70 changes: 18 additions & 52 deletions src/doc/rustc-dev-guide/ci/sembr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::{fs, process};
use anyhow::Result;
use clap::Parser;
use ignore::Walk;
use imara_diff::{Algorithm, BasicLineDiffPrinter, Diff, InternedInput, UnifiedDiffConfig};
use regex::Regex;

#[derive(Parser)]
Expand All @@ -18,8 +17,6 @@ struct Cli {
/// Applies to lines that are to be split
#[arg(long, default_value_t = 100)]
line_length_limit: usize,
#[arg(long)]
show_diff: bool,
}

static REGEX_IGNORE_END: LazyLock<Regex> =
Expand Down Expand Up @@ -54,10 +51,6 @@ fn main() -> Result<()> {
} else if cli.overwrite {
fs::write(&path, new)?;
made_compliant.push(path.clone());
} else if cli.show_diff {
println!("{}:", path.display());
show_diff(&old, &new);
println!("---");
} else {
not_compliant.push(path.clone());
}
Expand All @@ -76,16 +69,6 @@ fn main() -> Result<()> {
Ok(())
}

fn show_diff(old: &str, new: &str) {
let input = InternedInput::new(old, new);
let mut diff = Diff::compute(Algorithm::Histogram, &input);
diff.postprocess_lines(&input);
let diff = diff
.unified_diff(&BasicLineDiffPrinter(&input.interner), UnifiedDiffConfig::default(), &input)
.to_string();
print!("{diff}");
}

fn display(header: &str, paths: &[PathBuf]) {
println!("{header}:");
for element in paths {
Expand All @@ -96,7 +79,9 @@ fn display(header: &str, paths: &[PathBuf]) {
fn ignore(line: &str, in_code_block: bool) -> bool {
in_code_block
|| line.to_lowercase().contains("e.g.")
|| line.to_lowercase().contains("n.b.")
|| line.contains("i.e.")
|| line.contains("et. al")
|| line.contains('|')
|| line.trim_start().starts_with('>')
|| line.starts_with('#')
Expand Down Expand Up @@ -213,6 +198,9 @@ some code. block
sentence with *italics* should not be ignored. truly.
git log main.. compiler
foo. bar. baz
o? whatever
r? @reviewer
r? @reviewer
";
let expected = "
# some. heading
Expand All @@ -238,12 +226,16 @@ git log main.. compiler
foo.
bar.
baz
o?
whatever
r? @reviewer
r? @reviewer
";
assert_eq!(expected, comply(original));
}

#[test]
fn test_prettify() {
fn test_lengthen_lines() {
let original = "\
do not split
short sentences
Expand All @@ -264,6 +256,12 @@ do not mess with code block chars
leave the
text alone
```

handle the
indented well

[a target]: https://example.com
[another target]: https://example.com
";
let expected = "\
do not split short sentences
Expand All @@ -284,43 +282,11 @@ do not mess with code block chars
leave the
text alone
```
";
assert_eq!(expected, lengthen_lines(original, 50));
}

#[test]
fn test_prettify_prefix_spaces() {
let original = "\
do not split
short sentences
";
let expected = "\
do not split short sentences
";
assert_eq!(expected, lengthen_lines(original, 50));
}
handle the indented well

#[test]
fn test_prettify_ignore_link_targets() {
let original = "\
[a target]: https://example.com
[another target]: https://example.com
";
assert_eq!(original, lengthen_lines(original, 100));
}

#[test]
fn test_sembr_question_mark() {
let original = "
o? whatever
r? @reviewer
r? @reviewer
";
let expected = "
o?
whatever
r? @reviewer
r? @reviewer
";
assert_eq!(expected, comply(original));
assert_eq!(expected, lengthen_lines(original, 50));
}
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cec70080fd441d16e9fb08a0d1d1a04c72d1ed25
2dc30247c5d8293aaa31e1d7dae2ed2fde908ada
12 changes: 5 additions & 7 deletions src/doc/rustc-dev-guide/src/about-this-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ You might also find the following sites useful:
- [std-dev-guide] -- a similar guide for developing the standard library.
- [rust-analyzer book] -- documentation for the rust-analyzer.
- [The t-compiler Zulip][z]
- The [Rust Internals forum][rif], a place to ask questions and
discuss Rust's internals
- The [Rust Internals forum][rif], a place to ask questions and discuss Rust's internals
- The [Rust reference][rr], even though it doesn't specifically talk about
Rust's internals, is a great resource nonetheless
- Although out of date, [Tom Lee's great blog article][tlgba] is very helpful
Expand All @@ -89,11 +88,10 @@ You might also find the following sites useful:
the compiler, the books, the references, and the guides) to quickly find
information about the language and compiler.
- You can also use Rustdoc's built-in search feature to find documentation on
types and functions within the crates you're looking at. You can also search
by type signature! For example, searching for `* -> vec` should find all
functions that return a `Vec<T>`.
_Hint:_ Find more tips and keyboard shortcuts by typing `?` on any Rustdoc
page!
types and functions within the crates you're looking at.
You can also search by type signature!
For example, searching for `* -> vec` should find all functions that return a `Vec<T>`.
_Hint:_ Find more tips and keyboard shortcuts by typing `?` on any Rustdoc page!


[rustc dev guide]: about-this-guide.md
Expand Down
63 changes: 35 additions & 28 deletions src/doc/rustc-dev-guide/src/appendix/bibliography.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Rust Bibliography

This is a reading list of material relevant to Rust. It includes prior
research that has - at one time or another - influenced the design of
This is a reading list of material relevant to Rust.
It includes prior research that has - at one time or another - influenced the design of
Rust, as well as publications about Rust.

## Type system
Expand Down Expand Up @@ -44,8 +44,7 @@ Rust, as well as publications about Rust.

## Papers *about* Rust

* [GPU Programming in Rust: Implementing High Level Abstractions in a Systems
Level
* [GPU Programming in Rust: Implementing High Level Abstractions in a Systems Level
Language](https://ieeexplore.ieee.org/document/6650903).
Early GPU work by Eric Holk.
* [Parallel closures: a new twist on an old
Expand All @@ -55,38 +54,46 @@ Rust, as well as publications about Rust.
Language](https://dada.cs.washington.edu/research/tr/2015/03/UW-CSE-15-03-02.pdf).
Early formalization of a subset of the type system, by Eric Reed.
* [Experience Report: Developing the Servo Web Browser Engine using
Rust](https://arxiv.org/abs/1505.07383). By Lars Bergstrom.
Rust](https://arxiv.org/abs/1505.07383).
By Lars Bergstrom.
* [Implementing a Generic Radix Trie in
Rust](https://michaelsproul.github.io/rust_radix_paper/rust-radix-sproul.pdf). Undergrad
paper by Michael Sproul.
Rust](https://michaelsproul.github.io/rust_radix_paper/rust-radix-sproul.pdf).
Undergrad paper by Michael Sproul.
* [Reenix: Implementing a Unix-Like Operating System in
Rust](https://scialex.github.io/reenix.pdf). Undergrad paper by Alex
Light.
Rust](https://scialex.github.io/reenix.pdf).
Undergrad paper by Alex Light.
* [Evaluation of performance and productivity metrics of potential programming languages in the HPC environment](https://github.com/1wilkens/thesis-ba).
Bachelor's thesis by Florian Wilkens. Compares C, Go and Rust.
Bachelor's thesis by Florian Wilkens.
Compares C, Go and Rust.
* [Nom, a byte oriented, streaming, zero copy, parser combinators library
in Rust](http://spw15.langsec.org/papers/couprie-nom.pdf). By
Geoffroy Couprie, research for VLC.
in Rust](http://spw15.langsec.org/papers/couprie-nom.pdf).
By Geoffroy Couprie, research for VLC.
* [Graph-Based Higher-Order Intermediate
Representation](https://compilers.cs.uni-saarland.de/papers/lkh15_cgo.pdf). An
experimental IR implemented in Impala, a Rust-like language.
* [Code Refinement of Stencil
Codes](https://compilers.cs.uni-saarland.de/papers/ppl14_web.pdf). Another
paper using Impala.
Representation](https://compilers.cs.uni-saarland.de/papers/lkh15_cgo.pdf).
An experimental IR implemented in Impala, a Rust-like language.
* [Code Refinement of Stencil Codes](https://compilers.cs.uni-saarland.de/papers/ppl14_web.pdf).
Another paper using Impala.
* [Parallelization in Rust with fork-join and
friends](http://publications.lib.chalmers.se/records/fulltext/219016/219016.pdf). Linus
Farnstrand's master's thesis.
* [Session Types for
Rust](https://munksgaard.me/papers/laumann-munksgaard-larsen.pdf). Philip
Munksgaard's master's thesis. Research for Servo.
friends](http://publications.lib.chalmers.se/records/fulltext/219016/219016.pdf).
Linus Farnstrand's master's thesis.
* [Session Types for Rust](https://munksgaard.me/papers/laumann-munksgaard-larsen.pdf).
Philip Munksgaard's master's thesis.
Research for Servo.
* [Ownership is Theft: Experiences Building an Embedded OS in Rust - Amit Levy, et. al.](https://amitlevy.com/papers/tock-plos2015.pdf)
* [You can't spell trust without Rust](https://faultlore.com/blah/papers/thesis.pdf). Aria Beingessner's master's thesis.
* [Rust-Bio: a fast and safe bioinformatics library](https://rust-bio.github.io/). Johannes Köster
* [Safe, Correct, and Fast Low-Level Networking](https://csperkins.org/research/thesis-msci-clipsham.pdf). Robert Clipsham's master's thesis.
* [Formalizing Rust traits](https://open.library.ubc.ca/cIRcle/collections/ubctheses/24/items/1.0220521). Jonatan Milewski's master's thesis.
* [You can't spell trust without Rust](https://faultlore.com/blah/papers/thesis.pdf).
Aria Beingessner's master's thesis.
* [Rust-Bio: a fast and safe bioinformatics library](https://rust-bio.github.io/).
Johannes Köster
* [Safe, Correct, and Fast Low-Level Networking](https://csperkins.org/research/thesis-msci-clipsham.pdf).
Robert Clipsham's master's thesis.
* [Formalizing Rust traits](https://open.library.ubc.ca/cIRcle/collections/ubctheses/24/items/1.0220521).
Jonatan Milewski's master's thesis.
* [Rust as a Language for High Performance GC Implementation](https://dl.acm.org/doi/pdf/10.1145/3241624.2926707)
* [Simple Verification of Rust Programs via Functional Purification](https://github.com/Kha/electrolysis). Sebastian Ullrich's master's thesis.
* [Simple Verification of Rust Programs via Functional Purification](https://github.com/Kha/electrolysis).
Sebastian Ullrich's master's thesis.
* [Writing parsers like it is 2017](http://spw17.langsec.org/papers/chifflier-parsing-in-2017.pdf) Pierre Chifflier and Geoffroy Couprie for the Langsec Workshop
* [The Case for Writing a Kernel in Rust](https://www.tockos.org/assets/papers/rust-kernel-apsys2017.pdf)
* [RustBelt: Securing the Foundations of the Rust Programming Language](https://plv.mpi-sws.org/rustbelt/popl18/)
* [Oxide: The Essence of Rust](https://arxiv.org/abs/1903.00982). By Aaron Weiss, Olek Gierczak, Daniel Patterson, Nicholas D. Matsakis, and Amal Ahmed.
* [Oxide: The Essence of Rust](https://arxiv.org/abs/1903.00982).
By Aaron Weiss, Olek Gierczak, Daniel Patterson, Nicholas D.
Matsakis, and Amal Ahmed.
3 changes: 2 additions & 1 deletion src/doc/rustc-dev-guide/src/appendix/compiler-lecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ These are videos where various experts explain different parts of the compiler:
- [January 2019: Tom Tromey discusses debugging support in rustc](https://www.youtube.com/watch?v=elBxMRSNYr4)
- [June 2019: Responsive compilers - Nicholas Matsakis - PLISS 2019](https://www.youtube.com/watch?v=N6b44kMS6OM)
- [June 2019: Things I Learned (TIL) - Nicholas Matsakis - PLISS 2019](https://www.youtube.com/watch?v=LIYkT3p5gTs)
- [October 2022: Rustc Explore](https://www.youtube.com/playlist?list=PL85XCvVPmGQj3-MujOJ0jcoSqQ6Yi6Rkk)

## Rust Analyzer
- [January 2019: How Salsa Works](https://www.youtube.com/watch?v=_muY4HjSqVw)
Expand Down Expand Up @@ -46,4 +47,4 @@ These are videos where various experts explain different parts of the compiler:

## Code Generation
- [January 2019: Cranelift](https://www.youtube.com/watch?v=9OIA7DTFQWU)
- [December 2024: LLVM Developers' Meeting - Rust ❤️ LLVM](https://www.youtube.com/watch?v=Kqz-umsAnk8)
- [December 2024: LLVM Developers' Meeting - Rust ❤️ LLVM](https://www.youtube.com/watch?v=Kqz-umsAnk8)
Loading
Loading