about summary refs log tree commit diff
path: root/src/doc/book
AgeCommit message (Collapse)AuthorLines
2016-11-08Rollup merge of #37425 - polo-language:doc, r=GuillaumeGomezSteve Klabnik-1/+1
Add error note to illegal code snippet Mark intentionally invalid code snippet in documentation as such with a comment. Similar comments used elsewhere in this file. r? @steveklabnik
2016-11-08Update testing.md to reflect changes to cargo newTrotter Cashion-50/+76
`cargo new` now creates a `src/lib.rs` with a `tests` module by default. I've updated the earlier examples in this doc to reflect this. However, I don't know how we want to approach the "introduction" to idiomatic testing that follows in "the tests module" section. I _think_ it should be broken apart, with the module concept being introduced early on, and the `super` concept being addressed when we hit the `add_two` example. I'd like to get agreement on that being the right approach before I do it though. I _also_ removed the `#fn main() {}` hidden at the beginning of each example, as these cause Rust Playground to not treat the file as a set of tests that it can run. Removing it _should_ cause Rust Playground to display a "Test >" button in the top left when a user runs the code, which will allow them to see the test runner output.
2016-11-04book: Removed platform compatibility table, link to the forgeBrian Anderson-99/+12
The content is duplicated, and it doesn't need to be in this location. It's mostly trivia that doesn't apply to most of the audience. The forge is up to date.
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-03Add error note to illegal code snippetAngelo Polo-1/+1
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-31Remove remark about poor code stylenwin-21/+1
The current wording [seems to be confusing](https://www.reddit.com/r/rust/comments/5aat03/why_is_implementing_traits_on_primitive_types/). As an explanation when and why this could be considered as poor style would go beyond of the scope of this chapter I suggest to remove this remark.
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-30doc: guessing-game.md: Match output to newest language versionKonrad Borowski-23/+43
Cargo now informs that it has finished, and there is new error format.
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-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-14Rollup merge of #37119 - durka:patch-31, r=steveklabnikJonathan Turner-1/+1
book: remove backticks in Type Aliases header Fix #37116.
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-12book: remove backticks in Type Aliases headerAlex Burka-1/+1
Fix #37116.
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-07Wrap & improveKillTheMule-4/+6
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-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 #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-28Rollup merge of #35286 - dns2utf8:doc_never_expression, r=nikomatsakisJonathan Turner-1/+4
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
2016-09-27Improve documention troubleshooting missing linker. Fix #32208.Paulo Matos-6/+16
2016-09-27doc: Fix minor typo in book/variable-bindings.mdNathan Musoke-1/+1
2016-09-26Use "through"Peter N-1/+1
2016-09-26Rollup merge of #36563 - vanjacosic:patch-1, r=steveklabnikJonathan Turner-5/+6
Docs: Update to "Getting Started" section I came across #34523 and wanted to suggest a solution. See commit for details. It seemed like a good place to start contributing, let me know if I did anything wrong 😇
2016-09-26Remove whitespace from line endingsVanja Cosic-4/+4
2016-09-25Suggesting a change to a comment that puzzled mePeter N-1/+1
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.
2016-09-18Updated "Ownership". Trying to fix #34865Vanja Cosic-2/+2
- Reword - Add link
2016-09-18Updated "Getting started". Trying to fix #34523Vanja Cosic-5/+6
- Updated paragraphs and wording for clarity. - Renamed `helloworld.rs` to `myprogram.rs` to make it clearer that it's an unrelated example.
2016-09-14Don't ignore a doc code-block we can compile.Corey Farwell-1/+1
2016-09-14Rollup merge of #36374 - dangcheng:patch-1, r=steveklabnikGuillaume Gomez-2/+2
book: fix mistake (File::open -> File::create)
2016-09-12change error messagedangcheng-2/+2
2016-09-10book: fix a typoKylo Ginsberg-1/+1
2016-09-10fix mistake (File::open -> File::create)dangcheng-2/+2
2016-09-09Issue deprecation warnings for safe accesses to extern staticsVadim Petrochenkov-1/+1
2016-09-02Update supported Windows versions to match Getting Started page.johnthagen-1/+1