-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start documenting rustc #209
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Tools | ||
|
||
The official Rust tool suite contains a variety of tools for dealing with Rust | ||
code and associated artifacts. | ||
|
||
[`rustc`][rustc] is the Rust language compiler. | ||
|
||
[`rustdoc`][rustdoc] is the documentation tool which generates documentation from Rust | ||
source code. | ||
|
||
`cargo` is the Rust package manager. | ||
|
||
[rustc]: tools/rustc.html | ||
[rustdoc]: tools/rustdoc.html | ||
[cargo]: tools/cargo.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Cargo | ||
|
||
`cargo` has its own reference [here](../cargo/reference/index.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# `rustc` | ||
|
||
The Rust compiler has many options and can accept a wide variety of arguments, | ||
and its behavior can vary depending on the values of several environment | ||
variables. | ||
|
||
We document the compiler's command-line options, arguments, and operative | ||
environment variables here. | ||
|
||
Some discussions of environment variables exists in the [Linkage](linkage.html) | ||
chapter and the [Operator expressions](expressions/operator-expr.html#overflow) | ||
chapter. | ||
|
||
## Lint options | ||
|
||
-W, --warn OPT Set lint warnings | ||
-A, --allow OPT Set lint allowed | ||
-D, --deny OPT Set lint denied | ||
-F, --forbid OPT Set lint forbidden | ||
--cap-lints LEVEL | ||
Set the most restrictive lint level. More restrictive | ||
lints are capped at this level | ||
|
||
## Codegen options | ||
|
||
`rustc` provides many options for codegen, all accessible as arguments to the | ||
`-C` option. | ||
|
||
### Debug info | ||
|
||
To produce output with debug info use the `-C debuginfo=val` option, where | ||
`val` may be one of `0`, `1`, or `2`. The default is `0`. | ||
- `0` means output no debug info | ||
- `1` means output only line tables | ||
- `2` means output full debug info with variable and type information | ||
|
||
Providing the `-g` option is equivalent to `-C debuginfo=2`. If both `-g` and | ||
`-C debuginfo` are provided, the compiler will complain. | ||
|
||
### Optimization | ||
|
||
To produce optimized output, use the `-C opt-level=val` option, where `val` | ||
may be one of `0`, `1`, `2`, `3`. The default is `0`. | ||
|
||
The numbers indicate increasing levels of optimization for execution speed, | ||
with `0` meaning no optimizations, and `3` meaning aggressive optimization. | ||
|
||
Providing the option `-O` is equivalent to `-C opt-level=2`. If both `-O` and | ||
`-C opt-level` are provided, the compiler will complain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# `rustdoc` | ||
|
||
`rustdoc` has its own book [here](../rustdoc/index.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be part of a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no: that feature is already documented here, so I'm just cleaning this list up.