summary refs log tree commit diff
path: root/src/doc/book
AgeCommit message (Collapse)AuthorLines
2016-04-07Auto merge of #32583 - arielb1:need-a-bound, r=nikomatsakisbors-9/+8
Suggest adding a where-clause when that can help Suggest adding a where-clause when there is an unmet trait-bound that can be satisfied if some type can implement it. r? @nikomatsakis
2016-04-06Rollup merge of #32679 - tclfs:patch-1, r=steveklabnikSteve Klabnik-3/+1
Remove error description of `move` (1) `x` can be used in main() after the call to spawn(). Because the variables follow normal move semantics, though the keyword `move` is used, and i32 implements `Copy`. (2) I remove this sentence because the previous sentence gives the referrence to `move closures`, and more description of `move` may be redundant.
2016-04-06Rollup merge of #32634 - varunvats:docs-fix, r=steveklabnikSteve Klabnik-10/+16
Minor doc fixes in "Crates and Modules" and "Lifetimes" chapters These commits fix a couple of (minor) issues in the _Crates and Modules_ and the _Lifetimes_ chapters of the book. r? @steveklabnik
2016-04-05improve error messageAriel Ben-Yehuda-6/+6
2016-04-05suggest adding a where-clause when that can helpAriel Ben-Yehuda-9/+8
suggest adding a where-clause when there is an unmet trait-bound that can be satisfied if some type can implement it.
2016-04-05Doc fix: list all module files Rust looks for.Varun Vats-8/+14
1. In the English/Japanese phrases example in the "Multiple File Crates" section of the "Crates and Modules" chapter, there are a total of 8 module files that Rust looks for, while only four were listed. This commit lists all 8 explicitly. 2. Title case fix.
2016-04-05Doc fix: function takes argument by reference.Varun Vats-2/+2
2016-04-05Mention that it's not actually a data raceManish Goregaokar-1/+6
Conflicts: src/doc/book/concurrency.md
2016-04-02Remove error description of `move`Tang Chenglong-3/+1
(1) `x` can be used in main() after the call to spawn(). Because the variables follow normal move semantics, though the keyword `move` is used, and i32 implements `Copy`. (2) I remove this sentence because the previous sentence gives the referrence to `move closures`, and more description of `move` may be redundant.
2016-04-02Auto merge of #32549 - respeccing:rust_backtrace_disabled, r=alexcrichtonbors-0/+13
allow RUST_BACKTRACE=0 to act as if unset **UPDATE:** `RUST_BACKTRACE=0` to act as if the env. var is unset! (now `0` is what `disabled` was for, below) When RUST_BACKTRACE is set to "disabled" then this acts as if the env. var is unset. So, either make sure `RUST_BACKTRACE` is not set OR set it to `disabled` to achieve the same effect. Sample usage: ```bash $ rustc -o /tmp/a.out -- <(echo 'fn main(){ panic!() }') && RUST_BACKTRACE=disabled /tmp/a.out !! executing '/home/zazdxscf/build/1nonpkgs/rust/rust//x86_64-unknown-linux-gnu/stage2/bin//rustc' with args: '-o /tmp/a.out -- /dev/fd/63' thread '<main>' panicked at 'explicit panic', /dev/fd/63:1 note: Run with `RUST_BACKTRACE=1` for a backtrace. $ rustc -o /tmp/a.out -- <(echo 'fn main(){ panic!() }') && RUST_BACKTRACE=1 /tmp/a.out !! executing '/home/zazdxscf/build/1nonpkgs/rust/rust//x86_64-unknown-linux-gnu/stage2/bin//rustc' with args: '-o /tmp/a.out -- /dev/fd/63' thread '<main>' panicked at 'explicit panic', /dev/fd/63:1 stack backtrace: 1: 0x55709e8148c0 - sys::backtrace::tracing::imp::write::h140f24a0cfc189b98Ru 2: 0x55709e816a5b - panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::closure.45165 3: 0x55709e8166e8 - panicking::default_hook::hed419823688cb82aXoA 4: 0x55709e810fff - sys_common::unwind::begin_unwind_inner::hbb9642f6e212d56fmHt 5: 0x55709e810513 - sys_common::unwind::begin_unwind::h16232867470678019594 6: 0x55709e810489 - main::hb524f9576270962feaa 7: 0x55709e816314 - sys_common::unwind::try::try_fn::h1274188004693518534 8: 0x55709e813dfb - __rust_try 9: 0x55709e815dab - rt::lang_start::h712b1cd650781872ahA 10: 0x55709e810679 - main 11: 0x7efd1026859f - __libc_start_main 12: 0x55709e810348 - _start 13: 0x0 - <unknown> ``` Some programs(eg. [vim's syntactic](https://github.com/scrooloose/syntastic) used by [rust.vim](https://github.com/rust-lang/rust.vim)) cannot unset the env. var RUST_BACKTRACE if it's already set(eg. in .bashrc) but [they can set it to some value](https://github.com/respeccing/gentooskyline/blob/cb5533e1598f871d3fdf7c3d8248ce767b5b9360/system/Z575/OSes/gentoo/on_baremetal/filesystem_now/gentoo/home/zazdxscf/build/1nonpkgs/rust.vim/upd#L17), and I needed to ensure the env. var is unset in order to avoid this issue: https://github.com/rust-lang/rust/issues/29293 **EDIT:** Sample usage 2: ```bash $ export RUST_BACKTRACE=1 $ rustc -o /tmp/a.out -- <(echo 'fn main(){ panic!() }') && /tmp/a.out !! executing '/home/zazdxscf/build/1nonpkgs/rust/rust//x86_64-unknown-linux-gnu/stage2/bin//rustc' with args: '-o /tmp/a.out -- /dev/fd/63' thread '<main>' panicked at 'explicit panic', /dev/fd/63:1 stack backtrace: 1: 0x55c2696738c0 - sys::backtrace::tracing::imp::write::h140f24a0cfc189b98Ru 2: 0x55c269675a5b - panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::closure.45165 3: 0x55c2696756e8 - panicking::default_hook::hed419823688cb82aXoA 4: 0x55c26966ffff - sys_common::unwind::begin_unwind_inner::hbb9642f6e212d56fmHt 5: 0x55c26966f513 - sys_common::unwind::begin_unwind::h16023941661074805588 6: 0x55c26966f489 - main::hb524f9576270962feaa 7: 0x55c269675314 - sys_common::unwind::try::try_fn::h1274188004693518534 8: 0x55c269672dfb - __rust_try 9: 0x55c269674dab - rt::lang_start::h712b1cd650781872ahA 10: 0x55c26966f679 - main 11: 0x7f593d58459f - __libc_start_main 12: 0x55c26966f348 - _start 13: 0x0 - <unknown> $ rustc -o /tmp/a.out -- <(echo 'fn main(){ panic!() }') && RUST_BACKTRACE=disabled /tmp/a.out !! executing '/home/zazdxscf/build/1nonpkgs/rust/rust//x86_64-unknown-linux-gnu/stage2/bin//rustc' with args: '-o /tmp/a.out -- /dev/fd/63' thread '<main>' panicked at 'explicit panic', /dev/fd/63:1 note: Run with `RUST_BACKTRACE=1` for a backtrace. ```
2016-04-01Rollup merge of #32622 - tyoc213:rust-beginners, r=alexcrichtonManish Goregaokar-5/+7
Book: in beginner guide change irc channel #rust → #rust-beginners I also would like to add the reference on the first README.md Some like ``` most popular channel is [#rust], a venue for general discussion about -Rust, and a good place to ask for help. +Rust. And a good place to ask for help would be [#rust-beginners]. [IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat [#rust]: irc://irc.mozilla.org/rust +[#rust-beginners]: irc://irc.mozilla.org/rust-beginners ``` So In the first page would be the two options for #rust or #rust-beginners
2016-03-31allow RUST_BACKTRACE=0 to act as if unsetEmanuel Czirai-0/+13
/# This is a combination of 16 commits. /# The first commit's message is: allow RUST_BACKTRACE=disabled to act as if unset When RUST_BACKTRACE is set to "disabled" then this acts as if the env. var is unset. /# This is the 2nd commit message: case insensitive "DiSaBLeD" RUST_BACKTRACE value previously it expected a lowercase "disabled" to treat the env. var as unset /# This is the 3rd commit message: RUST_BACKTRACE=0 acts as if unset previously RUST_BACKTRACE=disabled was doing the same thing /# This is the 4th commit message: RUST_BACKTRACE=0|n|no|off acts as if unset previously only RUST_BACKTRACE=0 acted as if RUST_BACKTRACE was unset Now added more options (case-insensitive): 'n','no' and 'off' eg. RUST_BACKTRACE=oFF /# This is the 5th commit message: DRY on the value of 2 DRY=don't repeat yourself Because having to remember to keep the two places of '2' in sync is not ideal, even though this is a simple enough case. /# This is the 6th commit message: Revert "DRY on the value of 2" This reverts commit 95a0479d5cf72a2b2d9d21ec0bed2823ed213fef. Nevermind this DRY on 2, because we already have a RY on 1, besides the code is less readable this way... /# This is the 7th commit message: attempt to document unsetting RUST_BACKTRACE /# This is the 8th commit message: curb allocations when checking for RUST_BACKTRACE this means we don't check for case-insensitivity anymore /# This is the 9th commit message: as decided, RUST_BACKTRACE=0 turns off backtrace /# This is the 10th commit message: RUST_TEST_NOCAPTURE=0 acts as if unset (that is, capture is on) Any other value acts as if nocapture is enabled (that is, capture is off) /# This is the 11th commit message: update other RUST_TEST_NOCAPTURE occurrences apparently only one place needs updating /# This is the 12th commit message: update RUST_BACKTRACE in man page /# This is the 13th commit message: handle an occurrence of RUST_BACKTRACE /# This is the 14th commit message: ensure consistency with new rules for backtrace /# This is the 15th commit message: a more concise comment for RUST_TEST_NOCAPTURE /# This is the 16th commit message: update RUST_TEST_NOCAPTURE in man page
2016-03-31Using only one Mibbit link for access the two channelsDavid AO Lozano-8/+6
2016-03-31Adding #rust-beginners to README and pointing the two channels on ↵David AO Lozano-7/+11
getting-started
2016-03-31Misspelled beginners in one placeDavid AO Lozano-1/+1
2016-03-31Book: in beginner guide change irc channel #rust → #rust-beginnersDavid AO Lozano-3/+3
2016-03-31Rollup merge of #32618 - ProgVal:patch-1, r=steveklabnikManish Goregaokar-1/+1
Book: Fix phrasing: “an associated type” → “an object with an associated type”. From what I understood, `graph` is the object from which we create a trait object, and the associated types are `Graph::N` and `Graph::E`.
2016-03-30Book: Fix phrasing: “an associated type” → “a trait with an ↵Valentin Lorentz-1/+1
associated type”.
2016-03-30Rollup merge of #32605 - tshepang:not-needed, r=ManishearthSteve Klabnik-2/+2
doc: "mut" not needed for the examples
2016-03-29Fix panic_fmt in the BookChristopher Serr-2/+2
While implementing panic_fmt for the GameCube I noticed that the parameters given to it were completely broken. Turns out that panic_fmt requires the C ABI to work correctly. This should be fixed in the documentation, so that others don't make the same mistake. Thanks to mbrubeck in the IRC for helping me figure this out. Not specifying extern for lang_items correctly should potentially also be a compiler error.
2016-03-29doc: "mut" not needed for the examplesTshepang Lekhonkhobe-3/+3
2016-03-28Rollup merge of #32534 - xtian:patch-1, r=steveklabnikSteve Klabnik-1/+1
Getting Started: "copy" -> "move"
2016-03-28Rollup merge of #32509 - tclfs:patch-2, r=steveklabnikSteve Klabnik-3/+3
docs: make some text changes on Section `Macros` (1) In contrast to `that`, `so that` expresses `result` indicated by the sentence, not `reason`; (2) `block` is an expression, and may be have an expression, so I add `optionally an expression` to make more precise; ~~(3) When I read here, I was confused with what `the child` referred to. After modification, it would be better.~~
2016-03-28Rollup merge of #32504 - tclfs:patch-1, r=steveklabnikSteve Klabnik-1/+1
Docs: a tiny modification
2016-03-28Rollup merge of #32235 - fbergr:trailing_whitespace, r=sanxiynSteve Klabnik-17/+17
Remove trailing whitespace at the end of lines According the rules of styling Rust code there should not be trailing whitespace at the end of lines or files. I thought that it might be good to remove trailing whitespace from other files also, if it does not break anything.
2016-03-28Update concurrency.mdAndrew Horton-2/+2
Typo "las time" -> "last time"
2016-03-27Getting Started: "copy" -> "move"Christian Wesselhoeft-1/+1
2016-03-27Improve concurrency chapterManish Goregaokar-18/+124
2016-03-27Update macros.mdTang Chenglong-2/+2
2016-03-26docs: make some text changes on Section `Macros`Tang Chenglong-4/+4
(1) In contrast to `that`, `so that` expresses `result` indicated by the sentence, not `reason`; (2) `block` is an expression, and may be have an expression, so I add `optional an expression` to make more precise; (3) When I read here, I was confused with what `the child` referred to. After modification, it would be better.
2016-03-26Docs: a tiny modificationTang Chenglong-1/+1
2016-03-25Add note on `str` being an unsized type in strings section of book.Alejandro Wainzinger-0/+6
2016-03-24Docs: some tiny correctionsTang Chenglong-1/+1
TNT->`tnt` firecracker->`firecracker`
2016-03-23Rollup merge of #32443 - tclfs:patch-8, r=steveklabnikEduard-Mihai Burtescu-1/+1
Docs: Change "statements" to "expressions" on `match` I apt to use `expressions` over `statements`, because `match` is a expression in essence, though it can become a statement when followed a semicolon.
2016-03-23Docs: Change "statements" to "expressions" on `match`Tang Chenglong-1/+1
I apt to use `expressions` over `statements`, because `match` is a expression in essence, though it can become a statement when followed a semicolon.
2016-03-23Simplifying some of the phrasing explaining lifetime elisionnicholasf-8/+6
2016-03-22Remove trailing whitespace at the end of linesFlorian Berger-17/+17
2016-03-21Rollup merge of #32397 - tclfs:patch-7, r=steveklabnikSteve Klabnik-3/+3
docs: Make some changes in texts In my understanding, the description is somehow inappropriate.
2016-03-21Rollup merge of #32373 - tclfs:patch-5, r=steveklabnikSteve Klabnik-1/+1
docs: Correct an improper description In the example, we made a immutable borrow to `println!`, not a mutable one.
2016-03-21Rollup merge of #32340 - Digipom:master, r=steveklabnikSteve Klabnik-0/+10
Update of the book; Error handling, section on custom error types: we… … should also show the changes to the `cause` method. When I started creating my own error type, I found that we also have to update the cause method, otherwise we have a missing match branch. It would also be nice to elaborate on the relationship and difference between the description() and fmt() method, but that should be done by someone with more experience with them. :)
2016-03-21Rollup merge of #32339 - tclfs:patch-4, r=apasel422Steve Klabnik-4/+4
docs: make some tiny modification about spelling I think it would be better after modification.
2016-03-21docs: Make some changes in textsTang Chenglong-3/+3
In my understanding, the description is somehow inappropriate.
2016-03-20docs: Correct an improper descriptionTang Chenglong-1/+1
In the example, we made a immutable borrow to `println!`, not a mutable one.
2016-03-19Rollup merge of #32327 - toddlucas:master, r=apasel422Eduard-Mihai Burtescu-2/+2
Minor phrasing adjustment to book references-and-borrowing
2016-03-19Rollup merge of #32316 - tclfs:patch-3, r=steveklabnikEduard-Mihai Burtescu-2/+2
docs: `let` introduces a statement I changes *expression* to *statement* to make more accurate, because in Rust, `let` introduces a declaration statement.
2016-03-19Rollup merge of #32288 - tclfs:patch-2, r=apasel422Eduard-Mihai Burtescu-1/+1
docs: One typo I think it's a mistake of spelling.
2016-03-18Update of the book; Error handling, section on custom error types: we should ↵Kevin Brothaler-0/+10
also show the changes to the `cause` method.
2016-03-18docs: Make some tiny modification about spellingTang Chenglong-4/+4
2016-03-17Minor phrasing adjustmentTodd Lucas-2/+2
2016-03-18`let` introduces a statementTang Chenglong-2/+2
I changes *expression* to *statement* to make more accurate, because in Rust, `let` introduces a declaration statement.