docs: Use dollar sign for all bash prompts
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.
This commit is contained in:
parent
0198a1ea45
commit
88fe8acd89
|
@ -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
|
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.
|
by manually calling the appropriate vcvars file before running the bootstrap.
|
||||||
|
|
||||||
```
|
```batch
|
||||||
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
|
> CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
|
||||||
python x.py build
|
> python x.py build
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Specifying an ABI
|
#### Specifying an ABI
|
||||||
|
|
|
@ -8,14 +8,14 @@ system.
|
||||||
|
|
||||||
The rustbuild build system has a primary entry point, a top level `x.py` script:
|
The rustbuild build system has a primary entry point, a top level `x.py` script:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
python ./x.py build
|
$ python ./x.py build
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that if you're on Unix you should be able to execute the script directly:
|
Note that if you're on Unix you should be able to execute the script directly:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
./x.py build
|
$ ./x.py build
|
||||||
```
|
```
|
||||||
|
|
||||||
The script accepts commands, flags, and arguments to determine what to do:
|
The script accepts commands, flags, and arguments to determine what to do:
|
||||||
|
@ -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
|
install a nightly, presumably using `rustup`. You will then want to
|
||||||
configure your directory to use this build, like so:
|
configure your directory to use this build, like so:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
# configure to use local rust instead of downloading a beta.
|
# configure to use local rust instead of downloading a beta.
|
||||||
# `--local-rust-root` is optional here. If elided, we will
|
# `--local-rust-root` is optional here. If elided, we will
|
||||||
# use whatever rustc we find on your PATH.
|
# 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
|
After that, you can use the `--incremental` flag to actually do
|
||||||
incremental builds:
|
incremental builds:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
> ./x.py build --incremental
|
$ ./x.py build --incremental
|
||||||
```
|
```
|
||||||
|
|
||||||
The `--incremental` flag will store incremental compilation artifacts
|
The `--incremental` flag will store incremental compilation artifacts
|
||||||
|
@ -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
|
This build system houses all output under the `build` directory, which looks
|
||||||
like this:
|
like this:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
# Root folder of all output. Everything is scoped underneath here
|
# Root folder of all output. Everything is scoped underneath here
|
||||||
build/
|
build/
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ $ cat main.rs
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 5;
|
let x = 5;
|
||||||
}
|
}
|
||||||
> rustc main.rs
|
$ rustc main.rs
|
||||||
warning: unused variable: `x`
|
warning: unused variable: `x`
|
||||||
--> main.rs:2:9
|
--> main.rs:2:9
|
||||||
|
|
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ pub fn foo() {
|
||||||
|
|
||||||
This will produce this warning:
|
This will produce this warning:
|
||||||
|
|
||||||
```console
|
```bash
|
||||||
$ rustc lib.rs --crate-type=lib
|
$ rustc lib.rs --crate-type=lib
|
||||||
warning: unused variable: `x`
|
warning: unused variable: `x`
|
||||||
--> lib.rs:2:9
|
--> lib.rs:2:9
|
||||||
|
@ -69,7 +69,7 @@ fn main() {
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
> rustc main.rs
|
$ rustc main.rs
|
||||||
error: bitshift exceeds the type's number of bits
|
error: bitshift exceeds the type's number of bits
|
||||||
--> main.rs:2:13
|
--> main.rs:2:13
|
||||||
|
|
|
|
||||||
|
@ -129,7 +129,10 @@ warning: missing documentation for a function
|
||||||
|
|
|
|
||||||
1 | pub fn foo() {}
|
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
|
error: missing documentation for crate
|
||||||
--> lib.rs:1:1
|
--> lib.rs:1:1
|
||||||
|
|
|
|
||||||
|
@ -150,13 +153,13 @@ error: aborting due to 2 previous errors
|
||||||
You can also pass each flag more than once for changing multiple lints:
|
You can also pass each flag more than once for changing multiple lints:
|
||||||
|
|
||||||
```bash
|
```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:
|
And of course, you can mix these four flags together:
|
||||||
|
|
||||||
```bash
|
```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
|
### Via an attribute
|
||||||
|
@ -164,7 +167,7 @@ rustc lib.rs --crate-type=lib -D missing-docs -A unused-variables
|
||||||
You can also modify the lint level with a crate-wide attribute:
|
You can also modify the lint level with a crate-wide attribute:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
> cat lib.rs
|
$ cat lib.rs
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
pub fn foo() {}
|
pub fn foo() {}
|
||||||
|
|
Loading…
Reference in New Issue