Commit Graph

475 Commits

Author SHA1 Message Date
bors 9883a6250b auto merge of #9589 : thestinger/rust/tutorial, r=alexcrichton 2013-09-28 16:21:04 -07:00
Daniel Micay 6c8e6aad73 tutorial: rewrite the sections on boxes/moves 2013-09-28 17:01:46 -04:00
eliovir 835960a333 tutorial.md : correct formula in fn area()
change formula (other solution could be using abs()).
2013-09-24 10:21:18 +02:00
bors df8231e134 auto merge of #9439 : steveklabnik/rust/build_rustpkg_tutorial, r=brson
Three things in this commit:

1. Actually build the rustpkg tutorial. I didn't know I needed this when
   I first wrote it.
2. Link to it rather than the manual from the
   tutorial.
3. Update the headers: most of them were one level too deeply
   nested.
2013-09-23 22:26:06 -07:00
Patrick Walton 90d3da9711 test: Fix rustdoc and tests. 2013-09-23 18:23:22 -07:00
Steve Klabnik 06b11ba172 Add rustpkg tutorial to the official tutorials.
Three things in this commit:

1. Actually build the rustpkg tutorial. I didn't know I needed this when
   I first wrote it.
2. Link to it rather than the manual from the
   tutorial.
3. Update the headers: most of them were one level too deeply
   nested.
2013-09-23 14:36:38 -07:00
bors eb55348a7c auto merge of #9423 : madjar/rust/patch-1, r=alexcrichton
Just something I noticed while reading the tutorial.
2013-09-23 09:20:56 -07:00
Marvin Löbel bb7bc6c584 Extended the module tutorial section about files a bit 2013-09-23 16:33:11 +02:00
Georges Dubus 90e1e8fc40 Fixed a small typo in the tutorial
Just something I noticed while reading the tutorial.
2013-09-23 10:04:48 +02:00
Brian Anderson 695cb9fc2b Update version numbers to 0.8 2013-09-21 16:25:08 -07:00
bors b7bbc2eea2 auto merge of #9327 : larsbergstrom/rust/tutorial_installation_tweak, r=catamorphism
I've had multiple people whom I pointed at the Rust tutorial ask me where to download the snapshot compiler, so I made the text more explicit.
2013-09-20 09:56:09 -07:00
Lars Bergstrom 9051a35fc8 Clarify that snapshots are automatically retrieved. 2013-09-19 10:58:26 -05:00
blake2-ppc f0630fdc8b doc: Fix the tutorial's link to rustpkg docs 2013-09-19 01:43:10 -04:00
bors 29cdf58861 auto merge of #9244 : thestinger/rust/drop, r=catamorphism
This doesn't close any bugs as the goal is to convert the parameter to by-value, but this is a step towards being able to make guarantees about `&T` pointers (where T is Freeze) to LLVM.
2013-09-17 07:15:42 -07:00
Daniel Micay 4e161a4d40 switch Drop to `&mut self` 2013-09-16 22:19:23 -04:00
Steve Klabnik a0b9cc6a8b New rustpkg tutorial. 2013-09-16 16:30:49 -07:00
Erick Tryzelaar 7c08abb0ce Document the Zero trait 2013-09-12 18:54:13 -07:00
bors 4fa09e08ed auto merge of #8777 : Kimundi/rust/doc_stuff, r=cmr 2013-08-27 06:45:50 -07:00
Marvin Löbel 8f17ac9099 Rewrote module tutorial 2013-08-27 04:15:11 +02:00
blake2-ppc 026304cf15 doc: Link condition and error-handling tutorial from main tutorial 2013-08-26 18:10:40 +02:00
Ben Blum c678b22276 Talk about trait bounds in the tutorial. 2013-08-23 19:20:34 -04:00
Daniel Micay 46fc549fa9 rm obsolete integer to_str{,_radix} free functions 2013-08-20 22:05:03 -04:00
Corey Richardson 93fab48b52 Remove unnecessary return 2013-08-12 20:52:37 -04:00
Erick Tryzelaar f007a46d37 Merge branch 'master' of https://github.com/MAnyKey/rust into rollup 2013-08-10 13:03:34 -07:00
Erick Tryzelaar 5e1ca23a65 Merge branch 'vec-exh' of https://github.com/stepancheg/rust into rollup 2013-08-10 13:00:20 -07:00
Maxim Kolganov b4fe856645 typo in tutorial 2013-08-09 01:43:44 +04:00
Corey Richardson 878e74e1ce Fix more priv fallout 2013-08-08 17:02:03 -04:00
Stepan Koltsov 828bfb2c61 Fix incorrect non-exhaustive matching for fixed length vecs
Code like this is fixed now:

```
fn foo(p: [u8, ..4]) {
    match p {
        [a, b, c, d] => {}
    };
}
```

Invalid constructors are not reported as errors yet:

```
fn foo(p: [u8, ..4]) {
    match p {
        [_, _, _] => {} // this should be error
        [_, _, _, _, _, .._] => {} // and this
        _ => {}
    }
}
```

Issue #8311 is partially fixed by this commit. Fixed-length arrays in
let statement are not yet allowed:

```
let [a, b, c] = [1, 2, 3]; // still fails
```
2013-08-07 22:07:24 +04:00
Daniel Micay 8f9bbc476d remove `extra::iter`
This module provided adaptors for the old internal iterator protocol,
but they proved to be quite unreadable and are not generic enough to
handle borrowed pointers well.

Since Rust no longer defines an internal iteration protocol, I don't
think there's going to be any reuse via these adaptors.
2013-08-06 23:41:20 -04:00
Daniel Micay 87cf2864b1 rm obsolete documentation on `for`
it is documented in the container/iterator tutorial, not the basic
tutorial
2013-08-03 03:00:42 -04:00
Patrick Walton 887c656970 librustc: Introduce a new visitor type based on traits and port syntax to it.
This is preparation for removing `@fn`.

This does *not* use default methods yet, because I don't know
whether they work. If they do, a forthcoming PR will use them.

This also changes the precedence of `as`.
2013-08-02 21:57:58 -07:00
blake2-ppc 78cde5b9fb std: Change `Times` trait to use `do` instead of `for`
Change the former repetition::

    for 5.times { }

to::

    do 5.times { }

.times() cannot be broken with `break` or `return` anymore; for those
cases, use a numerical range loop instead.
2013-08-01 16:54:22 +02:00
Daniel Micay 1fc4db2d08 migrate many `for` loops to `foreach` 2013-08-01 05:34:55 -04:00
bors fddb35e988 auto merge of #7984 : gifnksm/rust/tutorial-links, r=bstrie 2013-07-29 09:16:22 -07:00
Alex Crichton b782d42cba Deny all warnings by default in doc tests
Allow some common ones that are good for examples, however.
2013-07-26 18:04:20 -07:00
gifnksm e68697b55e tutorial: Remove the sentence about mutable fields. 2013-07-23 12:18:54 +09:00
gifnksm 9aab7e59d7 tutorial: Fix obsolete names 2013-07-23 11:05:49 +09:00
gifnksm 8fb77c7099 tutorial: Repair broken links 2013-07-23 11:01:21 +09:00
zslayton 49014c8268 Exposed previously hidden 'use' statements in the tutorial's sample code. 2013-07-21 23:40:52 -04:00
bors 874eb1939b auto merge of #7845 : gifnksm/rust/tutorial-remove-dup, r=cmr
`pandoc` issues warnings.

```
pandoc: Duplicate link reference `[macros]' "source" (line 2151, column 1)
pandoc: Duplicate link reference `[tasks]' "source" (line 2150, column 1)
pandoc: Duplicate link reference `[wiki-start]' "source" (line 92, column 1)
```

This PR also removes unused link references.
2013-07-18 12:04:39 -07:00
Patrick Walton 2dbb3c3887 test: Fix tests. 2013-07-17 14:57:54 -07:00
gifnksm 827a6d26e6 tutorial: remove unused link references. 2013-07-17 15:38:26 +09:00
gifnksm 5d4b990fc6 tutorial: remove duplicate link references.
`pandoc` issues warnings.

```
pandoc: Duplicate link reference `[macros]' "source" (line 2151, column 1)
pandoc: Duplicate link reference `[tasks]' "source" (line 2150, column 1)
pandoc: Duplicate link reference `[wiki-start]' "source" (line 92, column 1)
```
2013-07-17 13:29:10 +09:00
Jens Nockert 20a2fbd055 I forgot the changes to the docs as well
Apparently yesterday wasn't my day, and I forgot to add the changes to
all the tests apparently, and in the end forgot the docs extra much.
Please documentation, forgive me, I really do love you, I hope you
forgive me.

Next time we'll meet tutorial, I promise to bring cookies and tea. I
really want to be best-friends-forever with you, <3.

XOXO
2013-07-09 18:24:30 +02:00
bors 55f155521d auto merge of #7523 : huonw/rust/uppercase-statics-lint, r=cmr
Adds a lint for `static some_lowercase_name: uint = 1;`. Warning by default since it causes confusion, e.g. `static a: uint = 1; ... let a = 2;` => `error: only refutable patterns allowed here`.
2013-07-03 04:31:50 -07:00
Brian Anderson a2db7c15ce doc: Update links to 0.7 2013-07-02 09:25:44 -07:00
Huon Wilson c437a16c5d rustc: add a lint to enforce uppercase statics. 2013-07-01 17:52:57 +10:00
Patrick Walton a1531ed946 librustc: Remove the broken overloaded assign-ops from the language.
They evaluated the receiver twice. They should be added back with
`AddAssign`, `SubAssign`, etc., traits.
2013-06-28 10:44:16 -04:00
Daniel Micay 659cd55e75 add a tutorial on containers and iterators 2013-06-28 00:24:09 -04:00
bors 22408d9ad5 auto merge of #7269 : luqmana/rust/drop, r=thestinger
Finally rename finalize to drop.
Closes #4332.
2013-06-25 20:29:06 -07:00