about summary refs log tree commit diff
path: root/src/doc/tutorial.md
AgeCommit message (Collapse)AuthorLines
2014-05-07auto merge of #13958 : pcwalton/rust/detilde, r=pcwaltonbors-66/+68
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. r? @brson or @alexcrichton or whoever
2014-05-07auto merge of #13914 : alexcrichton/rust/pile-o-rustdoc-fixes, r=brsonbors-1/+1
Lots of assorted things here and there, all the details are in the commits. Closes #11712
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-66/+68
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-06Update multiple file use statement exampleBrandon Waskiewicz-8/+10
Update the example to make the usage of `pub mod foo;` much more apparent, as well as using an example where setting the visibility of the module is actually necessary.
2014-05-05doc: Corrected example in 17.8 Deriving implementations for traitsMike Boutin-1/+8
Corrected example to to use Rand trait referenced in preceding description and included an example using the Show trait to print ABC.
2014-05-05doc: Minor example formatting in 11 ReferencesMike Boutin-1/+1
2014-05-05doc: Clarified 4.2 Pattern matchingMike Boutin-13/+10
Combined redundant paragraphs about the match expression and removed a redundant example.
2014-05-05Update minimum g++ version in documentationJames Laverack-1/+1
Version changed due to a newer requirement in LLVM.
2014-05-04auto merge of #13676 : mdinger/rust/tutorial_doc, r=pnkfelixbors-17/+82
Improve tutorial discussion of closures, e.g. with respect to type inference and variable capture. Fix #13621 ---- original description follows I'd like this pulled to master if possible but if not I'd appreciate comments on what I need to change. I found the closures difficult to understand as they were so I tried to explain it so I would've had an easier time understanding it. I think it's better at least, somewhat. I don't know that everyone liked the `-> ()` I included but I thought explicit is best to aid understanding. I thought it was much harder to understand than it should have been. [EDIT] - Clicked too early. This doesn't `make check` without errors on my Xubuntu on Virtualbox machine. Not sure why. I don't think I changed anything problematic. I'll try `make check` on master tomorrow. Opened https://github.com/mozilla/rust/issues/13621 regarding this.
2014-05-03rustdoc: Migrate from sundown to hoedownAlex Crichton-1/+1
This primary fix brought on by this upgrade is the proper matching of the ``` and ~~~ doc blocks. This also moves hoedown to a git submodule rather than a bundled repository. Additionally, hoedown is stricter about code blocks, so this ended up fixing a lot of invalid code blocks (ending with " ```" instead of "```", or ending with "~~~~" instead of "~~~"). Closes #12776
2014-05-01Fix a/an typosJorge Aparicio-1/+1
2014-05-01auto merge of #13881 : aochagavia/rust/pr, r=alexcrichtonbors-1/+1
2014-05-01Fixed outdated note in the tutorialAdolfo Ochagavía-1/+1
2014-05-01rustdoc tutorial: grammar change in list commentsJustin Noah-3/+3
2014-04-30Suggested revisions to PR 13676.Felix S. Klock II-28/+53
Most important: distinguish function decl sugar for omitting `-> ()` from type inference on closures. I also tried to add a couple more examples to further emphasize this distinction. Note that this sugar (of omitting `-> ()`) is actually already briefly mentioned in an earlier section, so it is a little tricky deciding whether to put more material here, or to move it up to the previous section. Other drive-by fixes: * Fix the line length of the code blocks to fit in the width provided in the rendered HTML * Some minor revisions to wording (e.g. try to clarify in some cases where a type mismatch is arising).
2014-04-30Remove extra semicolonsmdinger-2/+2
2014-04-30Fix typomdinger-1/+1
2014-04-29auto merge of #13776 : adrientetar/rust/rustdoc-fix, r=brsonbors-9/+13
- Closes #13591. Relevant example: http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm (Had to use `!important` to override CSS selector precedence, namely matching over parent class.) - Implement changes from #13780 feedback, namely: * Changed font-size from 18px to 15px * Reintroduced gray background for code samples * Tightened up the margins - Fix point 1 and point 4 of #13804. Samples: - [enum.FileType](http://adrientetar.legtux.org/cached/rust-docs/enum.FileType.htm) - [struct.CChars](http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm) - [std](http://adrientetar.legtux.org/cached/rust-docs/std.htm) - [std::io](http://adrientetar.legtux.org/cached/rust-docs/io.htm). r? @brson
2014-04-27doc: Remove out-of-place debug! noteMichael Pratt-5/+0
As of cc6ec8df, the Owned closures example uses println! instead of debug!, making a note about seeing debug seem out-of-place in this section. Since debug! is not used elsewhere in the tutorial, remove the note entirely.
2014-04-27doc: perform some 80-chars wrappingsAdrien Tétar-9/+13
2014-04-22auto merge of #13683 : aochagavia/rust/pr, r=alexcrichtonbors-1/+1
Replaced "len" by "length", to match the given code example.
2014-04-22auto merge of #13673 : bmac/rust/utorial-fix, r=alexcrichtonbors-1/+1
This pr updates the "Additional tutorials" link in the scope section to match the "What next?" link in the table of contents.
2014-04-22Some more closure changesmdinger-33/+46
2014-04-22Fixed typo in tutorialAdolfo Ochagavía-1/+1
Replaced "len" by "length", to match the given code example.
2014-04-21auto merge of #13587 : adrientetar/rust/more-docs, r=brsonbors-16/+15
- Use Fira Sans for headlines, Heuristica for the body (Adobe Utopia derivative). Both are licensed under the SIL OFL license. (I didn't include BoldItalic because it is sparingly used.) - Split TOC into 2 columns for the docs except manual (too tall, too wide to be readable). - Some fixes to rustdoc, bring styles in coherency with eachother - A few tweaks Two examples: [modified tutorial](http://adrientetar.legtux.org/cached/rust-docs/tutorial.htm) and [modified manual](http://adrientetar.legtux.org/cached/rust-docs/manual.htm). Rustdoc got some fixes, here is [modified `enum.FileType`](http://adrientetar.legtux.org/cached/rust-docs/enum.FileType.htm), [modified `std`](http://adrientetar.legtux.org/cached/rust-docs/std.htm) and [modified `std::io`](http://adrientetar.legtux.org/cached/rust-docs/io.htm). #13484, #13485 follow-up. cc @brson
2014-04-21Update the "Additional tutorials" linkBrendan McLoughlin-1/+1
2014-04-20Fix call order to be the same as definition orderGary M. Josack-1/+1
2014-04-19Demonstrate accessing external variable in first examplemdinger-11/+16
2014-04-19doc: add webfonts and tweak the styles accordinglyAdrien Tétar-16/+15
2014-04-19Give more explanation when introducing closures mdinger-7/+29
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-2/+2
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-4/+4
2014-04-14auto merge of #13477 : Manishearth/rust/newattr, r=brsonbors-7/+7
See #13476
2014-04-12Update tutorials to use new attribute syntax (#13476)Manish Goregaokar-7/+7
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-1/+3
port all code over to use it.
2014-04-04Removed all instance of `@` in code examples.Christopher Kendell-8/+7
2014-04-04Small change to example to make variable values more sensible.Christopher Kendell-2/+2
2014-04-04auto merge of #13298 : ckendell/rust/remove_managed_pointers_from_tutorial, ↵bors-21/+14
r=cmr Work on #13287 This is not ready for a merge yet, but I wanted to get some eyes on what I have done so far. As of right now, all references in the text to managed boxes or pointers are removed. Code associated with those specific sections of text have likewise been altered. I also removed all references to managed closures. There is a small change I would like to add to the work done in 3137cd5, on the new lines 1495 and 1496, I would like to change those values to 10 and 20. I did the same in a later change on lines 1596 and 1508. There are still bits of sample code that use managed pointers and the sigil @. Those are next on my list to remove, but I wanted to have the outstanding changes reviewed first. The uses of @ in the code samples are a bit more embedded, and I will need to be more careful changing them as to not change the purpose of the code examples. I ensured that make check still passes, although I'm not sure if that actually tests the code in tutorial.md. One issues I ran into, and tried to avoid, was that `tutorial.md` is formatted with a nice column limit. I was unsure how this was enforced, so wherever I edited a line, I did my best to keep edits on the line they previously existed on. As such, the plain text of `tutorial.md` looks a bit strange as I've left it, and I will clean that up as suggested. The rendered markdown output should not be affected.
2014-04-03auto merge of #13296 : brson/rust/0.11-pre, r=alexcrichtonbors-5/+5
This also changes some of the download links in the documentation to 'nightly'.
2014-04-03auto merge of #13290 : alexcrichton/rust/rollup, r=alexcrichtonbors-8/+5
Closes #13285 (rustc: Stop using LLVMGetSectionName) Closes #13280 (std: override clone_from for Vec.) Closes #13277 (serialize: add a few missing pubs to base64) Closes #13275 (Add and remove some ignore-win32 flags) Closes #13273 (Removed managed boxes from libarena.) Closes #13270 (Minor copy-editing for the tutorial) Closes #13267 (fix Option<~ZeroSizeType>) Closes #13265 (Update emacs mode to support new `#![inner(attribute)]` syntax.) Closes #13263 (syntax: Remove AbiSet, use one Abi)
2014-04-03Bump version to 0.11-preBrian Anderson-5/+5
This also changes some of the download links in the documentation to 'nightly'.
2014-04-03Removed all references to managed closures.Christopher Kendell-3/+3
2014-04-03Removed references to managed boxes/pointers from the tutorial text. CodeChristopher Kendell-19/+12
examples in relevant sections were similarly altered.
2014-04-03auto merge of #13286 : alexcrichton/rust/release, r=brsonbors-5/+5
Merging the 0.10 release into the master branch.
2014-04-03Minor spelling/grammar/usage fixes.Matt Brubeck-4/+4
Note: "different to" is not exactly incorrect, but "different from" is more commonly accepted in both US and Commonwealth English, and also more consistent with other usage within this tutorial.
2014-04-03Fix reference to "these two traits."Matt Brubeck-1/+1
There are actually three traits listed.
2014-04-03`extern crate` and `mod` are not easily confusedMatt Brubeck-3/+0
Remove some statements that used to refer to similarities between `mod` and `extern mod`, before the latter was renamed to `extern crate`.
2014-04-01auto merge of #13225 : thestinger/rust/num, r=cmrbors-5/+3
The `Float` trait methods will be usable as functions via UFCS, and we came to a consensus to remove duplicate functions like this a long time ago. It does still make sense to keep the duplicate functions when the trait methods are static, unless the decision to leave out the in-scope trait name resolution for static methods changes.
2014-03-31doc: Update with changes in field privacyAlex Crichton-4/+4
2014-03-31num: rm wrapping of `Float` methods as functionsDaniel Micay-5/+3
The `Float` trait methods will be usable as functions via UFCS, and we came to a consensus to remove duplicate functions like this a long time ago. It does still make sense to keep the duplicate functions when the trait methods are static, unless the decision to leave out the in-scope trait name resolution for static methods changes.