Commit Graph

3246 Commits

Author SHA1 Message Date
Colin Wallace
4119fc2749 Fix "the the" typo and split a run-on sentence 2015-10-06 21:39:18 -07:00
Martin Pool
cbf97c3e65 style guide: suggest manual links to constructors 2015-10-06 19:42:58 -07:00
Jack Wilson
d21b4f5451 Use the correct mod name from the example 2015-10-06 19:22:05 -07:00
Daniel Carral
f5a653e46f Update TRPL/Installing Rust to avoid concrete version numbers
As discussed in PR #28817
2015-10-07 00:30:02 +02:00
bors
80660d6ba0 Auto merge of #28864 - aarzee:master, r=steveklabnik
Remove leading newlines in files and replace lines containing only whitespace with blank lines
2015-10-06 20:21:34 +00:00
bors
e7b6056048 Auto merge of #28842 - chrisccerami:patch-1, r=steveklabnik 2015-10-06 17:57:00 +00:00
panicbit
ce1f4fc0ba Add link to the german trpl translation 2015-10-06 19:50:09 +02:00
Carlos Liam
aba267fd0d Replace multiple trailing newlines with a single trailing newline
Sorry I didn’t get this in the last PR (#28864), I hadn’t thought of it.
2015-10-06 13:06:39 -04:00
Carlos Liam
3967e1c940 Clean newlines 2015-10-06 11:14:11 -04:00
Chris C Cerami
f490f5171e Wrap words at 80 characters 2015-10-06 10:39:37 -04:00
Craig Hills
7895ec2d57 address review concerns 2015-10-06 10:30:33 -04:00
Felix S. Klock II
9868df2fd5 Non-parametric dropck; instead trust an unsafe attribute (RFC 1238).
Implement cannot-assume-parametricity (CAP) from RFC 1238, and add the
UGEH attribute.

----

Note that we check for the attribute attached to the dtor method, not
the Drop impl.

(This is just to match the specification of RFC and the tests; I am
not wedded to this approach.)
2015-10-06 14:16:20 +02:00
bors
2f60768e84 Auto merge of #28858 - jryans:crate-doc-syntax, r=alexcrichton
Without the blank lines, the content is displayed inline, including the `rust,ignore` syntax hint.

r? @steveklabnik
2015-10-06 10:37:02 +00:00
J. Ryan Stinnett
ed97bcd44a Complex import example needs blank lines 2015-10-06 00:11:18 -05:00
Craig Hills
a78a874ebb possessive its 2015-10-05 22:32:53 -04:00
Craig Hills
8e420e07d9
trpl: Clarify closure terminology
This is to address issue #28803
2015-10-05 22:25:19 -04:00
bors
c2be91ede0 Auto merge of #28847 - Ms2ger:typos, r=steveklabnik 2015-10-05 20:02:02 +00:00
bors
be96988cf8 Auto merge of #28849 - semmaz:doc-anchor-fix, r=alexcrichton
r? @steveklabnik
2015-10-05 18:14:09 +00:00
Simon Mazur
fcf8dedb99 docs: anchors fixes 2015-10-05 19:25:54 +03:00
Chris C Cerami
e39808cba8 Link to 'Lifetime Elision' section at first use of elide 2015-10-05 11:40:32 -04:00
Chris C Cerami
915cf01cb6 Use a more common word than "elide", e.g. omit 2015-10-05 11:29:55 -04:00
Ms2ger
6b5349a45e Fix some typos. 2015-10-05 16:48:57 +02:00
Brian Anderson
12c68c977f Update bibliography.md 2015-10-04 15:55:19 -07:00
bors
5ff4442a3f Auto merge of #28831 - Seeker14491:patch-1, r=steveklabnik 2015-10-04 17:36:49 +00:00
James Bell
2b535a1622 Docs: Removes duplicate output from FFI example
The "Rust Inside Other Languages" page includes a library example. The
reference specifies printing "done!" when the code finishes running, and
the language examples (Ruby, Python, JS) all do this in their code.
However, the Rust library example code *also* does this, so that the
examples as written would output "done!" twice.

This removes the "done!" from the Rust example code to clarify the docs.
2015-10-04 10:44:00 +01:00
Seeker14491
a0284f4181 fix another typo 2015-10-04 00:34:21 -05:00
Seeker14491
f66170258f fix a few typos 2015-10-03 18:01:42 -05:00
Guillaume Gomez
aeb94a1948 Add missing dot 2015-10-03 20:21:39 +02:00
Steve Klabnik
92cff9f0d9 Rollup merge of #28819 - steveklabnik:doc_hr, r=brson
It's not really clear here, since the example is rendered, where it
starts and ends. So let's use <hr>s to split it up.
2015-10-02 20:38:23 -04:00
Steve Klabnik
f528c47c4b Add in some <hr>s for emphasis
It's not really clear here, since the example is rendered, where it
starts and ends. So let's use <hr>s to split it up.
2015-10-02 18:54:15 -04:00
Aleksey Kladov
eac9d71d8e reference: fix markdown formatting 2015-10-02 23:53:20 +03:00
Manish Goregaokar
3234ec1455 Rollup merge of #28786 - fhahn:ba-link, r=alexcrichton
This tiny PR just adds a link to  Florian Wilkens's Bachelor's Thesis.
2015-10-02 13:07:22 +05:30
bors
d9d9ca1a02 Auto merge of #28746 - aidanhs:aphs-musl-linking-no-cxxabi, r=alexcrichton
On reading https://github.com/alexcrichton/port-of-rust/blob/master/musl/Dockerfile I was surprised to see no libcxxabi. I experimented, and it does seem to be unnecessary.

I guess it's a remnant from the 3.6 build.

r? @alexcrichton
2015-10-01 18:16:08 +00:00
Florian Hahn
d76010f3d9 Add link to Florian Wilkens's Bachelor's Thesis 2015-10-01 11:36:26 +02:00
Steve Klabnik
f8c8c8c07d Rollup merge of #28772 - tshepang:improve-paragraph, r=steveklabnik 2015-09-30 18:20:04 -04:00
Steve Klabnik
0f6cea9a86 Rollup merge of #28771 - tshepang:upper-case, r=steveklabnik 2015-09-30 18:20:04 -04:00
Steve Klabnik
bc41536bb4 Rollup merge of #28770 - tshepang:awkward, r=steveklabnik 2015-09-30 18:20:03 -04:00
Steve Klabnik
4ab1ac5bc1 Rollup merge of #28764 - steveklabnik:gh28706, r=alexcrichton
Fixes #28706 

I am pretty sure that this is accurate, bout would love a double check.
2015-09-30 18:20:03 -04:00
Steve Klabnik
b6449eba51 Rollup merge of #28753 - steveklabnik:gh28572, r=alexcrichton
This is part of #28572, but doesn't complete it. Amongst other things,
this patch:

* Increases consistency in the way feature flags are used with other
  docs.
* Removes the ignores, which is nice: we actually had some syntax errors
  in the examples 😭.
* Mentions #![no_core]

Realistically, this document used to be in the order of least to most:
nothing, then adding core. But with the changes in RFC 1184, this is
backwards: it now shows stuff that uses core from the beginning. In the
future, I'd like to revamp this to go from 'most to least', but I'd like
to see the discussion in https://github.com/rust-lang/rust/issues/27701
goes before I write more.
2015-09-30 18:20:03 -04:00
Steve Klabnik
2a787a23d1 Improve identifier defintion in the reference
Fixes #28706
2015-09-30 14:59:05 -04:00
Steve Klabnik
15ee0e908c Rollup merge of #28765 - steveklabnik:gh28693, r=nikomatsakis
Fixes #28693
2015-09-30 14:51:55 -04:00
Steve Klabnik
a8ed0bfcaa Rollup merge of #28763 - steveklabnik:gh27917, r=alexcrichton
Fixes #27917
2015-09-30 14:51:55 -04:00
Steve Klabnik
64796d150c Rollup merge of #28761 - steveklabnik:gh28082, r=brson
We don't completely cover documentation tests in the testing chapter,
since we cover them in the documentation chapter. So make sure people
know that.

Fixes #28082
2015-09-30 14:51:55 -04:00
Steve Klabnik
d1137d634b Rollup merge of #28759 - steveklabnik:gh28359, r=nikomatsakis
Fixes #28359

I'm not doing more here because it's unclear that `as_slice()` is even going to stick around, see https://github.com/rust-lang/rust/issues/27729
2015-09-30 14:51:54 -04:00
Steve Klabnik
37d291e6ff Rollup merge of #28755 - steveklabnik:gh28418, r=alexcrichton
The original blog post referred to examples by their file names, and now
that it's in guide form, there is no file name. So edit the text so that
it makes a bit more sense.

Fixes #28428
2015-09-30 14:51:54 -04:00
Steve Klabnik
27254bc4aa Rollup merge of #28754 - luser:fix-rustdoc-module-links, r=Manishearth
The links in the rustdoc for several places in fmt were trying to link to
the std::fmt module but actually linking to std, which was confusing.
While trying to figure out why I noticed that the documentation chapter of
the Rust book has examples that show this same bug (although it doesn't seem
widespread in practice).

r? @steveklabnik
2015-09-30 14:51:54 -04:00
Steve Klabnik
3ef9c1d5f9 Mention that you can only index with usize
Fixes #28693
2015-09-30 13:46:58 -04:00
Steve Klabnik
9812eb0ef4 Elaborate on the io prelude in the book
Fixes #27917
2015-09-30 13:39:59 -04:00
Steve Klabnik
201384c107 Cross-reference doc chapter from testing chapter
We don't completely cover documentation tests in the testing chapter,
since we cover them in the documentation chapter. So make sure people
know that.

Fixes #28082
2015-09-30 13:31:17 -04:00
Steve Klabnik
bc0440a631 Call out slicing syntax more explicitly
Fixes #28359
2015-09-30 13:21:04 -04:00
Steve Klabnik
9c70d5160b Improve wording in error handling guide
The original blog post referred to examples by their file names, and now
that it's in guide form, there is no file name. So edit the text so that
it makes a bit more sense.

Fixes #28428
2015-09-30 12:39:37 -04:00
Ted Mielczarek
73bd0ba91e Fix module links in std::fmt and the Rust book's documentation chapter.
The links in the rustdoc for several places in fmt were trying to link to
the std::fmt module but actually linking to std, which was confusing.
While trying to figure out why I noticed that the documentation chapter of
the Rust book has examples that show this same bug (although it doesn't seem
widespread in practice).
2015-09-30 12:33:38 -04:00
Steve Klabnik
4632ad8896 Update no_std docs
This is part of #28572, but doesn't complete it. Amongst other things,
this patch:

* Increases consistency in the way feature flags are used with other
  docs.
* Removes the ignores, which is nice: we actually had some syntax errors
  in the examples 😭.
* Mentions #![no_core]

Realistically, this document used to be in the order of least to most:
nothing, then adding core. But with the changes in RFC 1184, this is
backwards: it now shows stuff that uses core from the beginning. In the
future, I'd like to revamp this to go from 'most to least', but I'd like
to see the discussion in https://github.com/rust-lang/rust/issues/27701
goes before I write more.
2015-09-30 11:46:33 -04:00
Aidan Hobson Sayers
b24552e0a5 libcxxabi is no longer necessary for libunwind 2015-09-30 07:42:34 +01:00
Jan Likar
ff2bc7785d Improve "Variable bindings" chapter
- Expand the first paragraph

 - Improve readability by partitioning the chapter into the following
   sections: "Patterns", "Type annotations", "Mutability", and
   "Initializing bindings"

 - Add "Scope and shadowing" section (fix #28177)
2015-09-30 02:42:52 +02:00
bors
5f06607e23 Auto merge of #27273 - tshepang:claim-not-accurate, r=steveklabnik 2015-09-29 15:04:47 +00:00
Willy Aguirre
e1acf87fe0 remove a sentence #28701 2015-09-28 10:46:50 -05:00
Tshepang Lekhonkhobe
4a5e190d46 reference: Unsafe section does not fit under Functions 2015-09-28 11:13:00 +02:00
Steve Klabnik
cc44d65c19 Rollup merge of #28680 - xaviershay:doc-readme, r=steveklabnik
This wasn't complete (you need a `./configure`), and it is already
documented well in the main README.

r? @steveklabnik
2015-09-26 18:00:39 -06:00
Steve Klabnik
3e36eecae4 Rollup merge of #28679 - xaviershay:book-unit-example, r=steveklabnik
This was non-obvious to me: with no example, I assumed `Electron {}` and
didn't know what else to try when it didn't work.  The correct form is
weird because it looks like you're assigning the struct name rather than
an instance of the struct.

r? @steveklabnik
2015-09-26 18:00:39 -06:00
Steve Klabnik
2ec89c7279 Rollup merge of #28677 - taboularasa:master, r=alexcrichton
the example for `find` was misleading in that it fails to mention the result is either `None` or `Some` containing only the first match. Further confusing the issue is the `println!` statement, "We got some numbers!"
2015-09-26 18:00:38 -06:00
Xavier Shay
865889a2cc Fix meta-documentation for generating all docs.
This wasn't complete (you need a `./configure`), and it is already
documented well in the main README.

Also adds a reference to the books that this also generates.
2015-09-26 12:05:47 -07:00
Xavier Shay
3885a81e5f Add an example of constructing a unit-like struct.
This was non-obvious to me: with no example, I assumed `Electron {}` and
didn't know what else to try when it didn't work.  The correct form is
weird because it looks like you're assigning the struct name rather than
an instance of the struct.
2015-09-26 11:59:02 -07:00
David Elliott
ded2370a74 clarify that find returns first match
the example for `find` was misleading in that it fails to mention the result is either `None` or `Some` containing only the first match. Further confusing the issue is the `println!` statement, "We got some numbers!"
2015-09-26 10:36:37 -07:00
DenisKolodin
0f491bee69 Typo fix in use declaration section of reference 2015-09-26 12:16:55 +03:00
bors
78ce46ffdd Auto merge of #28612 - gandro:targetvendor, r=alexcrichton
This adds a new target property, `target_vendor`. It is to be be used as a matcher for conditional compilation. The vendor is part of the [autoconf target triple](http://llvm.org/docs/doxygen/html/classllvm_1_1Triple.html#details): `<arch><sub>-<vendor>-<os>-<env>`. `arch`, `target_os` and `target_env` are already supported by Rust.

This change was suggested in PR #28593. It enables conditional compilation based on the vendor. This is needed for the rumprun target, which needs to match against both, target_os and target_vendor.

The default value for `target_vendor` is "unknown", "apple" and "pc" are other common values.

Matching against the `target_vendor` is introduced behind the feature gate `#![feature(cfg_target_vendor)]`.

This is the first time I messed around with rustc internals. I just added the my code where I found the existing `target_*` variables, hopefully I haven't missed anything. Please review with care. :)

r? @alexcrichton
2015-09-26 00:14:39 +00:00
Steve Klabnik
f4dc6c785c Rollup merge of #28655 - alfiedotwtf:patch-2, r=sanxiyn 2015-09-25 13:33:33 -06:00
Steve Klabnik
aed73e0122 Rollup merge of #28588 - critiqjo:trpl-closure, r=steveklabnik
r? @steveklabnik
2015-09-25 13:33:31 -06:00
Alfie John
29048c3a80 Keep examples consistent 2015-09-25 12:02:21 +00:00
critiqjo
09d4deef5b trpl: Refactor returning closures section 2015-09-25 00:17:54 +05:30
Steve Klabnik
c3ca182082 Rollup merge of #28622 - tshepang:known-as-structs, r=steveklabnik 2015-09-24 10:26:37 -06:00
Steve Klabnik
e314ac601a Rollup merge of #28620 - tshepang:not-filled, r=steveklabnik 2015-09-24 10:26:37 -06:00
Steve Klabnik
c104ba3755 Rollup merge of #28619 - tshepang:fix-link, r=steveklabnik 2015-09-24 10:26:37 -06:00
Steve Klabnik
668ffb1dd8 Rollup merge of #28618 - tshepang:repetition, r=steveklabnik 2015-09-24 10:26:36 -06:00
Steve Klabnik
c16b0f7060 Rollup merge of #28617 - tshepang:optional, r=steveklabnik 2015-09-24 10:26:36 -06:00
Tshepang Lekhonkhobe
0b13ee0ced reference: rename "structure" to the more familiar "struct" 2015-09-24 08:42:39 +02:00
Tshepang Lekhonkhobe
f34eafdcf9 reference: follow idiom in code snippet 2015-09-24 08:25:43 +02:00
Tshepang Lekhonkhobe
996bd9d0d6 reference: 3 of the 4 things mentioned here are optional 2015-09-24 08:22:58 +02:00
Tshepang Lekhonkhobe
7077075372 doc: "familiarity" does not need to be repeated here 2015-09-24 08:04:55 +02:00
Tshepang Lekhonkhobe
e0f35da9c1 reference: fix anchor link 2015-09-24 07:55:59 +02:00
Tshepang Lekhonkhobe
5f73037b8a reference: not sure this is the right place to discuss design 2015-09-24 07:50:44 +02:00
Tshepang Lekhonkhobe
16244b884d reference: make that less awkward to read 2015-09-24 07:43:37 +02:00
Tshepang Lekhonkhobe
64cc19d520 reference: "ffi" is normally in upper case 2015-09-24 07:27:16 +02:00
Sebastian Wicki
af68cdfea1 rustc: Add target_vendor for target triples
This adds a new target property, `target_vendor` which can be used as a
matcher for conditional compilation. The vendor is part of the autoconf
target triple: <arch><sub>-<vendor>-<os>-<env>

The default value for `target_vendor` is "unknown".

Matching against the `target_vendor` with `#[cfg]` is currently feature
gated as `cfg_target_vendor`.
2015-09-24 01:44:55 +02:00
Reza Akhavan
6de473addd Update error-handling.md 2015-09-21 21:33:15 -07:00
bors
c06f464d01 Auto merge of #28563 - baskerville:trpl-typo, r=bluss 2015-09-21 12:24:52 +00:00
Bastien Dejean
5b41488f3a TRPL: Fix typo 2015-09-21 12:37:58 +02:00
bors
f859507de8 Auto merge of #28548 - steveklabnik:gh28545, r=alexcrichton
so say so in the FAQ

Fixes #28545
2015-09-21 06:07:03 +00:00
bors
0418a43fa3 Auto merge of #28541 - baskerville:trpl-two-typos, r=steveklabnik
r? @steveklabnik
2015-09-21 00:58:03 +00:00
Steve Klabnik
8355d3a60f We are production ready
so say so in the FAQ

Fixes #28545
2015-09-20 15:53:47 -04:00
Bastien Dejean
856f97a15e TRPL: Fix two typos 2015-09-20 19:13:43 +02:00
bors
f5a64a678f Auto merge of #28499 - semmaz:doc-anchor-fix, r=steveklabnik
This changes how rustic generate `id` and `href` attributes for section header anchor. Now they are more github-like.

Also fixes breakage in docs caused by this and broken links in "Error Handling" section of book.

r? @steveklabnik
cc @alexcrichton
2015-09-20 16:21:43 +00:00
Simon Mazur
970b86b1bb doc: Fix broken links 2015-09-20 13:24:47 +03:00
Manish Goregaokar
8f8fe8194d Rollup merge of #28525 - Wallacoloo:book-4.8-double-more, r=steveklabnik
This is a simple grammar fix in which the previous author accidentally repeated a word when (s)he shouldn't have.
2015-09-20 11:16:27 +05:30
Manish Goregaokar
d007eb628a Rollup merge of #28463 - critiqjo:book-concurrency, r=steveklabnik
Fixes #28458

Details about `Arc` may be too soon to be described together with `Sync`... Tell me what you think.

r? @steveklabnik
2015-09-20 11:16:26 +05:30
Colin Wallace
a35f1b29d7 Fix "more more" typo 2015-09-19 17:19:29 -07:00
critiqjo
a0f214e257 trpl: Improve clarity in Concurrency 2015-09-19 21:11:17 +05:30
Steve Klabnik
b2c7e7791a Rollup merge of #28496 - davidszotten:fix_error_anchors, r=steveklabnik 2015-09-19 11:15:48 -04:00
Steve Klabnik
d557f4a60f Rollup merge of #28485 - Wallacoloo:clarify-let-lhs, r=alexcrichton
In code like `let x = 5`, I am initially confused as to the meaning of "let doesn't take a name on the left hand side, it actually accepts a pattern." - I interpret that as the pattern being located as: `<pattern> let [...]`.

I think what is meant is that the name/pattern is on the left hand side *of the assignment*, rather than to the left of the *let* statement. This change clarifies that.
2015-09-19 11:15:48 -04:00
David Szotten
5ab3058569 change back to anchors; divs break md 2015-09-19 12:06:36 +01:00
David Szotten
f7d8b41814 missing punctuation 2015-09-19 11:45:30 +01:00
David Szotten
436e8d69bf its vs it's 2015-09-19 11:45:09 +01:00
David Szotten
3a5e9a3f99 wrap more referenced code blocks in divs 2015-09-19 11:44:55 +01:00
David Szotten
30c91cd7f7 angle brackets get mis-parsed. bug? 2015-09-19 11:43:57 +01:00
David Szotten
4e42fcd92a link needs puncuation 2015-09-19 11:43:32 +01:00
David Szotten
634ffe5624 remove preceeding blank line 2015-09-18 22:16:31 +01:00
David Szotten
9d3deb4766 fix anchor link 2015-09-18 22:12:16 +01:00
bors
dc1c7975b0 Auto merge of #28336 - petrochenkov:empstr, r=pnkfelix
Closes https://github.com/rust-lang/rust/issues/24266
Closes https://github.com/rust-lang/rust/issues/16819
2015-09-18 16:57:21 +00:00
Ms2ger
1a3b422207 Use divs with ids rather than as with names.
The id attribute has been an official part of HTML since 1997. There is no
reason not to use it.
2015-09-18 15:52:19 +02:00
Vadim Petrochenkov
1eb42f1c78 Add feature gate 2015-09-18 15:28:01 +03:00
Vadim Petrochenkov
605a472948 Add some more tests 2015-09-18 15:26:09 +03:00
Colin Wallace
cbc9517b02 Clarify where let accepts a pattern, spatially 2015-09-17 21:39:19 -07:00
Steve Klabnik
7a5cd3c274 Rollup merge of #28473 - tshepang:lowercase, r=steveklabnik 2015-09-17 17:06:56 -04:00
Steve Klabnik
cd5870f3a3 Rollup merge of #28471 - tshepang:markup, r=steveklabnik 2015-09-17 17:06:56 -04:00
Steve Klabnik
fcfcee1363 Rollup merge of #28470 - tshepang:idiom, r=steveklabnik 2015-09-17 17:06:56 -04:00
Steve Klabnik
36190ef91d Rollup merge of #28466 - baskerville:trpl-heap-highest-addr, r=steveklabnik
r? @steveklabnik
2015-09-17 17:06:55 -04:00
Steve Klabnik
cc664f1f44 Rollup merge of #28451 - dagnir:osx-req-wording, r=steveklabnik
Using "later" in this context makes more sense than "greater" so it's been changed to match the Linux requirement above it rather than the other way around.
2015-09-17 17:06:55 -04:00
Steve Klabnik
40c45ac86a Rollup merge of #28422 - christopherdumas:label_code, r=steveklabnik 2015-09-17 17:06:54 -04:00
Steve Klabnik
54063e330a Rollup merge of #28276 - jackwilsonv:patch-5, r=Manishearth 2015-09-17 17:06:54 -04:00
Tshepang Lekhonkhobe
a3305f87c1 reference: actual keywords feel more appropriate 2015-09-17 22:55:40 +02:00
Tshepang Lekhonkhobe
22fc5f480d reference: mark that up to make it more clear it is a keyword 2015-09-17 22:52:39 +02:00
Tshepang Lekhonkhobe
553a2f1ead doc: follow idiom in code snippet 2015-09-17 22:13:05 +02:00
Bastien Dejean
6d2cb6c688 trpl: Fix off-by-one highest memory address 2015-09-17 18:53:01 +02:00
Dongie Agnir
dfe88c09b8 Change OSX version req wording to match Linux. 2015-09-16 18:56:56 -04:00
christopherdumas
e66a1dcde9 Fixe heading 2015-09-15 10:37:52 -07:00
christopherdumas
0b7e048378 Fix option link and anchor links. 2015-09-15 10:37:02 -07:00
christopherdumas
b69a51164d Added anchors for the code snippets. 2015-09-15 10:34:57 -07:00
christopherdumas
320880eed5 Fix option link and anchor links. 2015-09-15 10:34:57 -07:00
Aidan Hobson Sayers
1a6bdba05e Update musl build in light of llvm 3.7 release 2015-09-13 14:57:54 +01:00
bors
4d20369998 Auto merge of #28371 - killercup:docs/trpl-markup-fixes, r=steveklabnik
- Headlines begin at 1st level now like the rest of the book
- All Headlines a blank line above and below
- Fix links in this chapter's TOC

r? @steveklabnik
2015-09-12 16:31:10 +00:00
Pascal Hertleif
4828c88af6 Nomicon: Fix Links
The style `[name][]` does not work with Pandoc, whereas `[name]` does.
I hope hoedown accepts this as well.
2015-09-12 12:13:24 +02:00
Pascal Hertleif
39f97cfcf8 TRPL: Fix Headlines, Links in "Error Handling"
- Headlines begin at 1st level now like the rest of the book
- All Headlines a blank line above and below
- Fix links in this chapter's TOC
2015-09-12 12:09:59 +02:00
bors
c8ded9a14f Auto merge of #28306 - alexcrichton:less-rt, r=brson
This commit does some refactoring to make almost all of the `std::rt` private.
Specifically, the following items are no longer part of its API:

* DEFAULT_ERROR_CODE
* backtrace
* unwind
* args
* at_exit
* cleanup
* heap (this is just alloc::heap)
* min_stack
* util

The module is now tagged as `#[doc(hidden)]` as the only purpose it's serve is
an entry point for the `panic!` macro via the `begin_unwind` and
`begin_unwind_fmt` reexports.
2015-09-11 19:42:19 +00:00
Alex Crichton
f4be2026df std: Internalize almost all of std::rt
This commit does some refactoring to make almost all of the `std::rt` private.
Specifically, the following items are no longer part of its API:

* DEFAULT_ERROR_CODE
* backtrace
* unwind
* args
* at_exit
* cleanup
* heap (this is just alloc::heap)
* min_stack
* util

The module is now tagged as `#[doc(hidden)]` as the only purpose it's serve is
an entry point for the `panic!` macro via the `begin_unwind` and
`begin_unwind_fmt` reexports.
2015-09-11 11:19:20 -07:00
bors
eda85fede0 Auto merge of #28348 - petrochenkov:novirt, r=alexcrichton
Noticed these yesterday while reading libsyntax
2015-09-11 17:58:59 +00:00
Vadim Petrochenkov
9f1f4c16aa Remove some remains of virtual structs from the parser 2015-09-11 10:09:22 +03:00
bors
01024c9f61 Auto merge of #28328 - tshepang:unusual, r=brson 2015-09-11 06:28:17 +00:00
bors
98eeded587 Auto merge of #28301 - christopherdumas:intergrate_error_burnstushi, r=steveklabnik
This was @steveklabnik's idea. Thanks @BurntSushi for the awesome blog post!
r? @steveklabnik
2015-09-10 20:03:30 +00:00
christopherdumas
e18122682b Adapted @BurtSushi's blog post for the error handling chapter, rewrite the case study. 2015-09-10 09:48:04 -07:00
bors
9577e42682 Auto merge of #28329 - tshepang:comfort, r=steveklabnik 2015-09-10 13:44:48 +00:00
bors
5f9f0b7cc3 Auto merge of #28266 - jackwilsonv:patch-4, r=steveklabnik
r? @steveklabnik
2015-09-10 07:39:50 +00:00
Tshepang Lekhonkhobe
c5a76c692b reference: not comfortable seeing a paragraph starting with a lowercase letter 2015-09-10 06:03:32 +02:00
bors
e3fd444dc9 Auto merge of #28323 - tshepang:idiom, r=steveklabnik 2015-09-10 03:48:30 +00:00
Tshepang Lekhonkhobe
dc6c11816c reference: using periods here is unusual 2015-09-10 05:48:08 +02:00
bors
c48b8f17a0 Auto merge of #28232 - brson:tprl, r=steveklabnik
r? @steveklabnik 

The phrase 'academic research' rubs me the wrong way. I have some concern about the role of this page and think it could be expanded to more than just academic papers and cleaned up a lot.
2015-09-10 00:37:55 +00:00
bors
3cda3c96e3 Auto merge of #28250 - durka:patch-7, r=steveklabnik
I took a stab at fixing #28064. Not sure if this all-features-in-one-example approach is the right one. Also I completely made up the terms "star globbing" and "brace expansion globbing" -- they are just called "glob-like syntax" in the reference.
2015-09-09 22:41:23 +00:00
Tshepang Lekhonkhobe
3860f974a7 reference: format code snippets in an idiomatic manner 2015-09-09 22:35:49 +02:00
bors
5d9dc1d7a1 Auto merge of #28313 - rutsky:patch-4, r=alexcrichton
Follow-up fix for PR #28283.
2015-09-09 16:44:43 +00:00
Manish Goregaokar
ee00780b98 Rollup merge of #28295 - steveklabnik:language_fix, r=alexcrichton
Thanks Eric, reported via email
2015-09-09 18:36:11 +05:30
Manish Goregaokar
b33b121e95 Rollup merge of #28294 - midinastasurazz:patch-3, r=steveklabnik
The link address is defined below the paragraph so no need to have it inline.
2015-09-09 18:36:11 +05:30
Manish Goregaokar
4fc09d3a15 Rollup merge of #28283 - rutsky:patch-3, r=steveklabnik
r? @steveklabnik
2015-09-09 18:36:11 +05:30
Manish Goregaokar
eb2e00a0fd Rollup merge of #28281 - rutsky:patch-2, r=steveklabnik
r? @steveklabnik
2015-09-09 18:36:10 +05:30
Vladimir Rutsky
a1758aea18 fix capitalization inside sentense 2015-09-09 12:54:31 +03:00
Steve Klabnik
ca1a81df23 Fix small sentence about references
Thanks Eric, reported via email
2015-09-08 09:33:53 -04:00
midinastasurazz
3e8038bcab Fix link to hygienic macros on Wikipedia 2015-09-08 14:06:35 +02:00
Vladimir Rutsky
b5b94037c4 fix punctuation in list (again) 2015-09-07 11:03:53 +03:00
Vladimir Rutsky
b1e8007999 fix capitalization inside sentense 2015-09-07 11:01:01 +03:00
Vladimir Rutsky
0d5cae2d45 fix punctuation in list
r? @steveklabnik
2015-09-07 09:41:02 +03:00
Jack Wilson
5c5cca58f7 Small syntax and formatting changes 2015-09-06 16:23:44 -07:00
Hunan Rostomyan
b4afa8e2e5 Fix a typo 2015-09-06 14:38:12 -07:00
bors
01b9cc58ba Auto merge of #28269 - petrochenkov:docorder, r=steveklabnik
This is what I was talking about in https://github.com/rust-lang/rust/pull/26462#issuecomment-113883744

r? @steveklabnik
2015-09-06 19:43:06 +00:00
bors
a269e31a30 Auto merge of #28265 - boblehest:master, r=bluss
In the last code snippet on the following page there is a bug in the
implementation of Vec::drain().

https://doc.rust-lang.org/nightly/nomicon/vec-drain.html

```rust
pub fn drain(&mut self) -> Drain<T> {
    // Oops, setting it to 0 while we still need the old value!
    self.len = 0;

    unsafe {
        Drain {
            // len is used to create a &[T] from &self here,
            // so we end up always creating an empty slice.
            iter: RawValIter::new(&self),
            vec: PhantomData,
        }
    }
}
```

A simple test to verify that Drain is broken can be found here:
https://play.rust-lang.org/?gist=30f579565e4bbf4836ce&version=nightly

And here's one with a fixed implementation:
https://play.rust-lang.org/?gist=2ec0c1a6dcf5defd7a53&version=nightly
2015-09-06 17:55:04 +00:00
Jørn Lode
97dd25094c Rustonomicon: Reword potentially confusing comment in Vec::drain. 2015-09-06 18:21:57 +02:00
Vadim Petrochenkov
c34f350664 Further tweaks to doc/index.md 2015-09-06 16:07:55 +03:00
Vadim Petrochenkov
201bfbe55e Reorder sections in doc/index.md 2015-09-06 15:25:01 +03:00
Jack Wilson
3ccc253dae Small formatting/syntax tweaks 2015-09-05 19:54:52 -07:00
Jørn Lode
c08deef982 Rustonomicon: Fix bug in implementation of Vec::drain()
In the last code snippet on the following page there is a bug in the
implementation of Vec::drain().

https://doc.rust-lang.org/nightly/nomicon/vec-drain.html

```rust
pub fn drain(&mut self) -> Drain<T> {
    // Oops, setting it to 0 while we still need the old value!
    self.len = 0;

    unsafe {
        Drain {
            // len is used to create a &[T] from &self here,
            // so we end up always creating an empty slice.
            iter: RawValIter::new(&self),
            vec: PhantomData,
        }
    }
}
```

A simple test to verify that Drain is broken can be found here:
https://play.rust-lang.org/?gist=30f579565e4bbf4836ce&version=nightly

And here's one with a fixed implementation:
https://play.rust-lang.org/?gist=2ec0c1a6dcf5defd7a53&version=nightly
2015-09-06 03:44:13 +02:00
bors
f84d53ca0a Auto merge of #28259 - christopherdumas:fix_empty_link, r=Manishearth 2015-09-06 01:01:38 +00:00
Alex Burka
a506b7c532 mention dash-to-underscore behavior 2015-09-05 16:42:46 -04:00
christopherdumas
3fa1ee4677 Added link for hygenic macro system in macros.md 2015-09-05 06:04:15 -07:00
Manish Goregaokar
3610c731f3 Rollup merge of #28225 - jackwilsonv:patch-3, r=steveklabnik
r? @steveklabnik
2015-09-05 16:16:01 +05:30
Alex Burka
2cebf3666a document advance extern crate/use syntax
I took a stab at fixing #28064. Not sure if this all-features-in-one-example approach is the right one. Also I completely made up the terms "star globbing" and "brace expansion globbing" -- they are just called "glob-like syntax" in the reference.
2015-09-05 03:08:53 +00:00
Brian Anderson
2218b594bc trpl: Rename 'academic research' to 'bibliography'. Add some new links. 2015-09-04 09:37:15 -07:00
Jack Wilson
f44fbf08f9 Capitalize circle reference 2015-09-03 20:51:08 -07:00
Jack Wilson
2548e2ee58 Fixes minor formatting inconsistencies 2015-09-03 20:48:26 -07:00
Steve Klabnik
6c9549dd20 Rollup merge of #28216 - christopherdumas:fix_28196, r=steveklabnik
This is a docs change suggested in #28196.
r? @steveklabnik
2015-09-03 20:10:10 -04:00
Steve Klabnik
79ea0eed5b Rollup merge of #28215 - matklad:grammar-extern-block-item, r=steveklabnik
extern_block should be extern_block_item.

extern_block_item is `extern { bunch of fns }`, extern_block is just `bunch of fns`

r? @steveklabnik
2015-09-03 20:10:09 -04:00
Steve Klabnik
fd10ded4ea Rollup merge of #28214 - tshepang:word-not-name, r=steveklabnik
Also, add missing comma
2015-09-03 20:10:09 -04:00
Steve Klabnik
ce20719717 Rollup merge of #28213 - tshepang:replace-comma, r=steveklabnik 2015-09-03 20:10:09 -04:00
Steve Klabnik
5b8241cea9 Rollup merge of #28212 - tshepang:rust-is-a-language, r=steveklabnik 2015-09-03 20:10:09 -04:00
Steve Klabnik
e903d9c9b9 Rollup merge of #28210 - tshepang:typo, r=steveklabnik 2015-09-03 20:10:08 -04:00
Steve Klabnik
ff7f5cd0c6 Rollup merge of #28208 - matklad:grammar-whitespace-cleanup, r=steveklabnik 2015-09-03 20:10:08 -04:00
Steve Klabnik
a10e87648f Rollup merge of #28207 - tshepang:flow, r=steveklabnik 2015-09-03 20:10:08 -04:00
Steve Klabnik
54279e0ced Rollup merge of #28205 - matklad:grammar-remove-proc, r=alexcrichton
As I understand, there are no proc closures in Rust any more. So this pr removes `procedure_type` production. It isn't used anywhere. The `proc` is still a keyword.

r? @steveklabnik
@bors: r+ rollup
2015-09-03 20:10:07 -04:00
Steve Klabnik
35019737cc Rollup merge of #28204 - matklad:grammar-duplicate-else-tail, r=steveklabnik
The rule `else_tail` was duplicated in `if` and `if_let` sections. I guess that this is a mistake.

r? @steveklabnik
2015-09-03 20:10:07 -04:00
Steve Klabnik
723ebc2471 Rollup merge of #28203 - benschulz:book-deref-coercion, r=brson
I have two issues with the section "Deref and method calls" of the book's chapter "Deref coercions".

 - (Minor) It says "In other words, these are the same two things in Rust:", followed by a code block in which no two things seem similar, much less the same. Presumably this sentence made more sense in a previous revision.

 - The next paragraph conflates two concepts which, imho, should kept separate. They are
    - deref coercion, i.e. inserting as many `*` as necessary and
    - implicitly referencing the receiver, i.e. inserting a single `&` to satisfy the method's `self` parameter type.

I appreciate that with the proposed changes the example becomes very contrived, even for a foo-bar-baz one. However, the current exmplanation is just wrong.
2015-09-03 20:10:07 -04:00
Steve Klabnik
b96618e18b Rollup merge of #28202 - matklad:grammar-loop-labels, r=steveklabnik
This adds missing `?` marks to productions for loops and break/continue.

It also adds missing option label to while let loop.


Note that '[' foo ']' means grouping in BNF, and '?' is used for possible missing items.

r? @steveklabnik
2015-09-03 20:10:07 -04:00
christopherdumas
17fde3a34d Removed incorrect reference from #28196 2015-09-03 14:39:34 -07:00
Aleksey Kladov
73a6199248 reference grammar: fix item definition
extern_block should extern_block_item
2015-09-04 00:29:47 +03:00
Aleksey Kladov
f7d5c25b3d reference grammar: whitespace cleanup 2015-09-03 23:42:33 +03:00
Tshepang Lekhonkhobe
6cdba4f766 book: it is RwLock, not RWLock 2015-09-03 22:14:28 +02:00
Manish Goregaokar
67616f7191 Rollup merge of #28186 - thomas07vt:thomas07vt-patch-trpl-rust-inside-other-languages.md, r=steveklabnik
The embed rust file that we compile prints out 'Thread finished..' messages along with a 'done!' r? @steveklabnik
2015-09-04 01:40:02 +05:30
Manish Goregaokar
0c2924386d Rollup merge of #28184 - xiaochuanyu:patch-1, r=alexcrichton
Originally in an example it reads as follows:
```rust
fn inverse<T>() -> T
        // this is using ConvertTo as if it were "ConvertFrom<i32>"
         where i32: ConvertTo<T> {
     42.convert()
 }
```
There was no mention of `ConvertFrom` elsewhere in the page other than in this comment. Is this supposed to be `ConvertTo<i64>` ?
I'm confused by this example.
2015-09-04 01:40:01 +05:30
Tshepang Lekhonkhobe
23956ae1f4 book: improve flow 2015-09-03 21:54:00 +02:00
Tshepang Lekhonkhobe
197cec6ed9 book: Rust is a language, so no need to mention that fact here 2015-09-03 21:40:19 +02:00
Aleksey Kladov
59f2343bdb reference grammar: remove procedure_type 2015-09-03 22:25:47 +03:00
Aleksey Kladov
000fe00726 reference grammar: remove duplicate else_tail rule 2015-09-03 22:19:56 +03:00
benshu
986f523b89 Take method invocation semantics out of chapter on deref coercion. 2015-09-03 21:17:59 +02:00
Tshepang Lekhonkhobe
3525a13fea book: "word" feels more suitable than "name"
Also, add missing comma
2015-09-03 21:14:03 +02:00
Aleksey Kladov
83aee74fce reference grammar: loop label should be optional
This adds missing `?` marks to productions for loops and break/continue.

It also adds missing option label to while let loop
2015-09-03 22:13:50 +03:00