about summary refs log tree commit diff
path: root/src/doc/tutorial.md
AgeCommit message (Collapse)AuthorLines
2018-05-17Update tutorial.mdMikela-1/+1
2018-05-17Make sure people know the book is free olineMikela-1/+1
2015-01-13Re-direct to the right place.Steve Klabnik-1/+1
Why redirect Tutorial -> Guide -> Book when you can just Tutorial -> Book? Suggested here: http://www.reddit.com/r/rust/comments/2schav/is_it_possible_to_automatically_redirect/
2014-09-11only deprecate the guide rather than :fire: :fire: :fire:Steve Klabnik-3397/+2
2014-09-08librustc: Change the syntax of subslice matching to use postfix `..`Patrick Walton-1/+1
instead of prefix `..`. This breaks code that looked like: match foo { [ first, ..middle, last ] => { ... } } Change this code to: match foo { [ first, middle.., last ] => { ... } } RFC #55. Closes #16967. [breaking-change]
2014-08-18libsyntax: Remove the `use foo = bar` syntax from the language in favorPatrick Walton-2/+2
of `use bar as foo`. Change all uses of `use foo = bar` to `use bar as foo`. Implements RFC #47. Closes #16461. [breaking-change]
2014-08-11Update docs to use HTTPS for static.rust-lang.org addressesBrian Anderson-3/+3
cc #16123
2014-08-11auto merge of #15410 : LemmingAvalanche/rust/patch-1, r=alexcrichtonbors-0/+10
People reading the tutorial may not be familiar with the convention of naming lists, vectors and the like as xs, ys, etc. Without some explanation of the reasoning behind it, it might come off as just throwaway non-descriptive names. Languages like Haskell gets flak from using short, non-descriptive names, while in reality, there are clear conventions and reasons for using certain terse variable names. This is just a proposed explanation of this convention, as I've interpreted it - I assumed that the convention came from a language like Haskell, so I tailored it according to that. So beware that I might have misjudged how it is used in the Rust language, or at least how it is used in the Rust tutorial.
2014-08-10Note naming convention of lists (xs, ys, ...)LemmingAvalanche-0/+10
People reading the tutorial may not be familiar with the convention of naming lists, vectors and the like as xs, ys, etc. Without some explanation of the reasoning behind it, it might come off as just throwaway non-descriptive names. Languages like Haskell gets flak from using short, non-descriptive names, while in reality, there are clear conventions and reasons for using certain terse variable names. I assumed that the convention came from a language like Haskell, so I tailored the explanation according to that.
2014-08-08auto merge of #16285 : alexcrichton/rust/rename-share, r=huonwbors-4/+4
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-08-07Rename `Share` to `Sync`Alex Crichton-4/+4
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-08-06Fix typo in the tutorialAdrien Brault-1/+1
2014-08-04docs: Fix typo in tutorial.Ruud van Asseldonk-1/+1
2014-07-31fix variable name in tutorialDJUrsus-1/+1
2014-07-24libsyntax: Remove `~self` and `mut ~self` from the language.Patrick Walton-3/+3
This eliminates the last vestige of the `~` syntax. Instead of `~self`, write `self: Box<TypeOfSelf>`; instead of `mut ~self`, write `mut self: Box<TypeOfSelf>`, replacing `TypeOfSelf` with the self-type parameter as specified in the implementation. Closes #13885. [breaking-change]
2014-07-20auto merge of #15745 : treeman/rust/tutorial-fixup, r=steveklabnikbors-22/+48
Simplify example in 5.2 to remove hidden `#[deriving(Show)]`. Traits haven't been introduced yet and now it's easier to just type in the code and expect it to work. Add in some examples for constructing the enum types. Explicitly expose `#![feature(struct_variant)]` in the code to make it more transparent, this bit me when I worked through the tutorial. Add references in chapter 8 to later chapters describing `Rc`, `Gc` and `Send`. This is a simple fix for #15293. Simplify vector indexing example in chapter 13 and removed hidden, unnecessary, code. Gave an example usage of the derived `Rand` trait in chapter 17. Removed references to removed 'extra' crate.
2014-07-17librustc: Remove cross-borrowing of `Box<T>` to `&T` from the language,Patrick Walton-6/+4
except where trait objects are involved. Part of issue #15349, though I'm leaving it open for trait objects. Cross borrowing for trait objects remains because it is needed until we have DST. This will break code like: fn foo(x: &int) { ... } let a = box 3i; foo(a); Change this code to: fn foo(x: &int) { ... } let a = box 3i; foo(&*a); [breaking-change]
2014-07-17Small fixes for tutorial.Jonas Hietala-22/+48
5.2 Simplify example to remove hidden #[deriving(Show)]. Add example for constructing the enums. 8 Reference later sections describing rc, gc and send. Fix for #15293. 13 Simplify BananaMania example to remove hidden code. 17 Gave an example using the derived Rand trait. Removed references to removed 'extra' crate.
2014-07-17deprecate Vec::getNick Cameron-1/+1
2014-07-15doc: missing quote in keyword SendYazhong Liu-1/+1
2014-07-04add a missing closing parensdgoon-1/+1
2014-07-03correct a few spelling mistakes in the tutorialNathan Froyd-3/+3
2014-06-29librustc: Remove the fallback to `int` for integers and `f64` forPatrick Walton-25/+24
floating point numbers for real. This will break code that looks like: let mut x = 0; while ... { x += 1; } println!("{}", x); Change that code to: let mut x = 0i; while ... { x += 1; } println!("{}", x); Closes #15201. [breaking-change]
2014-06-27auto merge of #15166 : ↵bors-5/+6
zookoatleastauthoritycom/rust/13570-add-see-below-to-a-reference-to-a-new-concept-2, r=huonw This is the same patch as submitted to https://github.com/rust-lang/rust/issues/13570 and https://github.com/rust-lang/rust/pull/14124, but with @pnkfelix's comment (https://github.com/rust-lang/rust/pull/14124#issuecomment-42797536) addressed, and with reflow as a separate commit. I'm submitting it in case @steveklabnik hasn't yet merged a rewrite of the tutorial (https://github.com/rust-lang/rust/issues/13570#issuecomment-46864789), in which case this patch might as well be merged into the old tutorial.
2014-06-25auto merge of #15121 : steveklabnik/rust/matching_docs, r=alexcrichtonbors-3/+8
Fixes #11113.
2014-06-25Make an example more clear with sample code.Steve Klabnik-3/+8
Fixes #11113.
2014-06-25reflow with emacs fill-paragraph (fill-column 71)Zooko Wilcox-O'Hearn-5/+6
2014-06-25add "(see below)" to a reference to a new conceptZooko Wilcox-O'Hearn-1/+1
This is because I observed someone reading the tutorial who thought they'd missed something when they got to the mention of variable bindings. This patch doesn't reflow the paragraphs so that you can see the semantic change that I made, and a subsequent patch will reflow this paragraph. Fixes https://github.com/rust-lang/rust/issues/13570.
2014-06-24Fix grammar in tutorialMichael Zhou-1/+1
"as this document" should be "than this document"
2014-06-24Add the Guide, add warning to tutorial.Steve Klabnik-0/+7
In line with what @brson, @cmr, @nikomatsakis and I discussed this morning, my redux of the tutorial will be implemented as the Guide. This way, I can work in small iterations, rather than dropping a huge PR, which is hard to review. In addition, the community can observe my work as I'm doing it. This adds a note in line with [this comment][reddit] that clarifies the state of the tutorial, and the community's involvement with it. [reddit]: http://www.reddit.com/r/rust/comments/28bew8/rusts_documentation_is_about_to_drastically/ci9c98k
2014-06-24Improve ambiguous pronoun.Steve Klabnik-3/+4
Fixes #14806
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-18/+18
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-23Docs: tutorial: Remove a couple references to `~T`Ivan Petkov-4/+5
2014-06-22Update few files after comparison traits renamingPiotr Jawniak-2/+2
There were still Total{Ord,Eq} in docs and src/etc
2014-06-17tutorial.md: tiny correction for --crate-type=libNiklas Koep-1/+1
Compiling a crate with `rustc --crate-type=lib` produces an rlib file, not a shared object. The latter is only produced for `--crate-type=dylib`.
2014-06-16Update Sublime Rust github linkChristopher Bergqvist-1/+1
Package switched maintainer from dbp to jhasse as stated in the README.md at the old link.
2014-06-16Update repo locationBrian Anderson-4/+4
2014-06-15Register new snapshotsAlex Crichton-2/+2
2014-06-11auto merge of #14799 : mcreinhard/rust/tilde-fix, r=alexcrichtonbors-1/+1
Replaced `~Drawable` with `Box<Drawable>` in tutorial
2014-06-11rustc: Move the AST from @T to Gc<T>Alex Crichton-3/+3
2014-06-10Fix deprecated use of ~Michael Reinhard-1/+1
2014-06-06doc: Turn off special features for rustdoc testsAlex Crichton-0/+3
These were only used for the markdown tests, and there's no reason they should be distinct from the other tests.
2014-06-05Fallout from the libcollections movementAlex Crichton-2/+1
2014-06-02docs: Stop using `notrust`Florian Gilcher-10/+10
Now that rustdoc understands proper language tags as the code not being Rust, we can tag everything properly. This change tags examples in other languages by their language. Plain notations are marked as `text`. Console examples are marked as `console`. Also fix markdown.rs to not highlight non-rust code.
2014-05-31Rename variable in tutorialChristoph Burgdorf-3/+3
Renamed `owned_box` to `on_the_heap` to use a consistent naming across the tutorial and the life time guide. Also it makes the example easier to grasp.
2014-05-31auto merge of #14553 : reem/rust/nuke-owned-vectors, r=alexcrichtonbors-9/+9
I removed all remaining deprecated owned vectors from the docs. All example tests pass.
2014-05-30Remove deprecated owned vector from tutorial.Jonathan Reem-9/+9
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-15/+15
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-29Revert erroneous fix to tutorialRandati-1/+1
2014-05-27Move std::{reflect,repr,Poly} to a libdebug crateAlex Crichton-10/+20
This commit moves reflection (as well as the {:?} format modifier) to a new libdebug crate, all of which is marked experimental. This is a breaking change because it now requires the debug crate to be explicitly linked if the :? format qualifier is used. This means that any code using this feature will have to add `extern crate debug;` to the top of the crate. Any code relying on reflection will also need to do this. Closes #12019 [breaking-change]