mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Fix some std/extra language in the tutorial
This commit is contained in:
parent
21c3cf02f0
commit
cc4fabcb43
@ -1480,7 +1480,6 @@ This code creates a closure that adds a given string to its argument,
|
|||||||
returns it from a function, and then calls it:
|
returns it from a function, and then calls it:
|
||||||
|
|
||||||
~~~~
|
~~~~
|
||||||
# extern mod std;
|
|
||||||
fn mk_appender(suffix: ~str) -> @fn(~str) -> ~str {
|
fn mk_appender(suffix: ~str) -> @fn(~str) -> ~str {
|
||||||
// The compiler knows that we intend this closure to be of type @fn
|
// The compiler knows that we intend this closure to be of type @fn
|
||||||
return |s| s + suffix;
|
return |s| s + suffix;
|
||||||
@ -2292,7 +2291,7 @@ let nonsense = mycircle.radius() * mycircle.area();
|
|||||||
|
|
||||||
## Deriving implementations for traits
|
## Deriving implementations for traits
|
||||||
|
|
||||||
A small number of traits in `std` and `std` can have implementations
|
A small number of traits in `std` and `extra` can have implementations
|
||||||
that can be automatically derived. These instances are specified by
|
that can be automatically derived. These instances are specified by
|
||||||
placing the `deriving` attribute on a data type declaration. For
|
placing the `deriving` attribute on a data type declaration. For
|
||||||
example, the following will mean that `Circle` has an implementation
|
example, the following will mean that `Circle` has an implementation
|
||||||
@ -2541,9 +2540,9 @@ as well as an inscrutable string of alphanumerics. These are both
|
|||||||
part of Rust's library versioning scheme. The alphanumerics are
|
part of Rust's library versioning scheme. The alphanumerics are
|
||||||
a hash representing the crate metadata.
|
a hash representing the crate metadata.
|
||||||
|
|
||||||
## The std library
|
## The standard library
|
||||||
|
|
||||||
The Rust std library provides runtime features required by the language,
|
The Rust standard library provides runtime features required by the language,
|
||||||
including the task scheduler and memory allocators, as well as library
|
including the task scheduler and memory allocators, as well as library
|
||||||
support for Rust built-in types, platform abstractions, and other commonly
|
support for Rust built-in types, platform abstractions, and other commonly
|
||||||
used features.
|
used features.
|
||||||
@ -2559,7 +2558,7 @@ I/O abstractions ([`io`]), [containers] like [`hashmap`],
|
|||||||
common traits ([`kinds`], [`ops`], [`cmp`], [`num`],
|
common traits ([`kinds`], [`ops`], [`cmp`], [`num`],
|
||||||
[`to_str`], [`clone`]), and complete bindings to the C standard library ([`libc`]).
|
[`to_str`], [`clone`]), and complete bindings to the C standard library ([`libc`]).
|
||||||
|
|
||||||
### Core injection and the Rust prelude
|
### Standard Library injection and the Rust prelude
|
||||||
|
|
||||||
`std` is imported at the topmost level of every crate by default, as
|
`std` is imported at the topmost level of every crate by default, as
|
||||||
if the first line of each crate was
|
if the first line of each crate was
|
||||||
@ -2571,7 +2570,7 @@ with the `std::` path prefix, as in `use std::vec`, `use std::task::spawn`,
|
|||||||
etc.
|
etc.
|
||||||
|
|
||||||
Additionally, `std` contains a `prelude` module that reexports many of the
|
Additionally, `std` contains a `prelude` module that reexports many of the
|
||||||
most common std modules, types and traits. The contents of the prelude are
|
most common standard modules, types and traits. The contents of the prelude are
|
||||||
imported into every *module* by default. Implicitly, all modules behave as if
|
imported into every *module* by default. Implicitly, all modules behave as if
|
||||||
they contained the following prologue:
|
they contained the following prologue:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user