summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2016-01-16Move some #[no_std] info to stable book.Steve Klabnik-89/+52
This feature is partially stabilized, so describe each part in the appropriate place. Conflicts: src/doc/book/no-stdlib.md
2015-12-09Rollup merge of #30273 - Xmasreturns:patch-1, r=steveklabnikSteve Klabnik-14/+10
Changes to readability and some clarifications for beginners
2015-12-09Rollup merge of #30224 - matklad:super-docs, r=steveklabnikSteve Klabnik-0/+19
Make clear that `super` may be included in the path several times. r? @steveklabnik
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
2015-12-05Uses unwrap instead of pattern matchingChristopher Sumnicht-3/+3
2015-12-05DOCS: update reference about pathsAleksey Kladov-0/+19
2015-12-05Resolved warnings about unused resultChristopher Sumnicht-3/+3
2015-12-04Fix typoJake Worth-1/+1
2015-12-04Auto merge of #29850 - Kimundi:attributes_that_make_a_statement, r=pnkfelixbors-0/+3
See https://github.com/rust-lang/rfcs/pull/16 and https://github.com/rust-lang/rust/issues/15701 - Added syntax support for attributes on expressions and all syntax nodes in statement position. - Extended `#[cfg]` folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. - Extended lint checker to recognize lint levels on expressions and locals. - As per RFC, attributes are not yet accepted on `if` expressions. Examples: ```rust let x = y; { ... } assert_eq!((1, #[cfg(unset)] 2, 3), (1, 3)); let FOO = 0; ``` Implementation wise, there are a few rough corners and open questions: - The parser work ended up a bit ugly. - The pretty printer change was based mostly on guessing. - Similar to the `if` case, there are some places in the grammar where a new `Expr` node starts, but where it seemed weird to accept attributes and hence the parser doesn't. This includes: - const expressions in patterns - in the middle of an postfix operator chain (that is, after `.`, before indexing, before calls) - on range expressions, since `#[attr] x .. y` parses as `(#[attr] x) .. y`, which is inconsistent with `#[attr] .. y` which would parse as `#[attr] (.. y)` - Attributes are added as additional `Option<Box<Vec<Attribute>>>` fields in expressions and locals. - Memory impact has not been measured yet. - A cfg-away trailing expression in a block does not currently promote the previous `StmtExpr` in a block to a new trailing expr. That is to say, this won't work: ```rust let x = { #[cfg(foo)] Foo { data: x } #[cfg(not(foo))] Foo { data: y } }; ``` - One-element tuples can have their inner expression removed to become Unit, but just Parenthesis can't. Eg, `(#[cfg(unset)] x,) == ()` but `(#[cfg(unset)] x) == error`. This seemed reasonable to me since tuples and unit are type constructors, but could probably be argued either way. - Attributes on macro nodes are currently unconditionally dropped during macro expansion, which seemed fine since macro disappear at that point? - Attributes on `ast::ExprParens` will be prepend-ed to the inner expression in the hir folder. - The work on pretty printer tests for this did trigger, but not fix errors regarding macros: - expression `foo![]` prints as `foo!()` - expression `foo!{}` prints as `foo!()` - statement `foo![];` prints as `foo!();` - statement `foo!{};` prints as `foo!();` - statement `foo!{}` triggers a `None` unwrap ICE.
2015-12-03Link to lazy_static crate in Design FAQMika Attila-4/+2
Replace the old link pointing to an out-of-date gist with a link to the lazy_static crate on crates.io. We also don't need to state the author, as the crates.io page shows the authors and owners.
2015-12-03Auto merge of #30169 - shepmaster:for-loop-into-iterator, r=steveklabnikbors-5/+7
2015-12-02Clarify that a for loop uses `IntoIterator`Jake Goulding-5/+7
2015-12-02Auto merge of #30161 - JIghtuse:master, r=steveklabnikbors-1/+3
2015-12-02book: Provide link to tuple structs in type aliases chapterBoris Egorov-1/+3
2015-12-01Rollup merge of #30154 - salty-horse:guessing_panic, r=steveklabnikSteve Klabnik-1/+1
The text mentions ```return```, but what's actually happening is a ```panic!```.
2015-12-01Rollup merge of #30153 - durka:patch-11, r=steveklabnikSteve Klabnik-9/+16
I think this fixes #30137. I basically just repeated some details that were scattered around other places in this document, and emphasized that you probably don't want an `extern crate` or `mod` statement to end up inside a function.
2015-12-01Rollup merge of #30144 - pjungwir:clarify-semver-rules, r=steveklabnikSteve Klabnik-3/+7
The documentation shows this: [dependencies] rand="0.3.0" and says it allows any version compatible with 0.3.0, but then it says, "If we wanted to use only 0.3.0 exactly, we could use `=0.3.0`." That is very easy to misunderstand, so hopefully this PR will help others not to be as confused as me. :-)
2015-12-01Rollup merge of #30134 - salty-horse:patch-1, r=steveklabnikSteve Klabnik-2/+2
random/secret guess -> secret number.
2015-12-02book: Change mention of unused `return` to `panic!`Ori Avtalion-1/+1
2015-12-01trpl: explain how to inhibit rustdoc's auto-mainAlex Burka-9/+16
I think this fixes #30137. I basically just repeated some details that were scattered around other places in this document, and emphasized that you probably don't want an `extern crate` or `mod` statement to end up inside a function.
2015-12-01Clarify ambiguity about how to ask Cargo for a specific versionPaul A. Jungwirth-3/+7
2015-12-01Fix wording in Guessing GameOri Avtalion-2/+2
2015-12-01trpl: additions & fixes for syntax index.Daniel Keep-2/+6
* `const`: Add reference to raw pointers * Change `expr!(...)` etc. examples to use `ident` instead. *Technically*, it should be `pat`, but that's not how it works in practice. * `|`: add reference to closure syntax. * Closure syntax entry. * Indexing and slicing entries.
2015-11-30Rollup merge of #30122 - steveklabnik:last_trpl_fix, r=ManishearthSteve Klabnik-1/+1
Along with https://github.com/rust-lang/rust/pull/30121, this should fix the last fallout from https://github.com/rust-lang/rust/pull/29932
2015-11-30Rollup merge of #30115 - nilcons-contrib:fix-book-stack, r=steveklabnikSteve Klabnik-1/+1
The `f` argument will reference the actual value in the `d` box, not the box in the `bar`'s stack frame. I am just learning Rust, so I don't know how to explain this well, but just from `f`'s type it is clear that it will be a pointer to an `i32`, not a pointer to a pointer. Some `println!("{:p}", ...)`'s can easily confirm this. I would actually suggest to remove/simplify this part of the example. This is a subtle issue that can easily confuse people at the early stages of familiarizing with the language. (As I got confused by it. :))
2015-11-30Rollup merge of #30114 - sourcefrog:doc-casts2, r=ManishearthSteve Klabnik-7/+19
2015-11-30Rollup merge of #30108 - bhargavrpatel:master, r=steveklabnikSteve Klabnik-1/+1
2015-11-30Fix path to TRPL in doc READMESteve Klabnik-1/+1
2015-11-30Correct grammarMartin Pool-1/+1
Thanks @Manishearth
2015-11-30Additional text and examples around castingMartin Pool-7/+19
2015-11-30Fix pointer value in the 'complex example'Mihaly Barasz-1/+1
The `f` argument will reference the actual value in the `d` box, not the box in the `bar`'s stack frame.
2015-11-30Remove broken explicit coercion exampleMartin Pool-7/+0
2015-11-29Change verbiage in Stack & Heap pageBhargav Patel-1/+1
Made a small change in the sentence. It seemed confusing to read the word "actual" twice in the sentence; I removed it completely.
2015-11-29Auto merge of #30088 - sourcefrog:doc-casts, r=steveklabnikbors-5/+113
Based on the description in https://github.com/rust-lang/rust/blob/219eca11b044de3644b3e9101124513c1a842b09/src/librustc_typeck/check/cast.rs#L11 and https://doc.rust-lang.org/nightly/nomicon/casts.html
2015-11-29Rephrased description of castingMartin Pool-9/+21
2015-11-29Add information about numeric casts, from the nomiconMartin Pool-0/+26
2015-11-29Auto merge of #30059 - androm3da:master, r=blussbors-6/+6
2015-11-28Auto merge of #29651 - tshepang:misc, r=steveklabnikbors-5/+8
2015-11-28doc(book/ffi): remove duplicate link reference `[libc]'xd1le-2/+0
2015-11-27Attempted documentation of coercionsMartin Pool-3/+19
Trying to summarize here only the cases that will make sense at the level of the rust book
2015-11-27Copy in some documentation about which casts are legalMartin Pool-5/+59
2015-11-27Shifted focus of while-let example per review.ebadf-6/+5
2015-11-26Added stmt_expr_attribute feature gateMarvin Löbel-0/+3