Skip to content

Commit

Permalink
docs: Use dollar sign for all bash prompts
Browse files Browse the repository at this point in the history
Making it consistent across the board, as most of them already use `$`.

Also split one continues bash run into two, to make it easier see
different runs: one with warning and another with error.
  • Loading branch information
behnam committed Sep 9, 2018
1 parent 0198a1e commit 88fe8ac
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ you have a more recent version installed the build system doesn't understand
then you may need to force rustbuild to use an older version. This can be done
by manually calling the appropriate vcvars file before running the bootstrap.

```
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
python x.py build
```batch
> CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
> python x.py build
```

#### Specifying an ABI
Expand Down
18 changes: 9 additions & 9 deletions src/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ system.

The rustbuild build system has a primary entry point, a top level `x.py` script:

```
python ./x.py build
```sh
$ python ./x.py build
```

Note that if you're on Unix you should be able to execute the script directly:

```
./x.py build
```sh
$ ./x.py build
```

The script accepts commands, flags, and arguments to determine what to do:
Expand Down Expand Up @@ -129,18 +129,18 @@ To follow this course of action, first thing you will want to do is to
install a nightly, presumably using `rustup`. You will then want to
configure your directory to use this build, like so:

```
```sh
# configure to use local rust instead of downloading a beta.
# `--local-rust-root` is optional here. If elided, we will
# use whatever rustc we find on your PATH.
> ./configure --local-rust-root=~/.cargo/ --enable-local-rebuild
$ ./configure --local-rust-root=~/.cargo/ --enable-local-rebuild
```

After that, you can use the `--incremental` flag to actually do
incremental builds:

```
> ./x.py build --incremental
```sh
$ ./x.py build --incremental
```

The `--incremental` flag will store incremental compilation artifacts
Expand All @@ -159,7 +159,7 @@ will still be using the local nightly as your bootstrap).
This build system houses all output under the `build` directory, which looks
like this:

```
```sh
# Root folder of all output. Everything is scoped underneath here
build/

Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/lints/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $ cat main.rs
fn main() {
let x = 5;
}
> rustc main.rs
$ rustc main.rs
warning: unused variable: `x`
--> main.rs:2:9
|
Expand Down
15 changes: 9 additions & 6 deletions src/doc/rustc/src/lints/levels.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn foo() {

This will produce this warning:

```console
```bash
$ rustc lib.rs --crate-type=lib
warning: unused variable: `x`
--> lib.rs:2:9
Expand All @@ -69,7 +69,7 @@ fn main() {
```

```bash
> rustc main.rs
$ rustc main.rs
error: bitshift exceeds the type's number of bits
--> main.rs:2:13
|
Expand Down Expand Up @@ -129,7 +129,10 @@ warning: missing documentation for a function
|
1 | pub fn foo() {}
| ^^^^^^^^^^^^
> rustc lib.rs --crate-type=lib -D missing-docs
```
```bash
$ rustc lib.rs --crate-type=lib -D missing-docs
error: missing documentation for crate
--> lib.rs:1:1
|
Expand All @@ -150,21 +153,21 @@ error: aborting due to 2 previous errors
You can also pass each flag more than once for changing multiple lints:
```bash
rustc lib.rs --crate-type=lib -D missing-docs -D unused-variables
$ rustc lib.rs --crate-type=lib -D missing-docs -D unused-variables
```
And of course, you can mix these four flags together:
```bash
rustc lib.rs --crate-type=lib -D missing-docs -A unused-variables
$ rustc lib.rs --crate-type=lib -D missing-docs -A unused-variables
```
### Via an attribute
You can also modify the lint level with a crate-wide attribute:
```bash
> cat lib.rs
$ cat lib.rs
#![warn(missing_docs)]
pub fn foo() {}
Expand Down

0 comments on commit 88fe8ac

Please sign in to comment.