Commit Graph

3885 Commits

Author SHA1 Message Date
Alex Crichton
ede8944ea7 rustbuild: Run all markdown documentation tests
This commit adds support to rustbuild to run all documentation tests, basically
running `rustdoc --test` over all our documentation. This also includes support
for running the error index tests.
2016-04-19 09:52:56 -07:00
Michael Tiller
f7ec6873cc Opening sentence was confusing and something cannot be "one of the most unique" (it either is or is not unique). 2016-04-19 12:39:31 -04:00
Michael Tiller
864eba884d Opening sentence was confusing and something cannot be "one of the most unique" (it either is or is not unique). 2016-04-19 12:38:39 -04:00
Michael Tiller
f252cfa2d4 Update ownership.md
Opening sentence was confusing and something cannot be "one of the most unique" (it either is or is not unique).
2016-04-19 12:34:33 -04:00
Steve Klabnik
31374d8030 Rollup merge of #33035 - jbranchaud:use-consistent-variable-names-in-ownership, r=GuillaumeGomez
Use `v` instead of `v1` for consistency

The code examples and previous paragraphs all use `v` and `v2`
2016-04-18 14:50:35 -04:00
Steve Klabnik
d3d9bd0e47 Rollup merge of #33007 - notriddle:master, r=steveklabnik
Do not use "bind" to refer to both referencing and to assignment

See https://users.rust-lang.org/t/difference-between-four-references/5406/7
2016-04-18 14:50:35 -04:00
Steve Klabnik
108a9e43e3 Rollup merge of #32906 - jocki84:jocki84-book-size, r=steveklabnik
Reword explanation of 'size' types.

Do not reference machine 'pointers' in explanation of 'size' types.

I think the number of elements that can be directly addressed is a fundamental feature of a machine architecture in its own right. The fact that it coincides with the ‘size’ of a pointer should be viewed as an ‘implementation detail’ ;)
2016-04-18 14:50:34 -04:00
jbranchaud
06e2e0e18d Use v instead of v1 for consistency
The code examples and previous paragraphs all use `v` and `v2`
2016-04-16 13:27:33 -05:00
Kaiyin Zhong
6c93c92ba7 Update casting-between-types.md 2016-04-16 18:04:27 +02:00
Michael Howell
63b508006d Do not use "bind" to refer to referencing and to variable binding. 2016-04-15 13:06:09 -07:00
Manish Goregaokar
eba80558d7
Rollup merge of #32973 - kindlychung:patch-1, r=steveklabnik
remove "#" symbols to make the code compile
2016-04-16 01:18:12 +05:30
Manish Goregaokar
50932f5c6a
Rollup merge of #32931 - deepak:gh-issue-32928-update-cargo-in-getting-started-doc, r=GuillaumeGomez
Doc fix: Update Cargo.toml in book/getting-started

The Cargo.toml mentioned in book/getting-started
is missing the section called `[dependencies]`

fixes https://github.com/rust-lang/rust/issues/32928
2016-04-16 01:18:04 +05:30
Kaiyin Zhong
a3f5d8aea1 make the borrowing example more concrete 2016-04-15 18:12:52 +02:00
Kaiyin Zhong
f91649144e remove "#" symbols to make the code compile 2016-04-15 00:51:20 +02:00
Alex Crichton
9e43649182 doc: Update our tier support
This modifies our listing of tiered platforms a few ways:

* All lists are alphabetized based on target now
* Lots of targets are moved up to "Tier 2" as we're gating on all these builds
  and official releases are provided (and installable via rustup).
* A few targets now list having a compiler + cargo now as well.

No more platforms have been moved up to Tier 1 at this time, however. The only
real candidate is ``x86_64-unknown-linux-musl`, but that's not *quite* to a tier
1 level of quality just yet so let's hold off for another release or so to iron
it out a bit.
2016-04-14 13:21:18 -07:00
Deepak Kannan
a40629d2c9 Doc fix: Do not mention next project in book/guessing-game
The next project refers to the dining-philosophers problem
27a1834ce5/src/doc/book/dining-philosophers.md

which was removed in
0c6c34de87

so removing reference to that project from book/guessing-game
2016-04-13 21:53:47 +05:30
Deepak Kannan
722faa024b Doc fix: Update Cargo.toml in book/getting-started
The Cargo.toml mentioned in book/getting-started
is missing the section called `[dependencies]`
2016-04-13 17:06:24 +05:30
jocki84
a548d4deb6 Update primitive-types.md
Replace "make for" by the slightly more accurate "account for".
2016-04-12 16:03:53 +02:00
jocki84
069b3a67f5 Update primitive-types.md
Simplify explanation and rephrase as per @GuillaumeGomez's suggestion.
2016-04-12 14:59:55 +02:00
Alec S
4d8fac078a Add data race to concurrency docs 2016-04-08 10:33:31 -05:00
bors
444a118a89 Auto merge of #32583 - arielb1:need-a-bound, r=nikomatsakis
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-07 03:07:24 -07:00
Steve Klabnik
fce5901507 Rollup merge of #32679 - tclfs:patch-1, r=steveklabnik
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-06 12:12:08 -07:00
Steve Klabnik
be862ca5b8 Rollup merge of #32634 - varunvats:docs-fix, r=steveklabnik
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-06 12:12:07 -07:00
Ariel Ben-Yehuda
728d20f7cc improve error message 2016-04-05 20:58:58 +03:00
Ariel Ben-Yehuda
8a461d940c 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.
2016-04-05 20:58:58 +03:00
Varun Vats
a7d15ce6a6 Doc fix: list all module files Rust looks for.
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-05 12:09:55 -05:00
Varun Vats
d841c15704 Doc fix: function takes argument by reference. 2016-04-05 12:09:55 -05:00
Manish Goregaokar
a447124963 Mention that it's not actually a data race
Conflicts:
	src/doc/book/concurrency.md
2016-04-05 02:49:16 +05:30
Tang Chenglong
a2f6d29420 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-02 21:03:59 +08:00
bors
f2285bdaf5 Auto merge of #32549 - respeccing:rust_backtrace_disabled, r=alexcrichton
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:👿: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](cb5533e159/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:👿: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-02 01:47:59 -07:00
Manish Goregaokar
70ae2a1cff Rollup merge of #32629 - mbrubeck:nomicon-version, r=steveklabnik
Update Rust version in the Rustonomicon Vec chapter

I verified that the final code compiles in Rust 1.9.0-nightly.

r? @steveklabnik
2016-04-01 18:44:48 +05:30
Manish Goregaokar
d7429f1378 Rollup merge of #32622 - tyoc213:rust-beginners, r=alexcrichton
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-04-01 18:44:48 +05:30
Emanuel Czirai
e1d2eda7f3 allow RUST_BACKTRACE=0 to act as if unset
/# 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-31 23:02:59 +02:00
David AO Lozano
9094935b46 Using only one Mibbit link for access the two channels 2016-03-31 02:49:15 -06:00
David AO Lozano
c233f2ee29 Adding #rust-beginners to README and pointing the two channels on getting-started 2016-03-31 02:49:05 -06:00
David AO Lozano
90d7440f54 Misspelled beginners in one place 2016-03-31 02:48:50 -06:00
David AO Lozano
823f239ae5 Book: in beginner guide change irc channel #rust → #rust-beginners 2016-03-31 02:47:46 -06:00
Matt Brubeck
d93fb02a5e Update Rust version in the Rustonomicon Vec chapter
I verified that the final code compiles in Rust 1.9.0-nightly.
2016-03-30 16:59:38 -07:00
Manish Goregaokar
458fae709c Rollup merge of #32618 - ProgVal:patch-1, r=steveklabnik
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-31 05:04:59 +05:30
Valentin Lorentz
b1b37384cd Book: Fix phrasing: “an associated type” → “a trait with an associated type”. 2016-03-30 19:34:53 +02:00
Steve Klabnik
45d633db26 Rollup merge of #32605 - tshepang:not-needed, r=Manishearth
doc: "mut" not needed for the examples
2016-03-30 10:16:54 -07:00
Christopher Serr
e9b1c3ccb5 Fix panic_fmt in the Book
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-29 22:28:17 +02:00
Tshepang Lekhonkhobe
cd92e9f966 doc: "mut" not needed for the examples 2016-03-29 19:59:55 +02:00
bors
cad964a626 Auto merge of #32461 - mitaa:rdoc-anchors, r=alexcrichton
rustdoc: Correct anchor for links to associated trait items

fixes #28478

r? @alexcrichton
2016-03-28 18:34:50 -07:00
Steve Klabnik
9eea1d7494 Rollup merge of #32534 - xtian:patch-1, r=steveklabnik
Getting Started: "copy" -> "move"
2016-03-28 13:48:29 -04:00
Steve Klabnik
5e02fd3727 Rollup merge of #32509 - tclfs:patch-2, r=steveklabnik
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-28 13:48:29 -04:00
Steve Klabnik
982d9591e1 Rollup merge of #32504 - tclfs:patch-1, r=steveklabnik
Docs: a tiny modification
2016-03-28 13:48:28 -04:00
Steve Klabnik
56bb7b64c8 Rollup merge of #32235 - fbergr:trailing_whitespace, r=sanxiyn
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-28 13:48:28 -04:00
Andrew Horton
60a1aa7147 Update concurrency.md
Typo "las time" -> "last time"
2016-03-28 10:35:46 +01:00
Christian Wesselhoeft
dd08804f0a Getting Started: "copy" -> "move" 2016-03-27 12:15:31 -06:00
Manish Goregaokar
5954fce848 Improve concurrency chapter 2016-03-27 22:05:58 +05:30
Tang Chenglong
708c5d09d7 Update macros.md 2016-03-27 17:59:33 +08:00
mitaa
6a76872d71 Extend linkchecker with anchor checking
This adds checks to ensure that:
* link anchors refer to existing id's on the target page
* id's are unique within an html document
* page redirects are valid
2016-03-27 00:21:00 +01:00
Tang Chenglong
bbba872dde 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 `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-26 23:59:16 +08:00
Manish Goregaokar
2c4d039b76 Rollup merge of #32478 - xevix:docs/strings-str-unsized-types, r=steveklabnik
Add note on `str` being an unsized type in strings section of book

The book section on Rust strings mentions `&str` and `String` but does not address why `str` is not used directly. This adds a short blurb and a link to the unsized types chapter. The second draft of the book will go more in-depth on this, but this should help a bit for now. Thanks #rust for clarifying this point, and let me know if it needs rewording or different placement 😄.

CC @steveklabnik @Kimundi
2016-03-26 20:35:49 +05:30
Manish Goregaokar
4a1e19990f Rollup merge of #32383 - aidanhs:aphs-heap-move-guarantee, r=alexcrichton
Document heap allocation location guarantee

```
14:25 < aidanhs> is there any guarantee that boxes will not move the value on the heap when they are moved?
14:26 <@steveklabnik> aidanhs: ... i'm not sure if it's a guarantee, but it follows, generally
14:26 <@steveklabnik> aidanhs: moves mean memcpy, so you're memcpying the structure of the box itself, which is copying the pointer
14:26 <@steveklabnik> so the pointer won't be updated
14:26 <@steveklabnik> moves cannot do complex things like move the memory around on the heap
14:26 <@kmc> aidanhs: I would say it's guaranteed
14:27 < aidanhs> steveklabnik: yeah, that's what I was thinking, it'd be pretty strange for rust to do something, but I couldn't find any docs one way or the other
14:27 <@steveklabnik> kmc: aidanhs yeah, it's like a borderline thing that we don't explicitly guanratee but i think IS guaranteed by our other guarantees
14:27 <@steveklabnik> mostly that move == memcpy
14:28 < aidanhs> kmc: steveklabnik great thanks! would a PR to the rust reference along these lines be ok?
14:28 < jmesmon> aidanhs: I believe owning_ref has some discussion of that (stable references)
14:29 <@steveklabnik> aidanhs: i would probably take that, yeah
14:29 < aidanhs> jmesmon: thanks, I'll take a look at that
```
https://botbot.me/mozilla/rust/2016-02-22/?msg=60657619&page=18

r? @steveklabnik
2016-03-26 20:35:49 +05:30
Tang Chenglong
e469c79de8 Docs: a tiny modification 2016-03-26 21:18:08 +08:00
Alejandro Wainzinger
6ce63fb3f1 Add note on str being an unsized type in strings section of book. 2016-03-25 23:25:40 +09:00
Tang Chenglong
ceaf5dfdc1 Docs: some tiny corrections
TNT->`tnt`
firecracker->`firecracker`
2016-03-24 14:49:40 +08:00
Eduard-Mihai Burtescu
2e9b40f576 Rollup merge of #32443 - tclfs:patch-8, r=steveklabnik
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-23 17:59:16 +02:00
Eduard-Mihai Burtescu
d7bf3d3284 Rollup merge of #32431 - nicholasf:tweak/improve-expression, r=steveklabnik
Simplifying some of the phrasing explaining lifetime elision

Just simplifying some of the language expressing what kind of inference Rust can and can't do on function signatures.
2016-03-23 17:59:15 +02:00
bors
26cfc269a0 Auto merge of #32410 - Ticki:master, r=eddyb
Add support for naked functions

See https://github.com/rust-lang/rfcs/pull/1201#issuecomment-199442239

This PR adds `#[naked]` for marking naked functions.
2016-03-23 03:49:02 -07:00
Tang Chenglong
ea9ae48662 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-23 12:03:41 +08:00
nicholasf
45c72d5f5b Simplifying some of the phrasing explaining lifetime elision 2016-03-23 05:00:27 +11:00
Florian Berger
ccafdae9a1 Remove trailing whitespace at the end of lines 2016-03-22 19:31:39 +02:00
Ticki
1605ab377b Add support for naked functions 2016-03-21 21:01:08 +01:00
Steve Klabnik
6a3c7d5630 Rollup merge of #32397 - tclfs:patch-7, r=steveklabnik
docs: Make some changes in texts

In my understanding, the description is somehow inappropriate.
2016-03-21 11:46:53 -04:00
Steve Klabnik
078b288ebd Rollup merge of #32373 - tclfs:patch-5, r=steveklabnik
docs: Correct an  improper description

In the example, we made a immutable borrow to `println!`, not a mutable one.
2016-03-21 11:46:53 -04:00
Steve Klabnik
3c3b9ad76a Rollup merge of #32340 - Digipom:master, r=steveklabnik
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-21 11:46:52 -04:00
Steve Klabnik
0694d63674 Rollup merge of #32339 - tclfs:patch-4, r=apasel422
docs: make some tiny modification about spelling

I think it would be better after modification.
2016-03-21 11:46:52 -04:00
Tang Chenglong
a5d9057ca7 docs: Make some changes in texts
In my understanding, the description is somehow inappropriate.
2016-03-21 21:00:04 +08:00
Aidan Hobson Sayers
bb43f580e5 Document heap allocation location guarantee 2016-03-20 23:12:20 +00:00
Tang Chenglong
06d8b21372 docs: Correct an improper description
In the example, we made a immutable borrow to `println!`, not a mutable one.
2016-03-20 21:24:46 +08:00
Eduard-Mihai Burtescu
d5dceba8fa Rollup merge of #32327 - toddlucas:master, r=apasel422
Minor phrasing adjustment to book references-and-borrowing
2016-03-19 12:30:01 +02:00
Eduard-Mihai Burtescu
cb9b1b26c0 Rollup merge of #32316 - tclfs:patch-3, r=steveklabnik
docs: `let` introduces a statement

I changes *expression* to *statement* to make more accurate, because in Rust, `let` introduces a declaration statement.
2016-03-19 12:30:01 +02:00
Eduard-Mihai Burtescu
33c28b45c8 Rollup merge of #32288 - tclfs:patch-2, r=apasel422
docs: One typo

I think it's a mistake of spelling.
2016-03-19 12:30:00 +02:00
Kevin Brothaler
8f99ad2a2a Update of the book; Error handling, section on custom error types: we should also show the changes to the cause method. 2016-03-18 11:40:45 -04:00
Tang Chenglong
2318e9fbe2 docs: Make some tiny modification about spelling 2016-03-18 23:29:12 +08:00
Todd Lucas
667d1c67e2 Minor phrasing adjustment 2016-03-17 20:14:05 -07:00
Tang Chenglong
79244c3a6b let introduces a statement
I changes *expression* to *statement* to make more accurate, because in Rust, `let` introduces a declaration statement.
2016-03-18 01:17:19 +08:00
Tang Chenglong
01d76099f2 docs: One typo
I think it's a mistake of spelling.
2016-03-16 23:45:28 +08:00
Tang Chenglong
94ee40a5d4 FreeBSD has already supported Cargo
Both Packages and Ports of FreeBSD have Cargo in present.
2016-03-16 00:15:40 +08:00
Manish Goregaokar
2e21ff1a9d Rollup merge of #32218 - cantino:minor_book_typo_fixes, r=steveklabnik
Fix minor typos in doc.rust-lang.org/book

I've made a few typo and grammar fixes as I've been working through the book.
2016-03-13 19:33:27 +05:30
Andrew Cantino
56ab2a1cde Fix minor typos in doc.rust-lang.org/book 2016-03-12 12:35:34 -08:00
Manish Goregaokar
744ffed25a Rollup merge of #32178 - naltun:patch-1, r=steveklabnik
Update getting-started.md

In `rustc 1.7.0` the message that is displayed is now `Rust is ready to roll.`
2016-03-12 02:41:26 +05:30
bors
aeb85a9533 Auto merge of #32133 - alexcrichton:linkchecker, r=brson
Add a link validator to rustbuild

This commit was originally targeted at just adding a link checking script to the rustbuild system. This ended up snowballing a bit to extend rustbuild to be amenable to various tools we have as part of the build system in general.

There's a new `src/tools` directory which has a number of scripts/programs that are purely intended to be used as part of the build system and CI of this repository. This is currently inhabited by rustbook, the error index generator, and a new linkchecker script added as part of this PR. I suspect that more tools like compiletest, tidy scripts, snapshot scripts, etc will migrate their way into this directory over time.

The commit which adds the error index generator shows the steps necessary to add new tools to the build system, namely:

1. New steps are defined for building the tool and running the tool
2. The dependencies are configured
3. The steps are implemented

In terms of the link checker, these commits do a few things:

* A new `src/tools/linkchecker` script is added. This will read an entire documentation tree looking for broken relative links (HTTP links aren't followed yet).
* A large number of broken links throughout the documentation were fixed. Many of these were just broken when viewed from core as opposed to std, but were easily fixed.
* A few rustdoc bugs here and there were fixed
2016-03-11 04:38:04 -08:00
Noah
4d476693f0 Update getting-started.md
In `rustc 1.7.0` the message that is displayed is now `Rust is ready to roll.`
2016-03-10 11:34:42 -06:00
Steve Klabnik
4f8d0291f3 Rollup merge of #32150 - steveklabnik:gh20213, r=bluss
Remove inaccurate claim about inline assembly

It's not like GCC's.

Fixes #20213
2016-03-10 14:01:54 +03:00
Steve Klabnik
fc9bc7ac3b Rollup merge of #32149 - steveklabnik:gh31628, r=bluss
Add other primitive types to the reference

Fixes #31628
2016-03-10 14:01:54 +03:00
Steve Klabnik
c5ec055d1f Rollup merge of #32148 - steveklabnik:gh31912, r=apasel422
Small grammar fix in Guessing Game

When it was Option.expect(), there was an .ok().expect(), but now that it uses Result.expect(), there's only one method, not two.

Fixes #31912
2016-03-10 14:01:54 +03:00
Steve Klabnik
3820d38e90 Rollup merge of #32125 - pyfisch:patch-2, r=steveklabnik
Remove final note from testing chapter.

The information that documentation tests cannot be run in binary crates is already given at the beginning of the section.
2016-03-10 14:01:53 +03:00
Steve Klabnik
78484696fc Remove inaccurate claim about inline assembly
It's not like GCC's.

Fixes #20213
2016-03-09 03:52:35 -05:00
Steve Klabnik
aaca3175ba Add other primitive types to the reference
Fixes #31628
2016-03-09 03:42:36 -05:00
Steve Klabnik
0f426aa916 Small grammar fix in Guessing Game
When it was Option.expect(), there was an .ok().expect(), but now that it uses Result.expect(), there's only one method, not two.

Fixes #31912
2016-03-09 03:37:19 -05:00
Alex Crichton
73db76015e doc: Fix a bunch of broken links
A few categories:

* Links into compiler docs were just all removed as we're not generating
  compiler docs.
* Move up one more level to forcibly go to std docs to fix inlined documentation
  across the facade crates.
2016-03-08 13:44:14 -08:00
Steve Klabnik
33fe4d10fc Rollup merge of #32115 - tclfs:patch-1, r=apasel422
Update a spelling inconsistency

L26: "zero cost" -> "zero-cost"
2016-03-08 21:44:12 +03:00
Steve Klabnik
bf9610ddbb Rollup merge of #32103 - timmontague:patch-1, r=alexcrichton
Fixed link in ownership documentation

Changed "[vector]" to a link to the vector documentation.
2016-03-08 21:44:11 +03:00
Steve Klabnik
e35e5c434b Rollup merge of #32092 - bluss:operator-overload, r=steveklabnik
Update syntax index with OpAssign traits

book: Update syntax index with OpAssign traits

The traits are stable from Rust 1.8.
2016-03-08 21:44:11 +03:00
Steve Klabnik
86fb351059 Rollup merge of #32083 - nodakai:reference-scoped-enum-alias, r=nikomatsakis
reference.md: clarify the limitation of type alias on an enum

Tentatively define the current behavior as the specification.

Cf. rust-lang/rust#26264, rust-lang/rust#28556, rust-lang/rust#30936
2016-03-08 21:44:11 +03:00
Steve Klabnik
be506b256f Rollup merge of #31772 - nodakai:patch-1, r=steveklabnik
Clarify the semantics of enum discriminants

cf. https://doc.rust-lang.org/error-index.html#E0082

> The default type for enum discriminants is isize, but it can be adjusted by adding the repr attribute to the enum declaration.

It would be great if anyone could check my English.
2016-03-08 21:44:10 +03:00
Pyfisch
d7e406eab8 Remove final note from testing chapter.
The information that documentation tests cannot be run in binary crates is already given at the beginning of the section.
2016-03-08 19:33:27 +01:00
Tang Chenglong
dc829e2b93 Update a spelling inconsistency
L26: "zero cost" -> "zero-cost"
2016-03-08 13:42:05 +08:00
NODA, Kai
790178f6e5
reference.md: clarify the limitation of type alias on an enum
Cf. rust-lang/rust#26264

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-03-08 08:46:49 +08:00
Tim Montague
150b1c9217 Fixed link
Changed "[vector]" to a link to the vector documentation.
2016-03-07 10:30:25 -08:00
Ulrik Sverdrup
63933375e8 book: Update syntax index with OpAssign traits 2016-03-07 05:17:27 +01:00
NODA, Kai
559683cded
reference.md: clarify negation.
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-03-07 04:42:14 +08:00
Kai Noda
969d027e35
Clarify the semantics of enum discriminants
cf. https://doc.rust-lang.org/error-index.html#E0082
2016-03-07 02:45:10 +08:00
bors
8484831d29 Auto merge of #30884 - durka:inclusive-ranges, r=aturon
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges.

This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals.

- For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion.
- I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate.
- There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging.

cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq)
cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254
relevant to #28237 (tracking issue)
2016-03-06 07:16:41 +00:00
Steve Klabnik
55bc488db4 Rollup merge of #32002 - srinivasreddy:vector_doc, r=Manishearth
Issue here : https://github.com/rust-lang/rust/issues/31991
2016-03-04 14:17:28 -05:00
srinivasreddy
d2df5514c0 added ignore 2016-03-03 21:54:21 +05:30
srinivasreddy
2dc723de9a made print message similar across two loops 2016-03-02 20:42:26 +05:30
srinivasreddy
a3c9afa841 addressed review comments - grammar corrections, space additions 2016-03-02 20:35:30 +05:30
srinivasreddy
9bf73d24d0 Explained the difference between ownership iteration and reference iteration 2016-03-02 09:36:30 +05:30
Evan
cf01fb6836 Make book ordering more natural
Vectors come up in sections dedicated to ownership with the assumption that we know something about it but we haven't seen it yet. On the other hand, you need not know anything about ownership or lifetimes to understand the basics of vectors covered in the vector section of the book. Additionally, by moving it where it is there is a natural progression from loops to an iterative type which discusses for loops. This kind of interaction is generally better for learning.

I would like to have moved the struct section as well but I'm less confident about how to handle it since the ownership sections discuss structs and the structs section talks about mutable borrow.
2016-03-01 19:50:11 -05:00
Steve Klabnik
0ee1b99288 Rollup merge of #31987 - gcatlin:patch-1, r=steveklabnik
r? @steveklabnik
2016-03-01 13:39:42 -05:00
Steve Klabnik
c98c1b777f Rollup merge of #31984 - xaocon:master, r=steveklabnik
Had a discussion at https://www.reddit.com/r/rust/comments/488mjv/borrowing_or_returning_ownership/ about how an example could be worded more clearly and tried to take my recommendation and expand upon it with further information provided in the post.
2016-03-01 13:39:42 -05:00
Geoff Catlin
dcb92abbe1 grammar: 'fewer' instead of 'less' 2016-03-01 08:42:34 -05:00
bors
a93bb135c8 Auto merge of #31713 - alexcrichton:rustbuild-docs, r=brson
This commit implements documentation generation of the nomicon, the book, the
style guide, and the standalone docs. New steps were added for each one as well
as appropriate makefile targets for each one as well.
2016-03-01 04:44:56 +00:00
Evan
ae9121bb6d Clarified the details of a borrowing example.
Had a discussion at https://www.reddit.com/r/rust/comments/488mjv/borrowing_or_returning_ownership/ about how an example could be worded more clearly and tried to take my recommendation and expand upon it with further information provided in the post.
2016-02-29 23:22:30 -05:00
Alex Crichton
b643782a10 std: Stabilize APIs for the 1.8 release
This commit is the result of the FCPs ending for the 1.8 release cycle for both
the libs and the lang suteams. The full list of changes are:

Stabilized

* `braced_empty_structs`
* `augmented_assignments`
* `str::encode_utf16` - renamed from `utf16_units`
* `str::EncodeUtf16` - renamed from `Utf16Units`
* `Ref::map`
* `RefMut::map`
* `ptr::drop_in_place`
* `time::Instant`
* `time::SystemTime`
* `{Instant,SystemTime}::now`
* `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier`
* `{Instant,SystemTime}::elapsed`
* Various `Add`/`Sub` impls for `Time` and `SystemTime`
* `SystemTimeError`
* `SystemTimeError::duration`
* Various impls for `SystemTimeError`
* `UNIX_EPOCH`
* `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign`

Deprecated

* Scoped TLS (the `scoped_thread_local!` macro)
* `Ref::filter_map`
* `RefMut::filter_map`
* `RwLockReadGuard::map`
* `RwLockWriteGuard::map`
* `Condvar::wait_timeout_with`

Closes #27714
Closes #27715
Closes #27746
Closes #27748
Closes #27908
Closes #29866
2016-02-29 09:05:33 -08:00
bors
504ca6f422 Auto merge of #31958 - teoryn:patch-3, r=nagisa 2016-02-29 11:12:15 +00:00
bors
776a0f2cee Auto merge of #31960 - aidanhs:aphs-tweak-aliasing-docs, r=Manishearth
See https://doc.rust-lang.org/book/unsafe.html#what-does-safe-mean for the book version of these points which already contain the T.
2016-02-29 05:03:32 +00:00
Aidan Hobson Sayers
246401367d Add the 'T' present in the rust book 2016-02-29 02:50:18 +00:00
Kevin Stock
7f59e069e8 Fix typo (an Result) 2016-02-28 20:48:17 -05:00
Kevin Stock
251f41905a Fix typo (!#[no_std]) 2016-02-28 20:46:56 -05:00
bors
d56677a187 Auto merge of #31931 - Luke-Nukem:master, r=steveklabnik
Refinement of paragraph referenced by [this issue](https://github.com/rust-lang/rust/issues/31927).

The paragraph in question had been adjusted already, but I've made some further clarifications which should help with readability and not leave the reader any `dangling pointers`.
2016-02-27 20:26:59 +00:00
Kevin Stock
9eda98a587 Resolve ambiguous documentation
See http://www.ietf.org/rfc/rfc2119.txt
2016-02-27 08:26:42 -05:00
Alex Burka
15a8a296b7 document inclusive range syntax 2016-02-27 02:01:41 -05:00
Manish Goregaokar
35b30424df Rollup merge of #31909 - benaryorg:patch-2, r=Manishearth
`continue` expression's description mentioned `break` instead of `continue`
2016-02-27 10:52:00 +05:30
Luke Jones
edd5f3328b Refinement of paragraph referenced by [this
issue](https://github.com/rust-lang/rust/issues/31927)
2016-02-27 14:41:38 +13:00
Manish Goregaokar
903798dce0 Rollup merge of #31883 - birkenfeld:doc-null-escape, r=bluss
It appears in the examples, but is not covered by any of the cases
in the prose description.
2016-02-26 17:03:40 +05:30
Katze
7a549598bb
documentation fix
`continue` expression's description mentioned `break` instead of `continue`

Signed-off-by: benaryorg <binary@benary.org>
2016-02-26 09:58:01 +01:00
Manish Goregaokar
4cfa2ee2f1 Rollup merge of #31827 - teoryn:patch-1, r=brson 2016-02-25 15:06:06 +05:30
Georg Brandl
d472b69da1 Document the null-char/null-byte escape in the reference
It appears in the examples, but is not covered by any of the cases
in the prose description.
2016-02-25 08:30:42 +01:00
Manish Goregaokar
b660ca59ff Rollup merge of #31870 - ivan:filter-explain, r=steveklabnik
As a Rust newbie, I found the book's explanation for why the `filter` closure gets a reference very confusing, and tried to figure out why `filter` is somehow less consumptive than `map` -- but it isn't; that's controlled by `iter`/`into_iter`.  I flailed around for a while until @habnabit explained it to me, and in retrospect it is quite obvious :-)
2016-02-25 04:21:11 +05:30
Manish Goregaokar
a834cd1b70 Rollup merge of #31868 - fhahn:capitalize-Rust, r=steveklabnik 2016-02-25 04:21:11 +05:30
Manish Goregaokar
f28677506c Rollup merge of #31863 - matklad:clarify-reference, r=steveklabnik
Reference implied that use declarations may appear *only* at the top of blocks and modules, but it is not the case, and the following is valid:

```Rust
fn foo() {
    let x = 92;
    use baz::bar;
}
```

r? @steveklabnik
2016-02-25 04:21:11 +05:30
Manish Goregaokar
e928297a3b Rollup merge of #31677 - ivan:doc-vtable, r=steveklabnik
I sure hope this fix is right

cc @steveklabnik
2016-02-25 04:21:10 +05:30
Ivan Kozik
7042c8ef8d book: Explain better why the filter closure gets a reference 2016-02-24 20:09:01 +00:00
Florian Hahn
145190bd2a Capitalize some occurences of Rust in documentation 2016-02-24 19:56:28 +01:00
Aleksey Kladov
397ab315e7 reference: clarify use declaration location 2016-02-24 19:13:31 +03:00
Kevin Stock
b49ce1a599 Fix warn(unused_mut) in example 2016-02-22 22:37:02 -05:00
Chad Shaffer
6e985934bd Fix number of lines and methods in guessing game 2016-02-20 17:00:54 -08:00
Ivan Kozik
58f0d72d90 reference: vtable entries: copy @nikomatsakis's wording 2016-02-18 19:17:09 +00:00
Steve Klabnik
9f0e39ba16 Rollup merge of #31565 - SDX2000:docfixes4, r=steveklabnik
See title and diff for more information.
2016-02-17 18:14:35 -05:00
Sandeep Datta
1536195ce6 Made v2 mutable so that we can actually truncate it. 2016-02-17 20:47:24 +05:30
Alex Crichton
848e78550c rustbuild: Add rustbook/standalone doc support
This commit implements documentation generation of the nomicon, the book, the
style guide, and the standalone docs. New steps were added for each one as well
as appropriate makefile targets for each one as well.
2016-02-16 10:39:55 -08:00
Dirk Gadsden
f2bea1cb70 Clarify contiguous memory array structure of vectors in documentation
Closes #31554.

Contributes to #29380.
2016-02-16 04:10:30 +05:30
Ivan Kozik
347a257a47 reference: vtable entries are resolved at runtime 2016-02-15 15:53:55 +00:00
Steve Klabnik
fb09a441c6 Rollup merge of #31658 - felgru:master, r=steveklabnik
In the Rust code above this block of compiler output, the function is called print_sum, so use the same function name in the error message.
2016-02-14 18:02:32 -05:00
Felix Gruber
3eebec697c doc: fix compiler output
In the Rust code above, the function is called print_sum, so use the
same function name in the error message.
2016-02-14 20:50:12 +01:00
fbergr
310ab5ea74 doc: Remove trailing whitespace 2016-02-14 14:31:20 +02:00
Manish Goregaokar
b34e625faf Rollup merge of #31638 - rkruppe:rm-tex, r=alexcrichton
This file is unused since #27789
2016-02-14 05:06:36 +05:30
Manish Goregaokar
34d95f498c Rollup merge of #31612 - raindev:grammar, r=steveklabnik
I feel sorry for bothering you with such a literally one character changes. If it is counter productive feel free to point it out in the comments, that would be totally understandable. I could try to pack such a changes together in one PR to make them less distractive.

r? @steveklabnik
2016-02-14 05:06:35 +05:30
Manish Goregaokar
8873732585 Rollup merge of #31610 - Manishearth:doc-clarify-txrx, r=steveklabnik
Not everyone knows this convention. We could just rename the variables in the
example, but since this notation is commonly used it's a good opportunity to
introduce it.

r? @steveklabnik
2016-02-14 05:06:35 +05:30
Manish Goregaokar
1598995766 Rollup merge of #31563 - SDX2000:docfixes1, r=steveklabnik
This is a minor change. Please see title. IMO this is important since this is the first instance when we talk about allocating a vector. Not saying that it is allocated on the stack here leaves room for speculation and this might put off some people (they might not even read the later sections which go into more detail about this).
2016-02-14 05:06:33 +05:30
Robin Kruppe
3e34519141 Remove the last remaining .tex file 2016-02-13 20:27:57 +01:00
Sandeep Datta
37a952a672 Fixed build error as per steveklabnik's suggestion and expanded on the ills of doing out of bounds accesses. 2016-02-13 18:40:24 +05:30
Andrew Barchuk
eb0f9f81f0 Remove unnecessary article 2016-02-12 21:40:02 +02:00
Manish Goregaokar
9ec112749b Clarify what tx/rx mean in concurrency docs 2016-02-13 00:57:52 +05:30
Sandeep Datta
a6fedc85bf Minor change. 2016-02-11 19:55:45 +05:30
Sandeep Datta
a8fd1bbd2f Minor change. 2016-02-11 19:44:33 +05:30
Sandeep Datta
50d179e062 Explained the data race with an example. 2016-02-11 19:40:19 +05:30
Sandeep Datta
62b3b40ade Clarified move semantics in "the details" section. 2016-02-11 12:30:53 +05:30
Sandeep Datta
8f61a4b34c Added a few words to indicate where the vector object is created. 2016-02-11 11:16:47 +05:30
Oliver Middleton
cff81d724f Fix documentation example in the book
The code sections shouldn't be inside a ```text block.
2016-02-10 17:19:27 +00:00
Steve Klabnik
6571ae28a8 Rollup merge of #31514 - cgar:spelling, r=alexcrichton 2016-02-09 16:58:59 -05:00
Carlos E. Garcia
02aa0aff2f Minor spelling fixes 2016-02-09 11:52:39 -05:00
Andrew Barchuk
422cf2d34a Clean up Error Handling case study examples
Remove unnecessary cloning and conversions. Expand tabs left in examples.
2016-02-07 23:08:46 +02:00
bors
5147c1f2c0 Auto merge of #31307 - nagisa:mir-drop-terminator, r=nikomatsakis
The scope of these refactorings is a little bit bigger than the title implies. See each commit for details.

I’m submitting this for nitpicking now (the first 4 commits), because I feel the basic idea/implementation is sound and should work. I will eventually expand this PR to cover the translator changes necessary for all this to work (+ tests), ~~and perhaps implement a dynamic dropping scheme while I’m at it as well.~~

r? @nikomatsakis
2016-02-06 01:24:22 +00:00
Steve Klabnik
09e62bac0f Rollup merge of #31413 - tshepang:improve, r=steveklabnik 2016-02-04 16:39:06 -05:00
Steve Klabnik
fc6e7698c1 Rollup merge of #31412 - tshepang:add-trailing-commas, r=steveklabnik 2016-02-04 16:39:05 -05:00
Steve Klabnik
cd418ba09b Rollup merge of #31411 - tshepang:idiom, r=steveklabnik 2016-02-04 16:39:05 -05:00
Tshepang Lekhonkhobe
a2f22a00ec reference: add trailing commas 2016-02-04 22:44:32 +02:00
Tshepang Lekhonkhobe
69b1d75b76 reference: make the line a little more readable 2016-02-04 22:39:15 +02:00
Tshepang Lekhonkhobe
85b19d8aa3 reference: explicit return at function end is not idiomatic 2016-02-04 22:32:53 +02:00
Simonas Kazlauskas
432460a6fc Synthesize calls to box_free language item
This gets rid of Drop(Free, _) MIR construct by synthesizing a call to language item which
takes care of dropping instead.
2016-02-04 15:56:01 +02:00
Matt Brubeck
7b3ea40500 Remove redundant semicolon from "block_expr" in grammar reference
"stmt" already includes the terminating semicolon.
2016-02-03 13:43:52 -08:00
bors
a9922419cf Auto merge of #31370 - Manishearth:rollup, r=Manishearth
- Successful merges: #27499, #31220, #31329, #31332, #31347, #31351, #31352, #31366
- Failed merges:
2016-02-03 00:58:37 +00:00
Manish Goregaokar
1a21dabf27 Rollup merge of #31366 - paulsmith:patch-1, r=steveklabnik
The context of the link is `Result` but it points to the docs on `Option`'s `expect`.
2016-02-03 02:54:25 +05:30
Manish Goregaokar
86650211a9 Rollup merge of #31352 - steveklabnik:gh31154, r=nikomatsakis
Fixes #31154
2016-02-03 02:54:25 +05:30
bors
2dc132e4d2 Auto merge of #31312 - alexcrichton:no-le-in-powerpc64le, r=alexcrichton
Currently the `mipsel-unknown-linux-gnu` target doesn't actually set the
`target_arch` value to `mipsel` but it rather uses `mips`. Alternatively the
`powerpc64le` target does indeed set the `target_arch` as `powerpc64le`,
causing a bit of inconsistency between theset two.

As these are just the same instance of one instruction set, let's use
`target_endian` to switch between them and only set the `target_arch` as one
value. This should cut down on the number of `#[cfg]` annotations necessary and
all around be a little more ergonomic.
2016-02-02 17:11:48 +00:00
Steve Klabnik
6c907212b4 Add note about temporaries 2016-02-02 11:15:45 -05:00
Paul Smith
b2e887f0aa Fix reference to expect
The context of the link is `Result` but it points to the docs on `Option`'s `expect`.
2016-02-02 08:47:23 -06:00
Steve Klabnik
c3f6122215 Rollup merge of #31348 - alexcrichton:shuffle-tiers, r=steveklabnik
Some other shufflings as well:

* Three powerpc triples for Linux have been added recently
* An armv7 linux triple was added recently
* The 64-bit Solaris triple is now mentioned in tier 3

We are currently now also building nightlies for iOS, powerpc triples, and
armv7, but there hasn't been much vetting of the triples themselves so I've left
them in tier 3 for now.
2016-02-02 00:32:20 -05:00
Steve Klabnik
5f0d8ea1bd Rollup merge of #31345 - kamalmarhubi:book-docs-special-section-errors, r=steveklabnik
This matches the usage in the standard library's documentation.
2016-02-02 00:32:19 -05:00
Steve Klabnik
9eb417b17f Rollup merge of #31344 - steveklabnik:gh31334, r=alexcrichton
Fixes #31334

This is just a quicker fix for this issue; since I'm working on the next draft of the book, I don't want to put a huuuge amount of work into improving it here.
2016-02-02 00:32:19 -05:00
Steve Klabnik
0b8c71379c Rollup merge of #31340 - pra85:patch-1, r=alexcrichton
Spelling mistake -
`familliar` > `familiar`
2016-02-02 00:32:19 -05:00
Steve Klabnik
78afc78d9d Rollup merge of #30971 - SDX2000:docfixes, r=steveklabnik
Updated documentation to clarify the difference between `and_then` and `map`. This also explains why we need `and_then` in addition to `map`. Please look at the diff for more information.

r?  @alexcrichton
2016-02-02 00:32:17 -05:00
Alex Crichton
8f803c2026 Remove "powerpc64le" and "mipsel" target_arch
Currently the `mipsel-unknown-linux-gnu` target doesn't actually set the
`target_arch` value to `mipsel` but it rather uses `mips`. Alternatively the
`powerpc64le` target does indeed set the `target_arch` as `powerpc64le`,
causing a bit of inconsistency between theset two.

As these are just the same instance of one instruction set, let's use
`target_endian` to switch between them and only set the `target_arch` as one
value. This should cut down on the number of `#[cfg]` annotations necessary and
all around be a little more ergonomic.
2016-02-01 20:39:07 -08:00
Steve Klabnik
dc3a39d807 Explain behavior of _
Fixes #31154
2016-02-01 18:49:47 -05:00
Alex Crichton
0574b395ef doc: Move 32-bit MSVC to a tier 1 platform
Some other shufflings as well:

* Three powerpc triples for Linux have been added recently
* An armv7 linux triple was added recently
* The 64-bit Solaris triple is now mentioned in tier 3

We are currently now also building nightlies for iOS, powerpc triples, and
armv7, but there hasn't been much vetting of the triples themselves so I've left
them in tier 3 for now.
2016-02-01 12:53:38 -08:00
Kamal Marhubi
49fe519791 book: Change "Failures" to "Errors" in doc special sections chapter
This matches the usage in the standard library's documentation.
2016-02-01 12:26:51 -05:00
Steve Klabnik
7df3bf1860 make this example more obvious
Fixes #31334
2016-02-01 12:19:33 -05:00
Prayag Verma
2043cd8623 Fix typo in doc/book/getting-started.md
Spelling mistake -
`familliar` > `familiar`
2016-02-01 12:15:33 +05:30
jocki84
46885ee084 Reword explanation of 'size' types.
Do not reference machine 'pointers' in explanation of 'size' types.
2016-01-30 17:43:03 +01:00
Manish Goregaokar
f66d3c5566 Rollup merge of #31296 - steveklabnik:gh31249, r=alexcrichton
Rustdoc will automatically wrap things in main, but this doesn't work
here.

Fixes #31249
2016-01-30 17:57:17 +05:30
Manish Goregaokar
cf0f7a30f4 Rollup merge of #31295 - steveklabnik:gh31266, r=alexcrichton
These are free functions in the text, but methods in the standard
library.

Fixes #31266
2016-01-30 17:57:17 +05:30
Manish Goregaokar
ee7670ef34 Rollup merge of #31294 - steveklabnik:gh31284, r=alexcrichton
This code was refactored, but the words were not

Fixes #31284
2016-01-30 17:57:17 +05:30
Sandeep Datta
0922d7e68f Ignoring demo code with compilation error. 2016-01-30 13:43:02 +05:30