Skip to content

Commit b30c004

Browse files
authored
Rollup merge of #148805 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update Subtree update of `rustc-dev-guide` to rust-lang/rustc-dev-guide@02ba22e. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
2 parents a929960 + dbd05d3 commit b30c004

File tree

12 files changed

+338
-291
lines changed

12 files changed

+338
-291
lines changed

src/doc/rustc-dev-guide/ci/sembr/src/main.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ static REGEX_IGNORE: LazyLock<Regex> =
2727
static REGEX_IGNORE_END: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(\.|\?|;|!)$").unwrap());
2828
static REGEX_IGNORE_LINK_TARGETS: LazyLock<Regex> =
2929
LazyLock::new(|| Regex::new(r"^\[.+\]: ").unwrap());
30-
static REGEX_SPLIT: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(\.|[^r]\?|;|!)\s+").unwrap());
30+
static REGEX_SPLIT: LazyLock<Regex> =
31+
LazyLock::new(|| Regex::new(r"([^\.]\.|[^r]\?|;|!)\s+").unwrap());
3132

3233
fn main() -> Result<()> {
3334
let cli = Cli::parse();
@@ -136,6 +137,7 @@ fn lengthen_lines(content: &str, limit: usize) -> String {
136137
let mut new_content = content.clone();
137138
let mut new_n = 0;
138139
let mut in_code_block = false;
140+
let mut in_html_div = false;
139141
let mut skip_next = false;
140142
for (n, line) in content.iter().enumerate() {
141143
if skip_next {
@@ -149,6 +151,17 @@ fn lengthen_lines(content: &str, limit: usize) -> String {
149151
in_code_block = !in_code_block;
150152
continue;
151153
}
154+
if line.trim_start().starts_with("<div") {
155+
in_html_div = true;
156+
continue;
157+
}
158+
if line.trim_start().starts_with("</div") {
159+
in_html_div = false;
160+
continue;
161+
}
162+
if in_html_div {
163+
continue;
164+
}
152165
if ignore(line, in_code_block) || REGEX_SPLIT.is_match(line) {
153166
continue;
154167
}
@@ -183,6 +196,7 @@ ignore E.g. too
183196
some code. block
184197
```
185198
sentence with *italics* should not be ignored. truly.
199+
git log main.. compiler
186200
";
187201
let expected = "\
188202
# some. heading
@@ -203,6 +217,7 @@ some code. block
203217
```
204218
sentence with *italics* should not be ignored.
205219
truly.
220+
git log main.. compiler
206221
";
207222
assert_eq!(expected, comply(original));
208223
}
@@ -212,9 +227,15 @@ fn test_prettify() {
212227
let original = "\
213228
do not split
214229
short sentences
230+
<div class='warning'>
231+
a bit of text inside
232+
</div>
215233
";
216234
let expected = "\
217235
do not split short sentences
236+
<div class='warning'>
237+
a bit of text inside
238+
</div>
218239
";
219240
assert_eq!(expected, lengthen_lines(original, 50));
220241
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c5dabe8cf798123087d094f06417f5a767ca73e8
1+
8401398e1f14a24670ee1a3203713dc2f0f8b3a8

src/doc/rustc-dev-guide/src/autodiff/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ In the near future, `std::autodiff` should become available in nightly builds fo
44

55
## Build instructions
66

7-
First you need to clone and configure the Rust repository:
7+
First you need to clone and configure the Rust repository. Based on your preferences, you might also want to `--enable-clang` or `--enable-lld`.
88
```bash
99
git clone git@github.com:rust-lang/rust
1010
cd rust
11-
./configure --release-channel=nightly --enable-llvm-enzyme --enable-llvm-assertions --enable-option-checking --disable-docs --set llvm.download-ci-llvm=true
11+
./configure --release-channel=nightly --enable-llvm-enzyme --enable-llvm-link-shared --enable-llvm-assertions --enable-ninja --enable-option-checking --disable-docs --set llvm.download-ci-llvm=false
1212
```
1313

1414
Afterwards you can build rustc using:
@@ -47,7 +47,7 @@ Then build rustc in a slightly altered way:
4747
```bash
4848
git clone https://github.com/rust-lang/rust
4949
cd rust
50-
./configure --release-channel=nightly --enable-llvm-enzyme --enable-llvm-assertions --enable-option-checking --disable-docs --set llvm.download-ci-llvm=true
50+
./configure --release-channel=nightly --enable-llvm-enzyme --enable-llvm-link-shared --enable-llvm-assertions --enable-ninja --enable-option-checking --disable-docs --set llvm.download-ci-llvm=false
5151
./x dist
5252
```
5353
We then copy the tarball to our host. The dockerid is the newest entry under `docker ps -a`.

src/doc/rustc-dev-guide/src/borrow_check/two_phase_borrows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ two-phase borrow are:
1515

1616
To give some examples:
1717

18-
```rust2018
18+
```rust,edition2018
1919
// In the source code
2020
2121
// Case 1:

src/doc/rustc-dev-guide/src/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ conditions that trigger the bug, or part of the error message if there is any.
2828
An example could be: **"impossible case reached" on lifetime inference for impl
2929
Trait in return position**.
3030

31-
Opening an issue is as easy as following [thi link][create an issue] and filling out the fields
31+
Opening an issue is as easy as following [this link][create an issue] and filling out the fields
3232
in the appropriate provided template.
3333

3434
## Bug fixes or "normal" code changes

src/doc/rustc-dev-guide/src/coroutine-closures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ We introduce a `AsyncFnKindHelper` trait which allows us to defer the question o
167167

168168
This seems a bit roundabout and complex, and I admit that it is. But let's think of the "do nothing" alternative -- we could instead mark all `AsyncFn*` goals as ambiguous until upvar analysis, at which point we would know exactly what to put into the upvars of the coroutine we return. However, this is actually *very* detrimental to inference in the program, since it means that programs like this would not be valid:
169169

170-
```rust!
170+
```rust,ignore
171171
let c = async || -> String { .. };
172172
let s = c().await;
173173
// ^^^ If we can't project `<{c} as AsyncFn>::call()` to a coroutine, then the `IntoFuture::into_future` call inside of the `.await` stalls, and the type of `s` is left unconstrained as an infer var.

src/doc/rustc-dev-guide/src/getting-started.md

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Getting Started
22

3-
Thank you for your interest in contributing to Rust! There are many ways to
4-
contribute, and we appreciate all of them.
3+
Thank you for your interest in contributing to Rust!
4+
There are many ways to contribute, and we appreciate all of them.
55

66
If this is your first time contributing, the [walkthrough] chapter can give you a good example of
77
how a typical contribution would go.
88

9-
This documentation is _not_ intended to be comprehensive; it is meant to be a
10-
quick guide for the most useful things. For more information, [see this
11-
chapter on how to build and run the compiler](./building/how-to-build-and-run.md).
9+
This documentation is _not_ intended to be comprehensive;
10+
it is meant to be a quick guide for the most useful things.
11+
For more information,
12+
see [How to build and run the compiler](building/how-to-build-and-run.md).
1213

1314
[internals]: https://internals.rust-lang.org
1415
[rust-zulip]: https://rust-lang.zulipchat.com
@@ -36,26 +37,30 @@ questions about how the compiler works can go in [#t-compiler/help][z-help].
3637
[z-help]: https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp
3738

3839
**Please ask questions!** A lot of people report feeling that they are "wasting
39-
expert's time", but nobody on `t-compiler` feels this way. Contributors are
40-
important to us.
40+
expert's time", but nobody on `t-compiler` feels this way.
41+
Contributors are important to us.
4142

4243
Also, if you feel comfortable, prefer public topics, as this means others can
43-
see the questions and answers, and perhaps even integrate them back into this
44-
guide :)
44+
see the questions and answers, and perhaps even integrate them back into this guide :)
4545

46-
**Tip**: If you're not a native English speaker and feel unsure about writing, try using a translator to help. But avoid using LLM tools that generate long, complex words. In daily teamwork, **simple and clear words** are best for easy understanding. Even small typos or grammar mistakes can make you seem more human, and people connect better with humans.
46+
**Tip**: If you're not a native English speaker and feel unsure about writing, try using a translator to help.
47+
But avoid using LLM tools that generate long, complex words.
48+
In daily teamwork, **simple and clear words** are best for easy understanding.
49+
Even small typos or grammar mistakes can make you seem more human, and people connect better with humans.
4750

4851
### Experts
4952

50-
Not all `t-compiler` members are experts on all parts of `rustc`; it's a
51-
pretty large project. To find out who could have some expertise on
53+
Not all `t-compiler` members are experts on all parts of `rustc`;
54+
it's a pretty large project.
55+
To find out who could have some expertise on
5256
different parts of the compiler, [consult triagebot assign groups][map].
53-
The sections that start with `[assign*` in `triagebot.toml` file.
57+
The sections that start with `[assign*` in `triagebot.toml` file.
5458
But also, feel free to ask questions even if you can't figure out who to ping.
5559

5660
Another way to find experts for a given part of the compiler is to see who has made recent commits.
5761
For example, to find people who have recently worked on name resolution since the 1.68.2 release,
58-
you could run `git shortlog -n 1.68.2.. compiler/rustc_resolve/`. Ignore any commits starting with
62+
you could run `git shortlog -n 1.68.2.. compiler/rustc_resolve/`.
63+
Ignore any commits starting with
5964
"Rollup merge" or commits by `@bors` (see [CI contribution procedures](./contributing.md#ci) for
6065
more information about these commits).
6166

@@ -64,8 +69,7 @@ more information about these commits).
6469
### Etiquette
6570

6671
We do ask that you be mindful to include as much useful information as you can
67-
in your question, but we recognize this can be hard if you are unfamiliar with
68-
contributing to Rust.
72+
in your question, but we recognize this can be hard if you are unfamiliar with contributing to Rust.
6973

7074
Just pinging someone without providing any context can be a bit annoying and
7175
just create noise, so we ask that you be mindful of the fact that the
@@ -74,13 +78,16 @@ just create noise, so we ask that you be mindful of the fact that the
7478
## What should I work on?
7579

7680
The Rust project is quite large and it can be difficult to know which parts of the project need
77-
help, or are a good starting place for beginners. Here are some suggested starting places.
81+
help, or are a good starting place for beginners.
82+
Here are some suggested starting places.
7883

7984
### Easy or mentored issues
8085

8186
If you're looking for somewhere to start, check out the following [issue
82-
search][help-wanted-search]. See the [Triage] for an explanation of these labels. You can also try
83-
filtering the search to areas you're interested in. For example:
87+
search][help-wanted-search].
88+
See the [Triage] for an explanation of these labels.
89+
You can also try filtering the search to areas you're interested in.
90+
For example:
8491

8592
- `repo:rust-lang/rust-clippy` will only show clippy issues
8693
- `label:T-compiler` will only show issues related to the compiler
@@ -94,8 +101,9 @@ See below for how to find work that isn't labelled.
94101

95102
### Recurring work
96103

97-
Some work is too large to be done by a single person. In this case, it's common to have "Tracking
98-
issues" to co-ordinate the work between contributors. Here are some example tracking issues where
104+
Some work is too large to be done by a single person.
105+
In this case, it's common to have "Tracking issues" to co-ordinate the work between contributors.
106+
Here are some example tracking issues where
99107
it's easy to pick up work without a large time commitment:
100108

101109
- *Add recurring work items here.*
@@ -105,8 +113,8 @@ If you find more recurring work, please feel free to add it here!
105113
### Clippy issues
106114

107115
The [Clippy] project has spent a long time making its contribution process as friendly to newcomers
108-
as possible. Consider working on it first to get familiar with the process and the compiler
109-
internals.
116+
as possible.
117+
Consider working on it first to get familiar with the process and the compiler internals.
110118

111119
See [the Clippy contribution guide][clippy-contributing] for instructions on getting started.
112120

@@ -116,27 +124,33 @@ See [the Clippy contribution guide][clippy-contributing] for instructions on get
116124
### Diagnostic issues
117125

118126
Many diagnostic issues are self-contained and don't need detailed background knowledge of the
119-
compiler. You can see a list of diagnostic issues [here][diagnostic-issues].
127+
compiler.
128+
You can see a list of diagnostic issues [here][diagnostic-issues].
120129

121130
[diagnostic-issues]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AA-diagnostics+no%3Aassignee
122131

123132
### Picking up abandoned pull requests
124133

125134
Sometimes, contributors send a pull request, but later find out that they don't have enough
126-
time to work on it, or they simply are not interested in it anymore. Such PRs are often
127-
eventually closed and they receive the `S-inactive` label. You could try to examine some of
128-
these PRs and pick up the work. You can find the list of such PRs [here][abandoned-prs].
135+
time to work on it, or they simply are not interested in it anymore.
136+
Such PRs are often eventually closed and they receive the `S-inactive` label.
137+
You could try to examine some of these PRs and pick up the work.
138+
You can find the list of such PRs [here][abandoned-prs].
129139

130140
If the PR has been implemented in some other way in the meantime, the `S-inactive` label
131-
should be removed from it. If not, and it seems that there is still interest in the change,
141+
should be removed from it.
142+
If not, and it seems that there is still interest in the change,
132143
you can try to rebase the pull request on top of the latest `master` branch and send a new
133144
pull request, continuing the work on the feature.
134145

135146
[abandoned-prs]: https://github.com/rust-lang/rust/pulls?q=is%3Apr+label%3AS-inactive+is%3Aclosed
136147

137148
### Writing tests
138149

139-
Issues that have been resolved but do not have a regression test are marked with the `E-needs-test` label. Writing unit tests is a low-risk, lower-priority task that offers new contributors a great opportunity to familiarize themselves with the testing infrastructure and contribution workflow.
150+
Issues that have been resolved but do not have a regression test are marked with the `E-needs-test` label.
151+
Writing unit tests is a low-risk,
152+
lower-priority task that offers new contributors a great opportunity to familiarize themselves
153+
with the testing infrastructure and contribution workflow.
140154

141155
### Contributing to std (standard library)
142156

@@ -147,28 +161,28 @@ See [std-dev-guide](https://std-dev-guide.rust-lang.org/).
147161
There are a bunch of other projects that you can contribute to outside of the
148162
`rust-lang/rust` repo, including `cargo`, `miri`, `rustup`, and many others.
149163

150-
These repos might have their own contributing guidelines and procedures. Many
151-
of them are owned by working groups. For more info, see the documentation in those repos' READMEs.
164+
These repos might have their own contributing guidelines and procedures.
165+
Many of them are owned by working groups.
166+
For more info, see the documentation in those repos' READMEs.
152167

153168
### Other ways to contribute
154169

155170
There are a bunch of other ways you can contribute, especially if you don't
156171
feel comfortable jumping straight into the large `rust-lang/rust` codebase.
157172

158-
The following tasks are doable without much background knowledge but are
159-
incredibly helpful:
173+
The following tasks are doable without much background knowledge but are incredibly helpful:
160174

161175
- [Writing documentation][wd]: if you are feeling a bit more intrepid, you could try
162-
to read a part of the code and write doc comments for it. This will help you
163-
to learn some part of the compiler while also producing a useful artifact!
176+
to read a part of the code and write doc comments for it.
177+
This will help you to learn some part of the compiler while also producing a useful artifact!
164178
- [Triaging issues][triage]: categorizing, replicating, and minimizing issues is very helpful to the Rust maintainers.
165179
- [Working groups][wg]: there are a bunch of working groups on a wide variety
166180
of rust-related things.
167181
- Answer questions on [users.rust-lang.org][users], or on [Stack Overflow][so].
168182
- Participate in the [RFC process](https://github.com/rust-lang/rfcs).
169183
- Find a [requested community library][community-library], build it, and publish
170-
it to [Crates.io](http://crates.io). Easier said than done, but very, very
171-
valuable!
184+
it to [Crates.io](http://crates.io).
185+
Easier said than done, but very, very valuable!
172186

173187
[users]: https://users.rust-lang.org/
174188
[so]: http://stackoverflow.com/questions/tagged/rust

src/doc/rustc-dev-guide/src/offload/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Now we generate the device code. Replace the target-cpu with the right code for
7979
RUSTFLAGS="-Ctarget-cpu=gfx90a --emit=llvm-bc,llvm-ir" cargo +offload build -Zunstable-options -r -v --target amdgcn-amd-amdhsa -Zbuild-std=core
8080
```
8181

82-
Now find the <libname>.ll under target/amdgcn-amd-amdhsa folder and copy it to a device.ll file (or adjust the file names below).
82+
Now find the `<libname>.ll` under target/amdgcn-amd-amdhsa folder and copy it to a device.ll file (or adjust the file names below).
8383
If you work on an NVIDIA or Intel gpu, please adjust the names acordingly and open an issue to share your results (either if you succeed or fail).
8484
First we compile our .ll files (good for manual inspections) to .bc files and clean up leftover artifacts. The cleanup is important, otherwise caching might interfere on following runs.
8585
```

0 commit comments

Comments
 (0)