Skip to content

Commit cdf5301

Browse files
committed
First pass in removing symbols from code
Let me know if some of these are problematic and inconsistent, or if I missed something
1 parent 4ecfd75 commit cdf5301

8 files changed

+54
-54
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ invoke this link checker, otherwise it will emit a warning saying it couldn't
3636
be found.
3737

3838
```bash
39-
> cargo install mdbook-linkcheck
39+
cargo install mdbook-linkcheck
4040
```
4141

4242
You will need `mdbook` version `>= 0.2`. `linkcheck` will be run automatically

src/closure.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Let's say the above is the content of a file called `immut.rs`. If we compile
3535
`immut.rs` using the following command. The [`-Zdump-mir=all`][dump-mir] flag will cause
3636
`rustc` to generate and dump the [MIR][mir] to a directory called `mir_dump`.
3737
```console
38-
> rustc +stage1 immut.rs -Zdump-mir=all
38+
rustc +stage1 immut.rs -Zdump-mir=all
3939
```
4040

4141
[mir]: ./mir/index.md
@@ -145,7 +145,7 @@ codebase. For closures specifically, set the `RUST_LOG` env variable as below an
145145
output in a file:
146146

147147
```console
148-
> RUST_LOG=rustc_typeck::check::upvar rustc +stage1 -Zdump-mir=all \
148+
RUST_LOG=rustc_typeck::check::upvar rustc +stage1 -Zdump-mir=all \
149149
<.rs file to compile> 2> <file where the output will be dumped>
150150
```
151151

src/compiler-documenting.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ and then it documents the files.
2525
## Document specific components
2626

2727
```bash
28-
./x.py doc src/doc/book
29-
./x.py doc src/doc/nomicon
30-
./x.py doc src/doc/book src/libstd
28+
./x.py doc src/doc/book
29+
./x.py doc src/doc/nomicon
30+
./x.py doc src/doc/book src/libstd
3131
```
3232

3333
Much like individual tests or building certain components you can build only

src/hir.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can view the HIR representation of your code by passing the
1515
`-Zunpretty=hir-tree` flag to rustc:
1616

1717
```bash
18-
> cargo rustc -- -Zunpretty=hir-tree
18+
cargo rustc -- -Zunpretty=hir-tree
1919
```
2020

2121
### Out-of-band storage and the `Crate` type

src/how-to-build-and-run.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ To start, copy [`config.toml.example`] to `config.toml`:
1313
[`config.toml.example`]: https://github.com/rust-lang/rust/blob/master/config.toml.example
1414

1515
```bash
16-
> cd $RUST_CHECKOUT
17-
> cp config.toml.example config.toml
16+
cd $RUST_CHECKOUT
17+
cp config.toml.example config.toml
1818
```
1919

2020
Then you will want to open up the file and change the following
@@ -339,19 +339,19 @@ build`) has quite a few more steps:
339339
Build only the libcore library
340340

341341
```bash
342-
> ./x.py build src/libcore
342+
./x.py build src/libcore
343343
```
344344

345345
Build the libcore and libproc_macro library only
346346

347347
```bash
348-
> ./x.py build src/libcore src/libproc_macro
348+
./x.py build src/libcore src/libproc_macro
349349
```
350350

351351
Build only libcore up to Stage 1
352352

353353
```bash
354-
> ./x.py build src/libcore --stage 1
354+
./x.py build src/libcore --stage 1
355355
```
356356

357357
Sometimes you might just want to test if the part you’re working on can
@@ -370,8 +370,8 @@ you will likely need to build at some point; for example, if you want
370370
to run the entire test suite).
371371

372372
```bash
373-
> rustup toolchain link stage1 build/<host-triple>/stage1
374-
> rustup toolchain link stage2 build/<host-triple>/stage2
373+
rustup toolchain link stage1 build/<host-triple>/stage1
374+
rustup toolchain link stage2 build/<host-triple>/stage2
375375
```
376376

377377
The `<host-triple>` would typically be one of the following:
@@ -385,7 +385,7 @@ should see a version number ending in `-dev`, indicating a build from
385385
your local environment:
386386

387387
```bash
388-
> rustc +stage1 -vV
388+
$ rustc +stage1 -vV
389389
rustc 1.25.0-dev
390390
binary: rustc
391391
commit-hash: unknown
@@ -523,7 +523,7 @@ you should file a bug as to what is going wrong. If you do need to clean
523523
everything up then you only need to run one command!
524524

525525
```bash
526-
> ./x.py clean
526+
./x.py clean
527527
```
528528

529529
### Compiler Documentation

src/profiling/with_perf.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ of events, though, like cache misses and so forth.
2828
The basic `perf` command is this:
2929

3030
```bash
31-
> perf record -F99 --call-graph dwarf XXX
31+
perf record -F99 --call-graph dwarf XXX
3232
```
3333

3434
The `-F99` tells perf to sample at 99 Hz, which avoids generating too
@@ -39,7 +39,7 @@ information from debuginfo, which is accurate. The `XXX` is the
3939
command you want to profile. So, for example, you might do:
4040

4141
```bash
42-
> perf record -F99 --call-graph dwarf cargo +<toolchain> rustc
42+
perf record -F99 --call-graph dwarf cargo +<toolchain> rustc
4343
```
4444

4545
to run `cargo` -- here `<toolchain>` should be the name of the toolchain
@@ -59,7 +59,7 @@ do that, the first step is to clone
5959
[the rustc-perf repository][rustc-perf-gh]:
6060

6161
```bash
62-
> git clone https://github.com/rust-lang-nursery/rustc-perf
62+
git clone https://github.com/rust-lang-nursery/rustc-perf
6363
```
6464

6565
[rustc-perf-gh]: https://github.com/rust-lang-nursery/rustc-perf
@@ -75,13 +75,13 @@ do profiling for you! You can find
7575
For example, to measure the clap-rs test, you might do:
7676

7777
```bash
78-
> ./target/release/collector
79-
--output-repo /path/to/place/output
80-
profile perf-record
81-
--rustc /path/to/rustc/executable/from/your/build/directory
82-
--cargo `which cargo`
83-
--filter clap-rs
84-
--builds Check
78+
./target/release/collector \
79+
--output-repo /path/to/place/output \
80+
profile perf-record \
81+
--rustc /path/to/rustc/executable/from/your/build/directory \
82+
--cargo `which cargo` \
83+
--filter clap-rs \
84+
--builds Check \
8585
```
8686

8787
You can also use that same command to use cachegrind or other profiling tools.
@@ -97,7 +97,7 @@ example:
9797
[dir]: https://github.com/rust-lang-nursery/rustc-perf/tree/master/collector/benchmarks
9898

9999
```bash
100-
> cd collector/benchmarks/clap-rs
100+
cd collector/benchmarks/clap-rs
101101
```
102102

103103
In this case, let's say we want to profile the `cargo check`
@@ -106,8 +106,8 @@ build the dependencies:
106106

107107
```bash
108108
# Setup: first clean out any old results and build the dependencies:
109-
> cargo +<toolchain> clean
110-
> CARGO_INCREMENTAL=0 cargo +<toolchain> check
109+
cargo +<toolchain> clean
110+
CARGO_INCREMENTAL=0 cargo +<toolchain> check
111111
```
112112

113113
(Again, `<toolchain>` should be replaced with the name of the
@@ -118,8 +118,8 @@ running cargo check. I tend to use `cargo rustc` for this, since it
118118
also allows me to add explicit flags, which we'll do later on.
119119

120120
```bash
121-
> touch src/lib.rs
122-
> CARGO_INCREMENTAL=0 perf record -F99 --call-graph dwarf cargo rustc --profile check --lib
121+
touch src/lib.rs
122+
CARGO_INCREMENTAL=0 perf record -F99 --call-graph dwarf cargo rustc --profile check --lib
123123
```
124124

125125
Note that final command: it's a doozy! It uses the `cargo rustc`
@@ -130,7 +130,7 @@ the `--profile check` and `--lib` options specify that we are doing a
130130
At this point, we can use `perf` tooling to analyze the results. For example:
131131

132132
```bash
133-
> perf report
133+
perf report
134134
```
135135

136136
will open up an interactive TUI program. In simple cases, that can be
@@ -149,8 +149,8 @@ If you want to profile an NLL run, you can just pass extra options to
149149
the `cargo rustc` command, like so:
150150

151151
```bash
152-
> touch src/lib.rs
153-
> CARGO_INCREMENTAL=0 perf record -F99 --call-graph dwarf cargo rustc --profile check --lib -- -Zborrowck=mir
152+
touch src/lib.rs
153+
CARGO_INCREMENTAL=0 perf record -F99 --call-graph dwarf cargo rustc --profile check --lib -- -Zborrowck=mir
154154
```
155155

156156
[pf]: https://github.com/nikomatsakis/perf-focus
@@ -180,7 +180,7 @@ would analyze NLL performance.
180180
You can install perf-focus using `cargo install`:
181181

182182
```bash
183-
> cargo install perf-focus
183+
cargo install perf-focus
184184
```
185185

186186
### Example: How much time is spent in MIR borrowck?
@@ -191,7 +191,7 @@ function of the MIR borrowck is called `do_mir_borrowck`, so we can do
191191
this command:
192192

193193
```bash
194-
> perf focus '{do_mir_borrowck}'
194+
$ perf focus '{do_mir_borrowck}'
195195
Matcher : {do_mir_borrowck}
196196
Matches : 228
197197
Not Matches: 542
@@ -216,7 +216,7 @@ samples where `do_mir_borrowck` was on the stack: in this case, 29%.
216216
by doing:
217217

218218
```bash
219-
> perf script | c++filt | perf focus --from-stdin ...
219+
perf script | c++filt | perf focus --from-stdin ...
220220
```
221221

222222
This will pipe the output from `perf script` through `c++filt` and
@@ -232,7 +232,7 @@ Perhaps we'd like to know how much time MIR borrowck spends in the
232232
trait checker. We can ask this using a more complex regex:
233233

234234
```bash
235-
> perf focus '{do_mir_borrowck}..{^rustc::traits}'
235+
$ perf focus '{do_mir_borrowck}..{^rustc::traits}'
236236
Matcher : {do_mir_borrowck},..{^rustc::traits}
237237
Matches : 12
238238
Not Matches: 1311
@@ -260,7 +260,7 @@ usually also want to give `--tree-min-percent` or
260260
`--tree-max-depth`. The result looks like this:
261261

262262
```bash
263-
> perf focus '{do_mir_borrowck}' --tree-callees --tree-min-percent 3
263+
$ perf focus '{do_mir_borrowck}' --tree-callees --tree-min-percent 3
264264
Matcher : {do_mir_borrowck}
265265
Matches : 577
266266
Not Matches: 746
@@ -311,7 +311,7 @@ could get our percentages relative to the borrowck itself
311311
like so:
312312

313313
```bash
314-
> perf focus '{do_mir_borrowck}' --tree-callees --relative --tree-max-depth 1 --tree-min-percent 5
314+
$ perf focus '{do_mir_borrowck}' --tree-callees --relative --tree-max-depth 1 --tree-min-percent 5
315315
Matcher : {do_mir_borrowck}
316316
Matches : 577
317317
Not Matches: 746

src/test-implementation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ On nightly rust, there's an unstable flag called `unpretty` that you can use
141141
to print out the module source after macro expansion:
142142

143143
```bash
144-
$ rustc my_mod.rs -Z unpretty=hir
144+
rustc my_mod.rs -Z unpretty=hir
145145
```
146146

147147
[test]: https://doc.rust-lang.org/test/index.html

src/tests/running.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ You can run the tests using `x.py`. The most basic command – which
44
you will almost never want to use! – is as follows:
55

66
```bash
7-
> ./x.py test
7+
./x.py test
88
```
99

1010
This will build the full stage 2 compiler and then run the whole test
@@ -34,7 +34,7 @@ test" that can be used after modifying rustc to see if things are
3434
generally working correctly would be the following:
3535

3636
```bash
37-
> ./x.py test --stage 1 src/test/{ui,compile-fail}
37+
./x.py test --stage 1 src/test/{ui,compile-fail}
3838
```
3939

4040
This will run the `ui` and `compile-fail` test suites,
@@ -44,44 +44,44 @@ example, if you are hacking on debuginfo, you may be better off with
4444
the debuginfo test suite:
4545

4646
```bash
47-
> ./x.py test --stage 1 src/test/debuginfo
47+
./x.py test --stage 1 src/test/debuginfo
4848
```
4949

5050
If you only need to test a specific subdirectory of tests for any
5151
given test suite, you can pass that directory to `x.py test`:
5252

5353
```bash
54-
> ./x.py test --stage 1 src/test/ui/const-generics
54+
./x.py test --stage 1 src/test/ui/const-generics
5555
```
5656

5757
Likewise, you can test a single file by passing its path:
5858

5959
```bash
60-
> ./x.py test --stage 1 src/test/ui/const-generics/const-test.rs
60+
./x.py test --stage 1 src/test/ui/const-generics/const-test.rs
6161
```
6262

6363
### Run only the tidy script
6464

6565
```bash
66-
> ./x.py test src/tools/tidy
66+
./x.py test src/tools/tidy
6767
```
6868

6969
### Run tests on the standard library
7070

7171
```bash
72-
> ./x.py test src/libstd
72+
./x.py test src/libstd
7373
```
7474

7575
### Run tests on the standard library and run the tidy script
7676

7777
```bash
78-
> ./x.py test src/libstd src/tools/tidy
78+
./x.py test src/libstd src/tools/tidy
7979
```
8080

8181
### Run tests on the standard library using a stage 1 compiler
8282

8383
```bash
84-
> ./x.py test src/libstd --stage 1
84+
./x.py test src/libstd --stage 1
8585
```
8686

8787
By listing which test suites you want to run you avoid having to run
@@ -100,7 +100,7 @@ you may pass the full file path to achieve this, or alternatively one
100100
may invoke `x.py` with the `--test-args` option:
101101

102102
```bash
103-
> ./x.py test --stage 1 src/test/ui --test-args issue-1234
103+
./x.py test --stage 1 src/test/ui --test-args issue-1234
104104
```
105105

106106
Under the hood, the test runner invokes the standard rust test runner
@@ -117,7 +117,7 @@ exists in the test file. For example, you can run all the tests in
117117
`src/test/ui` as `check-pass`:
118118

119119
```bash
120-
> ./x.py test --stage 1 src/test/ui --pass check
120+
./x.py test --stage 1 src/test/ui --pass check
121121
```
122122

123123
By passing `--pass $mode`, you can reduce the testing time. For each
@@ -131,7 +131,7 @@ You can further enable the `--incremental` flag to save additional
131131
time in subsequent rebuilds:
132132

133133
```bash
134-
> ./x.py test --stage 1 src/test/ui --incremental --test-args issue-1234
134+
./x.py test --stage 1 src/test/ui --incremental --test-args issue-1234
135135
```
136136

137137
If you don't want to include the flag with every command, you can
@@ -152,7 +152,7 @@ Sometimes it's easier and faster to just run the test by hand. Most tests are
152152
just `rs` files, so you can do something like
153153

154154
```bash
155-
> rustc +stage1 src/test/ui/issue-1234.rs
155+
rustc +stage1 src/test/ui/issue-1234.rs
156156
```
157157

158158
This is much faster, but doesn't always work. For example, some tests

0 commit comments

Comments
 (0)