Skip to content

Commit e9a29e7

Browse files
LeSeulArtichautmark-i-mspastorino
committed
Apply suggestions from code review
Co-authored-by: mark-i-m <mark-i-m@users.noreply.github.com> Co-authored-by: spastorino <spastorino@gmail.com>
1 parent 75ba2e1 commit e9a29e7

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/building/suggested.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
The full bootstrapping process takes quite a while. Here are five suggestions
44
to make your life easier.
55

6-
## Configuring `rust-analyser` for `rustc`
6+
## Configuring `rust-analyzer` for `rustc`
77

8-
`rust-analyser` can help you check and format your code whenever you save
9-
a file. By default, `rust-analyser` runs the `cargo check` and `rustfmt`
8+
`rust-analyzer` can help you check and format your code whenever you save
9+
a file. By default, `rust-analyzer` runs the `cargo check` and `rustfmt`
1010
commands, but you can override these commands to use more adapted versions
1111
of these tools when hacking on `rustc`. For example, for Visual Studio Code,
1212
you can write:
@@ -25,13 +25,13 @@ you can write:
2525
}
2626
```
2727

28-
in your `.vscode/settings.json` file. This will ask `rust-analyser` to use
28+
in your `.vscode/settings.json` file. This will ask `rust-analyzer` to use
2929
`x.py check` to check the sources, and the stage 0 rustfmt to format them.
3030

3131
## Check, check, and check again
3232

3333
When doing simple refactorings, it can be useful to run `./x.py check`
34-
continuously. If you set up `rust-analyser` as described above, this will
34+
continuously. If you set up `rust-analyzer` as described above, this will
3535
be done for you every time you save a file. Here you are just checking that
3636
the compiler can **build**, but often that is all you need (e.g., when renaming a
3737
method). You can then run `./x.py build` when you actually need to
@@ -94,8 +94,15 @@ building the compiler on one branch will cause the old build and the
9494
incremental compilation cache to be overwritten. One solution would be
9595
to have multiple clones of the repository, but that would mean storing the
9696
Git metadata multiple times, and having to update each clone individually.
97+
9798
Fortunately, Git has a better solution called [worktrees]. This lets you
9899
create multiple "working trees", which all share the same Git database.
100+
Moreover, because all of the worktrees share the same object database,
101+
if you update a branch (e.g. master) in any of them, you can use the new
102+
commits from any of the worktrees. One caveat, though, is that submodules
103+
do not get shared. They will still be cloned multiple times.
104+
105+
[worktrees]: https://git-scm.com/docs/git-worktree
99106

100107
Given you are inside the root directory for your rust repository, you can
101108
create a "linked working tree" in a new "rust2" directory by running
@@ -114,8 +121,6 @@ git worktree add -b my-feature ../rust2 master
114121
You can then use that rust2 folder as a separate workspace for modifying
115122
and building `rustc`!
116123

117-
[worktrees]: https://git-scm.com/docs/git-worktree
118-
119124
## Building with system LLVM
120125

121126
By default, LLVM is built from source, and that can take significant amount of

0 commit comments

Comments
 (0)