-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Add "the Rustc book" #49707
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
Merged
Merged
Add "the Rustc book" #49707
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0dd0a5b
initialize the rustc book
steveklabnik b99418d
Add rustc book to the build system
steveklabnik 7de5b60
update doc index to link to the rustc book
steveklabnik c942bf4
Add a TOC
steveklabnik 4f6ed51
fix authorship in book.toml
steveklabnik 5424dc4
write headings for command line arguments
steveklabnik cd55364
write 'what is rustc'
steveklabnik 78b076d
add targets to TOC
steveklabnik 50b3a3d
add a lot of text about lints
steveklabnik df81ca3
document deny by default lints
steveklabnik 758a77d
more lints
steveklabnik 142c52f
fix tests
steveklabnik cb6a199
add codegen options section
steveklabnik cd3f6cf
fill out command line arguments
steveklabnik b204968
fill out contributing
steveklabnik 00c860e
write docs for targets
steveklabnik ac79c41
review nits
steveklabnik 36475d9
more nits
steveklabnik 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
write docs for targets
- Loading branch information
commit 00c860e8a908ae09eee0a3508a377fc6b7003d8c
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1 +1,10 @@ | ||
# Built-in Targets | ||
|
||
`rustc` ships with the ability to compile to many targets automatically, we | ||
call these "built-in" targets, and they generally correspond to targets that | ||
the team is supporting directly. | ||
|
||
To see the list of built-in targets, you can run `rustc --print target-list`, | ||
or look at [the API | ||
docs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_back/target/#modules). | ||
Each module there defines a builder for a particular target. |
This file contains hidden or 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 |
---|---|---|
@@ -1 +1,17 @@ | ||
# Custom Targets | ||
|
||
If you'd like to build for a target that is not yet supported by `rustc`, you can use a | ||
"custom target specification" to define a target. These target specification files | ||
are JSON. To see the JSON for the host target, you can run: | ||
|
||
```bash | ||
$ rustc +nightly -Z unstable-options --print target-spec-json | ||
``` | ||
|
||
To see it for a different target, add the `--target` flag: | ||
|
||
```bash | ||
$ rustc +nightly -Z unstable-options --target=wasm32-unknown-unknown --print target-spec-json | ||
``` | ||
|
||
To use a custom target, see [`xargo`](https://github.com/japaric/xargo). |
This file contains hidden or 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 |
---|---|---|
@@ -1 +1,14 @@ | ||
# Targets | ||
|
||
`rustc` is a cross-compiler by default. This means that you can use any compiler to build for any | ||
architecture. The list of *targets* are the possible architectures that you can build for. | ||
|
||
You can see the API docs for a given target | ||
[here](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_back/target/struct.Target.html), all | ||
of these options can be set on a per-target basis. | ||
|
||
To compile to a particular target, use the `--target` flag: | ||
|
||
```bash | ||
$ rustc src/main.rs --target=wasm32-unknown-unknown | ||
``` |
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.
This line seems a little off. My reading implies "this is the standard library available under any given target", but it's more like "these are the things that a target can specify".