about summary refs log tree commit diff
path: root/src/doc/book
AgeCommit message (Collapse)AuthorLines
2016-01-04Mention that structs can contain &mut TsSteve Klabnik-0/+29
Fixes #30254
2016-01-04Add missing use statementsLawrence Woodman-6/+9
fs::File was being referenced without either calling via std::fs::File or by using File after having used fs::File. Also Path was being referenced without first having used std::path::Path.
2016-01-04Improve syntax-index entry for lifetime boundsManish Goregaokar-1/+2
2016-01-03Correct formatting use of tab instead of spacesLawrence Woodman-2/+2
2015-12-30Rollup merge of #30620 - salty-horse:an_mut, r=brsonSteve Klabnik-4/+4
As discussed in issue #30568.
2015-12-30Rollup merge of #30502 - Luke-Nukem:master, r=steveklabnikSteve Klabnik-16/+16
Rewrite of a paragraph in in the `match` section. The colon `:` should be used only when the sentence preceeding it is a complete sentence. If this is not the case, then a `;` should be used; this denotes that the following fragment is a part of the previous fragment. I got a new bike; it has two wheels. (Similar to I got a new bike, it has two wheels) The ice cream truck has great flavours; blueberry, blackberry, berryberry. Writing a complete sentence: - with a list under it - You can join two sentences with it: Much like this. r? @steveklabnik
2015-12-29book: Replace "an &mut" with "a mut". Fixes #30568Ori Avtalion-4/+4
2015-12-29Rollup merge of #30405 - durka:patch-12, r=steveklabnikSteve Klabnik-2/+1
Fixes #30217.
2015-12-29Remove "Learn Rust" from TRPL.Steve Klabnik-1086/+14
Some history: While getting Rust to 1.0, it was a struggle to keep the book in a working state. I had always wanted a certain kind of TOC, but couldn't quite get it there. At the 11th hour, I wrote up "Rust inside other langauges" and "Dining Philosophers" in an attempt to get the book in the direction I wanted to go. They were fine, but not my best work. I wanted to further expand this section, but it's just never going to end up happening. We're doing the second draft of the book now, and these sections are basically gone already. Here's the issues with these two sections, and removing them just fixes it all: // Philosophers There was always controversy over which ones were chosen, and why. This is kind of a perpetual bikeshed, but it comes up every once in a while. The implementation was originally supposed to show off channels, but never did, due to time constraints. Months later, I still haven't re-written it to use them. People get different results and assume that means they're wrong, rather than the non-determinism inherent in concurrency. Platform differences aggrivate this, as does the exact amount of sleeping and printing. // Rust Inside Other Languages This section is wonderful, and shows off a strength of Rust. However, it's not clear what qualifies a language to be in this section. And I'm not sure how tracking a ton of other languages is gonna work, into the future; we can't test _anything_ in this section, so it's prone to bitrot. By removing this section, and making the Guessing Game an initial tutorial, we will move this version of the book closer to the future version, and just eliminate all of these questions. In addition, this also solves the 'split-brained'-ness of having two paths, which has endlessly confused people in the past. I'm sad to see these sections go, but I think it's for the best. Fixes #30471 Fixes #30163 Fixes #30162 Fixes #25488 Fixes #30345 Fixes #28713 Fixes #28915 And probably others. This lengthy list alone is enough to show that these should have been removed. RIP.
2015-12-27Auto merge of #30575 - jswalden:error-handling-typo, r=apasel422bors-1/+1
Didn't build/test the change, but if that one-character fix isn't correct, I'll eat my hat. :-) Found this reading the book over the last week or two since Mozlando -- much enjoying the book so far.
2015-12-27Change the typo 'that' to 'than' in the book error-handling chapter.Jeff Walden-1/+1
2015-12-26llvm: Add support for vectorcall (X86_VectorCall) conventionSteffen-0/+1
2015-12-26book: Fix typoOri Avtalion-1/+1
2015-12-25Rollup merge of #30545 - bluss:operator-overload, r=steveklabnikManish Goregaokar-5/+6
book: Some operator fixes for the syntax index - Correct the names of the comparison traits (PartialOrd) - Mention only the traits that overload the operator (PartialOrd, PartialEq), not operator-unrelated traits (Ord, Eq). - Add `!=` operator.
2015-12-24book: Some operator fixes for the syntax indexUlrik Sverdrup-5/+6
- Correct the names of the comparison traits (PartialOrd) - Mention only the traits that overload the operator (PartialOrd, PartialEq), not operator-unrelated traits (Ord, Eq). - Add `!=` operator.
2015-12-23Rollup merge of #30473 - nwin:patch-2, r=steveklabnikSteve Klabnik-1/+1
Clarify the difference between compiler-panic and libcore-panic.
2015-12-23Rollup merge of #30461 - lnmx:doc-typo, r=steveklabnikSteve Klabnik-1/+1
2015-12-21Auto merge of #30400 - fbergr:master, r=steveklabnikbors-1/+1
See: https://github.com/rust-lang/rust/issues/30397 r? @steveklabnik
2015-12-21Revert to colon. The text is introducing a list.Luke Jones-1/+1
2015-12-21Update patterns.mdLuke Jones-1/+1
2015-12-21Correct line wrapLuke Jones-4/+12
2015-12-21Rewrite paragraph in 'match' to be more concise and readable. StartLuke Jones-18/+10
correcting use of ':' in sentences. The colon `:` should be used only when the sentence preceeding it is a complete sentence. If this is not the case, then a `;` should be used; this denotes that the following fragment is a part of the previous fragment.
2015-12-19Update no-stdlib.mdnwin-1/+1
Clarify the difference between compiler-panic and libcore-panic.
2015-12-18doc: minor format fixes in book/error-handlinglnmx-1/+1
2015-12-18Rollup merge of #30447 - Xmasreturns:Docu, r=steveklabnikManish Goregaokar-4/+6
Added sentences for description of code and changed x in the example to an int
2015-12-18Rollup merge of #30406 - durka:patch-13, r=sanxiynManish Goregaokar-3/+3
The previous example had no chance of compiling in either form, due to the restrictive follow set for `ty`. This one has the desired behavior: http://is.gd/kYdw4g (well, I don't exactly desire this behavior at all, but it's true at least :p )
2015-12-17Clarified shadowing exampleXmasreturns-4/+6
Added some additional descriptive sentences and changed x to an int in the example
2015-12-16Used bold and italic in the markdown to make the stack and heap ↵Shiney-20/+22
documentation clearer
2015-12-15change macro ambiguity example from ty to identAlex Burka-3/+3
The previous example had no chance of compiling in either form, due to the restrictive follow set for `ty`. This one has the desired behavior: http://is.gd/kYdw4g (well, I don't exactly desire this behavior at all, but it's true at least :p )
2015-12-15remove claim that $crate is a single identifierAlex Burka-2/+1
Fixes #30217.
2015-12-15Book: Fix link anchor in Syntax Indexfbergr-1/+1
2015-12-13Auto merge of #30329 - salty-horse:punctuation, r=steveklabnikbors-1/+1
Missing period at the end of a sentence.
2015-12-13Auto merge of #30310 - mbrubeck:doc-vec-bounds, r=steveklabnikbors-0/+30
r? @steveklabnik Currently neither the API docs nor the book clearly explain that out-of-bounds array indexing causes a panic. Since this is fairly important and seems to surprise a number of new Rust programmers, I think it's worth adding to both places. (But if you think it would be better to put this info in the API docs only, that's fine too.) Some specific things I'd like feedback on: * The new text here talks about panicking, which hasn't been formally introduced at this point in chapter 5 (though it has been mentioned in previous sections too). * Similarly the `Vec::get` example uses `Option<T>` which hasn't been fully introduced yet. Should we leave out this example?
2015-12-12Auto merge of #30309 - alexcrichton:more-tier-two, r=steveklabnikbors-24/+24
We've got lots of new automation set up in the past few months, so these platforms are now all tier 2 as we're building artifacts and gating on them.
2015-12-11book: Add missing punctuationOri Avtalion-1/+1
2015-12-11Document bounds checking in the bookMatt Brubeck-0/+30
2015-12-10book: Update Tier 2 platformsAlex Crichton-24/+24
We've got lots of new automation set up in the past few months, so these platforms are now all tier 2 as we're building artifacts and gating on them.
2015-12-10Auto merge of #30292 - Xmasreturns:patch-3, r=steveklabnikbors-24/+22
Updated structs.md in the book
2015-12-09Fixes from reviewXmasreturns-2/+2
Traits -> Field labels Revert a change to convention
2015-12-09Grammar and slight ordering changesXmasreturns-25/+23
2015-12-09Grammar changes for readabilityXmasreturns-8/+8
2015-12-09Rollup merge of #30273 - Xmasreturns:patch-1, r=steveklabnikSteve Klabnik-14/+10
Changes to readability and some clarifications for beginners
2015-12-08Update traits.mdXmasreturns-1/+1
2015-12-08Update traits.mdXmasreturns-14/+10
Changes to readability and some clarifications for beginners
2015-12-08Re-order the sections in TRPLSteve Klabnik-12/+12
This ordering was significantly more confusing.
2015-12-06Auto merge of #30234 - vyp:doc-typo, r=apasel422bors-1/+1
2015-12-06doc(book/error-handling): fix typoxd1le-1/+1
2015-12-06Auto merge of #30221 - thyrgle:concurrency_doc, r=alexcrichtonbors-3/+3
The example code in the Channels subsection of the rust book give warnings about unused result which must be used, #[warn(unused_must_use)] on by default Added a small pattern match to resolve those warnings.
2015-12-06Auto merge of #30187 - alexcrichton:stabilize-1.6, r=aturonbors-7/+1
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-7/+1
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968