auto merge of #13489 : JustAPerson/rust/crate-file-name, r=alexcrichton

Before, the `--crate-file-name` flag only checked crate attributes for
possible crate types. Now, if any type is specified by one or more
`--crate-type` flags, only the filenames for those types will be
emitted, and any types specified by crate attributes will be ignored.
This commit is contained in:
bors 2014-04-15 11:02:03 -07:00
commit 189584e792
4 changed files with 73 additions and 34 deletions

View file

@ -3920,7 +3920,9 @@ link Rust crates together, and more information about native libraries can be
found in the [ffi tutorial][ffi].
In one session of compilation, the compiler can generate multiple artifacts
through the usage of command line flags and the `crate_type` attribute.
through the usage of either command line flags or the `crate_type` attribute.
If one or more command line flag is specified, all `crate_type` attributes will
be ignored in favor of only building the artifacts specified by command line.
* `--crate-type=bin`, `#[crate_type = "bin"]` - A runnable executable will be
produced. This requires that there is a `main` function in the crate which
@ -3963,7 +3965,10 @@ through the usage of command line flags and the `crate_type` attribute.
Note that these outputs are stackable in the sense that if multiple are
specified, then the compiler will produce each form of output at once without
having to recompile.
having to recompile. However, this only applies for outputs specified by the same
method. If only `crate_type` attributes are specified, then they will all be
built, but if one or more `--crate-type` command line flag is specified,
then only those outputs will be built.
With all these different kinds of outputs, if crate A depends on crate B, then
the compiler could find B in various different forms throughout the system. The