auto merge of #5040 : Kimundi/rust/incoming, r=graydon

This commit is contained in:
bors 2013-02-19 15:50:28 -08:00
commit eed2ca61a9

View File

@ -114,8 +114,9 @@ for more information on them.
When complete, `make install` will place several programs into
`/usr/local/bin`: `rustc`, the Rust compiler; `rustdoc`, the
API-documentation tool; `cargo`, the Rust package manager;
and `rusti`, the Rust REPL.
API-documentation tool; `rustpkg`, the Rust package manager;
`rusti`, the Rust REPL; and `rust`, a tool which acts both as a unified
interface for them, and for a few common command line scenarios.
[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
[tarball]: http://static.rust-lang.org/dist/rust-0.5.tar.gz
@ -154,6 +155,22 @@ declaration to appear at the top level of the file: all statements must
live inside a function. Rust programs can also be compiled as
libraries, and included in other programs.
## Using the rust tool
While using `rustc` directly to generate your executables, and then
running them manually is a perfectly valid way to test your code,
for smaller projects, prototypes, or if you're a beginner, it might be
more convenient to use the `rust` tool.
The `rust` tool provides central access to the other rust tools,
as well as handy shortcuts for directly running source files.
For example, if you have a file `foo.rs` in your current directory,
`rust run foo.rs` would attempt to compile it and, if successful,
directly run the resulting binary.
To get a list of all available commands, simply call `rust` without any
argument.
## Editing Rust code
There are vim highlighting and indentation scripts in the Rust source
@ -2184,7 +2201,7 @@ impl Circle for CircleStruct {
}
impl Shape for CircleStruct {
fn area(&self) -> float { pi * square(self.radius) }
}
}
~~~~
Notice that methods of `Circle` can call methods on `Shape`, as our