summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2017-01-06Document custom derive.Steve Klabnik-8/+256
These are some bare-bones documentation for custom derive, needed to stabilize "macros 1.1", https://github.com/rust-lang/rust/issues/35900 The book chapter is based off of a blog post by @cbreeden, https://cbreeden.github.io/Macros11/ Normally, we have a policy of not mentioning external crates in documentation. However, given that syn/quote are basically neccesary for properly using macros 1.1, I feel that not including them here would make the documentation very bad. So the rules should be bent in this instance.
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-12Rollup merge of #38164 - sourcefrog:fonts, r=GuillaumeGomezCorey Farwell-1/+3
Avoid using locally installed Source Code Pro font (fixes #24355). In some versions of this font the ampersands are drawn badly. A doc tree built with this change is at https://storage.googleapis.com/mbp-rust-builds/fonts/doc/std/index.html I'm not seeing this problem locally so I'm not sure this fixes it, but based on the diagnosis in the bug it should. I've made this a minimal change by only removing the one problematic font but maybe for consistency every font should be read from the Rust docs tree?
2016-12-07Rollup merge of #38225 - Cobrand:patch-1, r=GuillaumeGomezGuillaume Gomez-9/+14
Update book/ffi to use catch_unwind r? @GuillaumeGomez The doc mentioned to spawn a new thread instead of using catch_unwind, which has been the recommended way to catch panics for foreign function interfaces for a few releases now. This commit fixes that.
2016-12-07Rollup merge of #38163 - durka:patch-33, r=blussGuillaume Gomez-1/+2
reference: fix definition of :tt The reference says that $x:tt matches "either side of the `=>` in macro_rules` which is technically true but completely uninformative. This changes that bullet point to what the book says (a single token or sequence of token trees inside brackets).
2016-12-07Update book/ffi to use catch_unwindCobrand-9/+14
r? @GuillaumeGomez The doc mentioned to spawn a new thread instead of using catch_unwind, which has been the recommended way to catch panics for foreign function interfaces for a few releases now.
2016-12-04Avoid using locally installed Source Code Pro font (fixes #24355).Martin Pool-1/+3
In some versions of this font the ampersands are drawn badly.
2016-12-04reference: fix definition of :ttAlex Burka-1/+2
The reference says that $x:tt matches "either side of the `=>` in macro_rules` which is technically true but completely uninformative. This changes that bullet point to what the book says (a single token or sequence of token trees inside brackets).
2016-12-04Auto merge of #38087 - jooert:remove_unmarked, r=petrochenkovbors-5/+0
Remove the `unmarked_api` feature Closes #37981.
2016-12-03Rollup merge of #38130 - jethrogb:patch-3, r=steveklabnikCorey Farwell-4/+5
Update items section in reference Make clear that items must be definitions, and add missing extern block
2016-12-02Update items section in referencejethrogb-4/+5
Make clear that items must be definitions, and add missing extern block
2016-12-01Minor fix to testing concurrency sectionSteve Smith-5/+5
2016-11-30Remove the `unmarked_api` featureJohannes Oertel-5/+0
Closes #37981.
2016-11-25Auto merge of #37960 - samestep:five, r=frewsxcvbors-1/+1
Use literal 5 instead of five in book section 4.1 The other two code snippets in this sentence are valid code, so it makes more sense to use the literal `5` rather than the invalid symbol `five`.
2016-11-23Use literal 5 instead of five in book section 4.1Sam Estep-1/+1
2016-11-23Rollup merge of #37836 - steveklabnik:remove-incorrect-reference-comment, ↵Guillaume Gomez-1/+1
r=GuillaumeGomez Clarify the reference's status. The former wording only gave part of the picture, we want to be crystal clear about this. /cc @petrochenkov, who had concerns about https://github.com/rust-lang/rust/pull/37820
2016-11-20Rollup merge of #37876 - birkenfeld:patch-1, r=apasel422Guillaume Gomez-8/+9
reference: fix duplicate bullet points in feature list
2016-11-20Rollup merge of #37840 - brcooley:patch-1, r=steveklabnikGuillaume Gomez-1/+1
Fix grammar error in lifetimes.md
2016-11-19reference: fix duplicate bullet points in feature listGeorg Brandl-8/+9
2016-11-17Fix grammar error in lifetimes.mdBrett Cooley-1/+1
2016-11-17Rollup merge of #37766 - tarka:book-testing-concurrency-capture, r=steveklabnikGuillaume Gomez-0/+42
Add sections about testing concurrency and stdout/err capture
2016-11-17Clarify the reference's status.steveklabnik-1/+1
The former wording only gave part of the picture, we want to be crystal clear about this.
2016-11-14Remove thread-per-CPU bit as it may not be accurate.Steve Smith-6/+5
2016-11-14Typo in new sectionSteve Smith-1/+1
2016-11-14Auto merge of #37755 - polo-language:doc-punct, r=GuillaumeGomezbors-183/+184
Improved punctuation, capitalization, and sentence structure of code snippet comments r? @GuillaumeGomez
2016-11-14Add sections about concurrency and stdout/err capture to the Testing chapter ↵Steve Smith-0/+43
of the book.
2016-11-13Improved punctuation, capitalization, and sentence structure of code snippet ↵Angelo Polo-183/+184
comments
2016-11-12Minor grammar fix to ffi.mdReza Akhavan-1/+1
2016-11-12Rollup merge of #37708 - oli-obk:box_free, r=eddybEduard-Mihai Burtescu-2/+2
change the `box_free` lang item to accept pointers to unsized types in miri we use the `box_free` lang item as the destructor for `Box` objects, since the function's api matches that of an `fn drop(&mut self)` in a hypothetical `impl<T: ?Sized> Drop for Box<T>` exactly. This works fine except if we insert a check in the `size_of` intrinsic to ensure that it is only called with sized types, since the `box_free` lang item calls that intrinsic. cc @eddyb no clue who to r? here, probably lang team?
2016-11-12Rollup merge of #37503 - nwin:patch-3, r=steveklabnikEduard-Mihai Burtescu-14/+8
Remove remark about poor code style 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-11-12Rollup merge of #37368 - trotter:patch-1, r=steveklabnikEduard-Mihai Burtescu-31/+92
Update testing.md to reflect changes to cargo new `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-11Update patch with example.nwin-1/+15
2016-11-11[breaking-change] change the `box_free` item to accept pointers to unsized typesOliver 'ker' Schneider-2/+2
2016-11-10Ignore tests failing due to lack of `fn main`Trotter Cashion-7/+9
While the commit message on this one sounds terrible, it's really not so bad. The issue is that our test runner _expects_ a `fn main() {}` in code blocks that it'll test, but this code really shouldn't have them. If it did, then clicking the "play" link in the docs would result in play.rust-lang.org not treating this code as a test example to be run.
2016-11-10Remove extraneous wordTrotter Cashion-1/+1
2016-11-10Change project path for consistencyTrotter Cashion-5/+5
I had used `/tmp/adder` for my previous commits. Flipped over to `/home/you/projects/adder` for consistency with other parts of testing.md
2016-11-10Remove `mod tests` from earlier sectionsTrotter Cashion-62/+51
The narrative flows better if we follow what @steveklabnik is doing in rust-lang/book#288. Therefore, I completely copied it.
2016-11-10Instruct play.rust-lang.org to treat code as testsTrotter Cashion-2/+46
Without these changes, play.rust-lang.org (as of today) would wrap our examples in `fn main() {}`. This prevents the user from being able to easily run the tests.
2016-11-10Rollup merge of #37664 - est31:master, r=nrcEduard-Mihai Burtescu-2/+8
Document the question mark operator in reference and the book's syntax index The question mark operator will be stabilized for the Rust 1.13 release (unfortunately). Even though I don't like the operator, it still should be documented in the syntax index in the book and in the reference. Maybe there are people who also want to change the book's chapters on error handling, depending on their views of what idiomatic error handling is, now that the operator is stable, but I don't want to and I'd prefer to keep this PR focused on the reference and syntax index only. Please also apply this PR to the beta branch of rust.
2016-11-09Document the question mark operatorest31-2/+8
2016-11-08Rollup merge of #37601 - brson:book-without-tiers, r=steveklabnikSteve Klabnik-99/+12
book: Removed platform compatibility table, link to the forge 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. r? @steveklabnik cc @alexcrichton
2016-11-08Rollup merge of #37483 - xfix:patch-1, r=steveklabnikSteve Klabnik-23/+43
Match guessing game output to newest language version Cargo now informs that it has finished, and there is new error format.
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-08Rollup merge of #35102 - steveklabnik:ref_warning, r=aturonSteve Klabnik-0/+5
Make it clear that the reference isn't normative Any time someone edits the reference, it has to be taken very seriously, since it's the closest thing we have to a specification. This commit adds language which indicates that this is not a normative document, which makes it easier to make tweaks without worrying about forever harming the future of Rust by painting ourselves in a corner. r? @aturon
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-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-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.