X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fdoc%2Frust.md;h=2ffe22cba7553b00660beec8f188860c82fc4e02;hb=3f299ff19ddb3ee4752e6db120689189ab4c4231;hp=0d1331e6077cd9d2270c0872f14658f700a6bff0;hpb=79a5448f41dcc6ab52663105a6b02fc5af4c503e;p=rust.git diff --git a/src/doc/rust.md b/src/doc/rust.md index 0d1331e6077..2ffe22cba75 100644 --- a/src/doc/rust.md +++ b/src/doc/rust.md @@ -2557,6 +2557,8 @@ The currently implemented features of the reference compiler are: * `tuple_indexing` - Allows use of tuple indexing (expressions like `expr.0`) +* `associated_types` - Allows type aliases in traits. Experimental. + If a feature is promoted to a language feature, then all existing programs will start to receive compilation warnings about #[feature] directives which enabled the new feature (because the directive is no longer necessary). However, if @@ -3698,7 +3700,7 @@ There are two varieties of pointer in Rust: they exist to support interoperability with foreign code, and writing performance-critical or low-level functions. -The standard library contains addtional 'smart pointer' types beyond references +The standard library contains additional 'smart pointer' types beyond references and raw pointers. ### Function types @@ -3831,8 +3833,9 @@ fn map(f: |A| -> B, xs: &[A]) -> Vec { return vec![]; } let first: B = f(xs[0].clone()); - let rest: Vec = map(f, xs.slice(1, xs.len())); - return vec![first].append(rest.as_slice()); + let mut rest: Vec = map(f, xs.slice(1, xs.len())); + rest.insert(0, first); + return rest; } ~~~~