summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2016-12-16Update book for rustupBrian Anderson-9/+23
2016-12-16Book: rustup.sh -> rustup.rsSteve Klabnik-21/+7
Fixes #35653 cc https://github.com/rust-lang/rust-www/pull/621
2016-12-14Document the question mark operatorest31-2/+8
2016-11-08Auto merge of #36843 - petrochenkov:dotstab, r=nikomatsakisbors-2/+0
Stabilize `..` in tuple (struct) patterns I'd like to nominate `..` in tuple and tuple struct patterns for stabilization. This feature is a relatively small extension to existing stable functionality and doesn't have known blockers. The feature first appeared in Rust 1.10 6 months ago. An example of use: https://github.com/rust-lang/rust/pull/36203 Closes https://github.com/rust-lang/rust/issues/33627 r? @nikomatsakis
2016-11-06Auto merge of #37386 - johnthagen:Self-reference-example, r=GuillaumeGomezbors-0/+15
Add example using Self to reference When I first came across `Self` I had a hard time finding references to it in the docs (and it's also been asked about on [StackOverflow](http://stackoverflow.com/questions/32304595/whats-the-difference-between-self-and-self). I hope this example provides someone who comes across it for the first time a little more help. If there is a better way to show an example actually using `Self`, I'm happy to modify this. It was just the simplest place to start I could see.
2016-11-05Use From trait as an example usage of Self.johnthagen-0/+15
2016-11-04Rollup merge of #37255 - mbrubeck:doc-edit, r=steveklabnikAlex Crichton-9/+10
Fix some mistakes in HRTB docs The example code for higher-ranked trait bounds on closures had an unnecessary `mut` which was confusing, and the text referred to an mutable reference which does not exist in the code (and isn't needed). Removed the `mut`s and fixed the text to better describe the actual error for the failing example. Thanks to csd_ on IRC for pointing out these problems! r? @steveklabnik
2016-11-03Stabilize `..` in tuple (struct) patternsVadim Petrochenkov-2/+0
2016-11-01Rollup merge of #37495 - buntine:master, r=steveklabnikGuillaume Gomez-4/+2
Commented out final 'main' function in order to fit within pattern of… … other examples and prevent incorrect indentation
2016-11-01Rollup merge of #37485 - xfix:patch-2, r=steveklabnikGuillaume Gomez-1/+0
Don't mention "*" dependency version in guessing game example It's a bad practice as far [RFC 1241](https://github.com/rust-lang/rfcs/blob/master/text/1241-no-wildcard-deps.md) is concerned, and introducing it in early tutorial may as well make it feel legitimate.
2016-10-31Removed commented main functions entirely. This fits in with other examples ↵Bunts Thy Unholy-4/+0
in the Closures section
2016-10-31Commented out final 'main' function in order to fit within pattern of other ↵Bunts Thy Unholy-2/+4
examples and prevent incorrect indentation
2016-10-30Don't mention "*" dependency version in guessing game exampleKonrad Borowski-1/+0
It's a bad practice as far [RFC 1241] is concerned, and introducing it in early tutorial may as well make it feel legitimate. [RFC 1241]: https://github.com/rust-lang/rfcs/blob/master/text/1241-no-wildcard-deps.md
2016-10-30Update "Testing" chapter for 1.12Pieter Frenssen-35/+39
I followed the "Testing" chapter using Rust 1.12.1 but there are some differences. By default the `tests` module is now also generated by `cargo new`, and the console output is updated.
2016-10-29Auto merge of #37378 - petrochenkov:nopat, r=eddybbors-3/+3
Prohibit patterns in trait methods without bodies They are not properly type checked ```rust trait Tr { fn f(&a: u8); // <- This compiles } ``` , mostly rejected by the parser already and generally don't make much sense. This PR is kind of a missing part of https://github.com/rust-lang/rust/pull/35015. Given the [statistics from crater](https://github.com/rust-lang/rust/pull/37378#issuecomment-256154994), the effect of this PR is mostly equivalent to improving `unused_mut` lint. cc https://github.com/rust-lang/rust/issues/35078#issuecomment-255707355 https://github.com/rust-lang/rust/pull/35015 https://github.com/rust-lang/rfcs/pull/1685 https://github.com/rust-lang/rust/issues/35203 r? @eddyb
2016-10-27reference: Mention --crate-type=cdylib in the Linkage sectionFederico Mena Quintero-0/+6
2016-10-26Prohibit patterns in trait methods without bodiesVadim Petrochenkov-3/+3
2016-10-25Fix typoZoffix Znet-1/+1
2016-10-24Rollup merge of #37228 - loggerhead:patch-1, r=steveklabnikJonathan Turner-1/+1
Fix a error of 'book/deref-coercions.html' The original sentence is: > This example has two conversions: `Rc<String>` to `String` and then `String` to `&str`. But it should be > This example has two conversions: `Rc<String>` to `String` and then `String` to `str`. or > This example has two conversions: `&Rc<String>` to `&String` and then `&String` to `&str`. I think the latter is more clearly. r? @steveklabnik
2016-10-20TRPL: guessing game: minor clarificationVangelis Katsikaros-1/+1
2016-10-19Fix grammatical errors in `tests` directory docsPaul Osborne-3/+3
2016-10-18Fix some mistakes in HRTB docsMatt Brubeck-9/+10
The example code for higher-ranked trait bounds on closures had an unnecessary `mut` which was confusing, and the text referred to an mutable reference which does not exist in the code (and isn't needed). Removed the `mut`s and fixed the text to better describe the actual error for the failing example.
2016-10-17Rollup merge of #37194 - johnthagen:fix-const-static-header, r=blussGuillaume Gomez-1/+1
Remove un-rendered ticks from "const and static" doc title Related to #37116 and #37119. Ticks in the titles are not correctly rendered ![const-static-render](https://cloud.githubusercontent.com/assets/10340167/19412643/63e385a2-92e8-11e6-81f1-16802f803aad.png)
2016-10-17Fix a error of 'book/deref-coercions.html'loggerhead-1/+1
The original sentence is: > This example has two conversions: `Rc<String>` to `String` and then `String` to `&str`. But it should be > This example has two conversions: `Rc<String>` to `String` and then `String` to `str`. or > This example has two conversions: `&Rc<String>` to `&String` and then `&String` to `&str`. I think the latter is more clearly.
2016-10-15Remove un-rendered ticks from title.johnthagen-1/+1
2016-10-15rustdoc: Improve playground run buttonsOliver Middleton-4/+5
The main change is to stop using javascript to generate the URLs and use rustdoc instead. This also adds run buttons to the error index examples.
2016-10-14Rollup merge of #37119 - durka:patch-31, r=steveklabnikJonathan Turner-1/+1
book: remove backticks in Type Aliases header Fix #37116.
2016-10-14Rollup merge of #36755 - Rantanen:master, r=GuillaumeGomezJonathan Turner-14/+76
Explain motivation behind lifetimes Start the lifetime section with an explanation of the issues that lack of explicit lifetimes cause and how the explicit lifetimes solve these. ---------------- I had really hard time figuring out why I would need to care about the explicit reference lifetimes when going through the book at first. With strong background in C++, I'm familiar with the dangling reference problem - but given the section seems to focus more on the lifetime syntax and various ways to define lifetimes on functions and structs, I was unable to understand how they are used to solve the reference problem. This PR is an attempt at getting the reader to understand what the explicit lifetimes are used for and why they are an awesome thing instead of a bit of syntax that just has to be written. It's been less than a week that I've been diving into Rust so I'm far from certain about the terminology and technical correctness. I tried mimicking the existing terminology from the lifetimes section, but still no promises on getting it right.
2016-10-13Explain motivation behind lifetimesMikko Rantanen-14/+76
Start the lifetime section with an explanation of the issues that lack of explicit lifetimes cause and how lifetimes alleviate these.
2016-10-12Rollup merge of #36995 - nrc:stable, r=@nikomatsakisAlex Crichton-2/+1
stabilise ?, attributes on stmts, deprecate Reflect r? @nikomatsakis
2016-10-12book: remove backticks in Type Aliases headerAlex Burka-1/+1
Fix #37116.
2016-10-12Stabilise attributes on statements.Nick Cameron-2/+1
Note that attributes on expressions are still unstable and are behind the `stmt_expr_attributes` flag. cc [Tracking issue](https://github.com/rust-lang/rust/issues/15701)
2016-10-11Rollup merge of #36997 - KillTheMule:patch-1, r=steveklabnikGuillaume Gomez-2/+6
Book: Be very explicit of lifetimes being descriptive ... not prescriptive. Pointed out in https://users.rust-lang.org/t/what-if-i-get-lifetimes-wrong/7535/4, which was a revelation to me and made me think this should be more clear in the book. I'm not sure if I got this entirely right or if the wording is good, but I figured a PR is more helpful than a simple issue. r? @steveklabnik Small Note: There's also https://github.com/rust-lang/book, should I have sent the PR there? It doesn't coincide with the online book though, so I figured it's better of here.
2016-10-07Rollup merge of #37008 - tshepang:quotes, r=steveklabnikGuillaume Gomez-3/+3
reference: use ticks instead of quotes
2016-10-07Rollup merge of #36929 - angelsl:issue-36683, r=steveklabnikGuillaume Gomez-2/+7
Reference: Mention `move` keyword for lambdas From issue #36683
2016-10-07Wrap & improveKillTheMule-4/+6
2016-10-06reference: use ticks instead of quotesTshepang Lekhonkhobe-3/+3
2016-10-06Rollup merge of #36957 - cynicaldevil:docs, r=frewsxcvJonathan Turner-3/+3
Minor modifications in concurrency section of the Rust book Fixes #36939 r? @steveklabnik
2016-10-06TyposKillTheMule-1/+1
2016-10-06Another shot at clarityKillTheMule-1/+1
2016-10-06Distinguish lifetimes and their annotationsKillTheMule-1/+1
Also, emphasize differently.
2016-10-06Book: Be very explicit of lifetimes being descriptiveKillTheMule-0/+2
... no prescriptive. Pointed out in https://users.rust-lang.org/t/what-if-i-get-lifetimes-wrong/7535/4, which was a revelation to me and made me think this should be more clear in the book.
2016-10-04Minor modifications in concurrency section of the Rust bookNikhil Shagrithaya-3/+3
2016-10-05reference: mention `move` keyword for lambdasangelsl-2/+7
2016-10-02Avoid introducing `run` twicePhilip Davis-6/+6
As it stands, getting-started and guessing-game both introduce `run` as a new command. The second should probably make it clear that the reader has seen it before :)
2016-09-30Rollup merge of #36860 - wesleywiser:patch-2, r=ManishearthSteve Klabnik-0/+10
Add `Send` and `Sync` traits to the reference Fixes #36859
2016-09-30Rollup merge of #36711 - pcn:patch-1, r=steveklabnikSteve Klabnik-1/+1
Suggesting a change to a comment that puzzled me While reading this, the comment made it difficult for me to simply absorb the concept. It interrupted my reading flow, and I think this expresses the same meaning, but reads a bit better. It's trivial, but makes it easier for me to move on to the next line.
2016-09-30Add `Send` and `Sync` traits to the referenceWesley Wiser-0/+10
Fixes #36859
2016-09-28Rollup merge of #35286 - dns2utf8:doc_never_expression, r=nikomatsakisJonathan Turner-1/+11
Add docs for "!" Never type (rfc 1216) Pull Request: https://github.com/rust-lang/rfcs/pull/1216 Tracking Issue: #35121
2016-09-28Rollup merge of #36769 - nathanmusoke:master, r=apasel422Jonathan Turner-1/+1
doc: Fix minor typo in book/variable-bindings.md r? @steveklabnik