Commit Graph

2615 Commits

Author SHA1 Message Date
Steve Klabnik
c2a5d31f30 Rollup merge of #25866 - jooert:update_guidelines, r=steveklabnik
So that rust-guidelines can be deleted and src/doc/style can prosper as the official home of the rust guidelines. 😃
2015-05-29 15:24:47 -04:00
Steve Klabnik
c7b1f37c59 Rollup merge of #25865 - azerupi:patch-2, r=alexcrichton
"workd" corrected to "world"
2015-05-29 15:24:46 -04:00
Steve Klabnik
5d2af1c724 Rollup merge of #25864 - azerupi:patch-1, r=alexcrichton
There was no opening parenthesis for this closing parenthesis...
2015-05-29 15:24:46 -04:00
Steve Klabnik
e9e2a11a6a Rollup merge of #25788 - maxjacobson:add-missing-space-to-glossary, r=steveklabnik
r? @steveklabnik
2015-05-29 15:24:46 -04:00
Nick Howell
81a413bb01 trpl: eight sections, not seven 2015-05-29 14:29:35 -04:00
Steve Klabnik
5e941877fe Add syntax for multiple lifetimes
Fixes #25417
2015-05-29 12:52:02 -04:00
Steve Klabnik
b218470b4d Make note about $ more prominent.
Fixes #25554
2015-05-29 12:20:32 -04:00
bors
2d447e40e2 Auto merge of #25857 - killercup:patch-14, r=steveklabnik
Thanks to @cers who reported this in killercup/trpl-ebook#14!

r? @steveklabnik
2015-05-29 14:53:59 +00:00
bors
3a433b968b Auto merge of #25854 - liigo:patch-1, r=alexcrichton 2015-05-29 11:46:08 +00:00
Nils Liberg
adac861db2 Fix link to newtypes page 2015-05-29 01:02:24 +02:00
Nils Liberg
d0744ba3e7 Fix mistake: "to to" -> "to" 2015-05-29 01:02:24 +02:00
David Campbell
31a007af19 remove extra space from "over" code as well 2015-05-29 01:02:24 +02:00
David Campbell
4d90b4d9b8 Update let.md -- follow whitespace style guideline
"Idiomatic code should not use extra whitespace in the middle of a line to provide alignment."
2015-05-29 01:02:24 +02:00
Corey Farwell
06706510cb Make adjancent code examples more similar 2015-05-29 01:02:24 +02:00
David Campbell
19cb2a7707 add newline before list in functions-and-methods
The current version of hoedown treats lists interrupting paragraphs in the Markdown.pl style rather than CommonMark, so a newline is needed for the list to be rendered properly.
2015-05-29 01:02:24 +02:00
Mathieu David
15aeea5477 Corrected typo
"workd" corrected to "world"
2015-05-29 00:43:39 +02:00
Mathieu David
15ab481322 removed lonely closing parenthesis
There was no opening parenthesis for this closing parenthesis...
2015-05-28 23:47:27 +02:00
bors
621a10e7f3 Auto merge of #25829 - steveklabnik:ioresult_fixes, r=alexcrichton
This is now std::io::Result
2015-05-28 17:34:30 +00:00
Steve Klabnik
16a47c2d91 remove references to IoResult
This is now std::io::Result
2015-05-28 12:51:01 -04:00
bors
9c303944a7 Auto merge of #25835 - steveklabnik:gh25438, r=alexcrichton
Fixes #25438
2015-05-28 15:29:15 +00:00
Pascal Hertleif
2a63cc7715 TRPL: Fix Unescaped URL 2015-05-28 16:18:26 +02:00
bors
4233cbda8a Auto merge of #25849 - reinh:patch-1, r=huonw
Thanks for the awesome book!

r? @steveklabnik
2015-05-28 11:24:38 +00:00
Liigo Zhuang
d061a0f8d5 floating-point types are machine types, not machine-dependent types 2015-05-28 18:11:32 +08:00
bors
4f66d881a5 Auto merge of #25843 - shepmaster:remove-public-int-and-uint, r=huonw 2015-05-28 09:20:49 +00:00
Rein Henrichs
23ec00751e TRPL: fix typo, borow for borrow 2015-05-27 22:35:46 -07:00
Jake Goulding
a959cc435f Remove mentions of int / uint from public documentation 2015-05-27 19:26:18 -04:00
Steve Klabnik
1cede0b0ef Fix section headers on Not Found page
Fixes #25794
2015-05-27 19:15:17 -04:00
Steve Klabnik
4db7e56b01 Small wording fix in TRPL: lifetimes
Fixes #25438
2015-05-27 15:02:42 -04:00
bors
e4c64a1499 Auto merge of #25713 - Stebalien:pattern, r=alexcrichton
Needed to support:

```rust
match X {
  pattern if Y ...
}

for pattern in Y {}
```

IMO, this shouldn't require an RFC because it can't interfere with any future language changes (because `pattern if` and `pattern in` are already legal in rust) and can't cause any ambiguity.
2015-05-27 00:42:55 +00:00
Max Jacobson
16334e508e Add a missing space to the Glossary page of TRPL
r? @steveklabnik
2015-05-25 22:40:07 -04:00
bors
cc156c2f38 Auto merge of #25771 - killercup:trpl/cleanup-markdown-links, r=steveklabnik
In all other places the IDs of link references are without spaces (and explicitly set).

These are just some cleanups I did for the PDF version.

r? @steveklabnik
2015-05-25 21:28:51 +00:00
bors
6770253c67 Auto merge of #25742 - thombles:tk/StringCoercion, r=steveklabnik
A few of us [over on the forum](https://users.rust-lang.org/t/string-type-coercion-in-rust/1439) have been tripped up by this distinction, which I don't think is mentioned. It's kind of logical if you read the "Deref coercions" page and squint a bit but I think it would be nice to explain it directly. Here's one way we could clarify it.
2015-05-25 18:18:11 +00:00
Pascal Hertleif
6bb56b4fa7 TRPL: Clean up some Markdown links
In all other places the IDs of link references are without spaces (and
explicitly set).
2015-05-25 15:10:50 +02:00
Thomas Karpiniec
2b3354cbf8 book: add no_run and use statement to strings no-coercion example 2015-05-25 18:38:17 +10:00
Alex Stokes
c7f92018ac Fix typo in diagram demonstrating stack vs. heap values 2015-05-24 15:18:43 -07:00
bors
820b1d8393 Auto merge of #25464 - zaeleus:trpl-riol, r=pnkfelix
r? @steveklabnik
2015-05-24 15:52:17 +00:00
Thomas Karpiniec
49597fcbf2 book: explanation that String -> &str coercion doesn't happen for &str traits 2015-05-24 13:54:05 +10:00
Oliver Schneider
962b132fe3 Rollup merge of #25715 - nero-luci:patch-1, r=steveklabnik
I consider that this version has a better reading fluency, instead of having a period between clauses
2015-05-23 19:03:19 +02:00
Oliver Schneider
691c75a54f Rollup merge of #25695 - mbrubeck:reference, r=brson
r? @steveklabnik
2015-05-23 19:03:18 +02:00
Oliver Schneider
0c74a73bd5 Rollup merge of #25681 - steveklabnik:gender, r=nmatsakis
Also, when checking for common gendered words elsewhere, I found one 'he', moved to 'they' as well.

https://github.com/rust-lang/rust/pull/25640#issuecomment-104304643
2015-05-23 19:03:18 +02:00
Cornel Punga
18dfa80985 Update guessing-game.md
I consider that this version has a better reading fluency, instead of having a period between clauses
2015-05-22 21:55:50 +03:00
Steven Allen
f21655ec02 Allow patterns to be followed by if and in.
Needed to support:

match X {
  pattern if Y ...
}

for pattern in Y {}
2015-05-22 12:47:52 -04:00
Matt Brubeck
54b1608b2d Document the debug_assertions cfg option 2015-05-21 16:34:26 -07:00
bors
c3d60aba6c Auto merge of #25669 - GuillaumeGomez:typo-fix, r=Manishearth
r? @steveklabnik
2015-05-21 19:41:18 +00:00
Guillaume Gomez
86a821e5d1 Replace "more later" by "later" 2015-05-21 20:30:15 +02:00
bors
7044f4a394 Auto merge of #25601 - ericye16:master, r=steveklabnik 2015-05-21 17:01:51 +00:00
Steve Klabnik
65ead717a7 she -> they in Dining Philosophers
Also, when checking for common gendered words elsewhere, I found one 'he', moved to 'they' as well.

https://github.com/rust-lang/rust/pull/25640#issuecomment-104304643
2015-05-21 11:53:45 -04:00
bors
59ba55ddbd Auto merge of #25473 - doomrobo:patch-3, r=steveklabnik
Added `Deref` to the "Special Traits" section
2015-05-21 15:24:16 +00:00
dmgawel
e30c6d131f Introduction vector example elements counting fix
Earlier created vector `["Hello", "world"]` has two elements and we try to add a third element.
2015-05-21 14:30:32 +02:00
Manish Goregaokar
06d343b691 Rollup merge of #25665 - OlegTsyba:fix_documentation, r=Gankro
fix a small typo in the official tutorial. "coerce" instead of "coerece"
r? @steveklabnik
2015-05-21 13:38:26 +05:30
Manish Goregaokar
1fb2102498 Rollup merge of #25661 - Stebalien:macro, r=Gankro
They don't have to be followed by anything.
2015-05-21 13:38:26 +05:30
OlegTsyba
c5c508621d Fix the typo in The Rust Programming Language book, 5.18. Strings 2015-05-21 01:40:23 +03:00
Steven Allen
74fadfaeea Change "must" to "may only" in macro future proofing rules.
They don't have to be followed by anything.
2015-05-20 17:19:57 -04:00
Iven Hsu
2ca3dfd4ac
trpl: Remove tailing semicolon of an inner attribute
The syntax with tailing semicolon is deprecated and the compiler will
complain about it.
2015-05-20 16:55:38 +08:00
Steve Klabnik
7f74212906 Rollup merge of #25607 - peferron:doc-macros-assert-fix, r=steveklabnik
"Truth passes, success `panic!`s" seems to be a typo. The closest fix would be something like "Success passes, failure `panic!`s" but to me a "comparison failure" suggests that we couldn't compare the two values at all, not that we could successfully compare them and that the result was non-equality. So I opted to rewrite the paragraph a bit. If there's a better alternative please let me know.

r? @steveklabnik
2015-05-19 18:38:54 -04:00
Steve Klabnik
1d961fde2d Rollup merge of #25604 - skeuomorf:docs-lifetime, r=steveklabnik
r? @steveklabnik
2015-05-19 18:38:53 -04:00
Erik Michaels-Ober
b748c2e90d Change default gender in the dining philosophers project
The paper from which this example was taken made the mistake of assuming
that all five philosophers are men. This is a hypothetical
example--there are no actual philosophers eating spaghetti--so there is
no good reason to make this assumption. Since women make up about half
of the human population, all things being equal, women should represent
about half of the philosophers. However, because this mistake has stood
since 1985, I have changed *all* of the pronouns to be female, to make
up for lost time. If someone would like to revert this patch or switch
to neutral pronouns after 30 years, feel free to set your alarm clock
for 2045.
2015-05-19 22:38:24 +02:00
peferron
afbe15d103 Fix description of assert! 2015-05-19 07:56:29 -07:00
Manish Goregaokar
b613ef552d Rollup merge of #25580 - killercup:trpl/unify-code-blocks, r=steveklabnik
This adds strictly more information to the source files and reduces the need for customized tooling to render the book. (While this should not change the output of _rustbook_, it is very useful when rendering the sources with external tools like Pandoc.)

This only adds the language marker to "first level" code blocks (and not to code blocks in comments inside of code examples).

r? @steveklabnik
2015-05-19 18:47:15 +05:30
Manish Goregaokar
02b79c4763 Rollup merge of #25575 - clatour:patch-2, r=steveklabnik
Looks like this was an issue in the source material. I've let the editor know and he has told me he is correcting it there as well.

r? @steveklabnik
2015-05-19 18:47:14 +05:30
Manish Goregaokar
392576b6d8 Rollup merge of #25512 - peferron:doc-traits-error-fix, r=alexcrichton
The source code snippet uses `"whatever".as_bytes()` but the compilation error message uses `b"whatever"`. Both should be consistent with each other.

r? @steveklabnik
2015-05-19 18:47:13 +05:30
Manish Goregaokar
fddd89319d Rollup merge of #25452 - jimblandy:master, r=steveklabnik
Minor tweak: the text explaining the Borrow trait talks about slices, but the example immediately following just uses a simple reference; there are no slices involved.

r? @steveklabnik
2015-05-19 18:47:13 +05:30
Mohammed Attia
aa570bce3e Fix lifetimes trpl typo 2015-05-19 14:38:54 +02:00
Eric Ye
4bc8853cea fix footnote link 2015-05-19 07:46:52 -04:00
Pascal Hertleif
f3adea5ce9 TRPL: Normalize rust Code Block Markers
`{rust,ignore}` -> `rust,ignore
2015-05-18 21:10:00 +02:00
Pascal Hertleif
6f69cd6387 TRPL: Add rust Marker to Some Code Block
This adds strictly more information to the source files and reduces the
need for customized tooling to render the book.

(While this should not change the output of _rustbook_, it is very
useful when rendering the sources with external tools like Pandoc.)
2015-05-18 20:56:00 +02:00
Michael Macias
5a1e6df07c trpl: Proofread "Rust Inside Other Languages" 2015-05-18 13:09:21 -05:00
clatour
83df71d6c5 trpl: Dining philosophers backstory typo
Minor typo/grammar error.
2015-05-18 11:41:59 -06:00
peferron
a10d243dd4 Use byte string literal syntax
The byte string literal syntax `b"whatever"` is more idiomatic than
`"whatever".as_bytes()`.
2015-05-17 21:19:12 -07:00
Manish Goregaokar
252027768e Rollup merge of #25530 - peferron:doc-closures-whitespace-fix, r=alexcrichton
Tiny fixes collected while reading through the Rust book. If they're too nitpicky please let me know and I'll ignore the next ones. :)

The spaces after the function and closure arguments might be intentional, but they do not make much sense: the usual formatting doesn't have such spaces, and they aren't helping align the three lines together either.

r? @steveklabnik (as suggested by [CONTRIBUTING.md](https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md))
2015-05-18 08:55:38 +05:30
Manish Goregaokar
6f2a069b9c Rollup merge of #25526 - chellmuth:patch-1, r=alexcrichton 2015-05-18 08:55:37 +05:30
peferron
82447cf500 Fix doc whitespace issues 2015-05-17 03:00:04 -07:00
Chris Hellmuth
09a473ea7b Fix typo in references-and-borrowing docs 2015-05-17 00:19:53 -07:00
Manish Goregaokar
1fd0a8455b Rollup merge of #25506 - Wilfred:master, r=alexcrichton
Newcomers to Rust need to learn the distinctinion between `&str` and
`String`, so additonally having `string` in an example risks confusion.
2015-05-17 11:55:39 +05:30
Manish Goregaokar
094d29cf09 Rollup merge of #25493 - coffeejunk:update_installed_rust_version, r=alexcrichton
Rust is out of beta 🎉 

r? @steveklabnik
2015-05-17 11:55:39 +05:30
Manish Goregaokar
b40fcf5b10 Rollup merge of #25490 - huachaohuang:patch-1, r=alexcrichton 2015-05-17 11:55:39 +05:30
Manish Goregaokar
4d3db38940 Rollup merge of #25484 - sumito3478:fix-deadlink-in-complement-lang-faq, r=alexcrichton
In "The Rust Language FAQ", some of the links to example projects/modules written in Rust are dead links. This PR updates them.
2015-05-17 11:55:38 +05:30
Manish Goregaokar
a25925a3d4 Rollup merge of #25472 - WillEngler:book-tiny-typo-fixes, r=alexcrichton
This PR fixes two little typos in the Dining Philosophers example.

Also, there are two style points that may have been oversights but may have been deliberate, so I'll just bring them up here:

1) In the last paragraph, you say

> You’ll notice we can introduce a new binding to `table` here, and it will shadow the old one. This is often used so that you don’t need to come up with two unique names.

You already said something similar to this in the Guessing Game, but maybe you intended for this example to be independent of that one.

2) In "Rust Inside Other Languages," you introduce the idea of the "global interpreter lock" and then refer to it as the GIL a few paragraphs later without explicitly stating that GIL == global interpreter lock. It's reasonable to expect readers to make the connection, but maybe that's not what you intended.

Excellent work on the examples! Congrats on 1.0!

r? @steveklabnik
2015-05-17 11:55:38 +05:30
peferron
55c8bacc3a Make error message consistent with source code
The source code uses `"whatever".as_bytes()`, not `b"whatever"`.
2015-05-16 17:01:25 -07:00
Wilfred Hughes
ba02739ad3 Avoid calling a variable 'string' when discussing strings.
Newcomers to Rust need to learn the distinctinion between `&str` and
`String`, so additonally having `string` in an example risks confusion.
2015-05-16 23:56:45 +01:00
bors
2da9efefca Auto merge of #25463 - jeremyschlatter:master, r=alexcrichton 2015-05-16 22:29:56 +00:00
Maximilian Haack
e095e3963e Update windows install links to 1.0
Fixes #25489
2015-05-16 19:18:52 +02:00
Maximilian Haack
76fa4f427b Update the shown installed rust version to 1.0
🎉 🎉 🎉
2015-05-16 17:20:07 +02:00
Huachao Huang
6e8e6a4b08 Update rust-inside-other-languages.md 2015-05-16 21:44:02 +08:00
sumito3478
f641bd8396 Fix deadlinks in complement-lang-faq.md 2015-05-16 18:06:22 +09:00
bors
0becf6aec7 Auto merge of #25453 - jimblandy:FQA-fiasco-link, r=alexcrichton
Fix the link to the "static initialization order fiasco" discussion in the C++ Frequently Questioned Answers.

At present the link points to a mail message summarizing the decision not to have resumable exceptions, but the FAQ means to refer to a discussion of the "static initialization order fiasco". I've made my best guess at what it meant to refer to.
2015-05-16 08:37:31 +00:00
bors
15c18e725c Auto merge of #25450 - dnaeon:docs, r=alexcrichton 2015-05-16 07:01:32 +00:00
bors
4ce08a5d70 Auto merge of #25440 - durka:patch-3, r=alexcrichton
The Traits chapter uses "adding methods to `int`" as an example of "something bad", but there is no such thing as `int` anymore, right? So I changed it to `i32`.
2015-05-16 02:11:11 +00:00
Michael Rosenberg
d3ac395dcc Update reference.md
Added `Deref` to the "Special Traits" section
2015-05-15 22:07:20 -04:00
Will Engler
d5394d00d1 Correct two small typos in the Dining Philosophers example. 2015-05-15 19:32:13 -06:00
Jeremy Schlatter
3709e8f92b Fix quotation mark in ruby example. 2015-05-15 16:08:15 -07:00
bors
daaf715539 Auto merge of #25432 - killercup:patch-12, r=steveklabnik
`[let]` was already defined in line 11. Pandoc shows a warning for this. I'm not sure if it's actually invalid Markdown.

r? @steveklabnik
2015-05-15 22:55:03 +00:00
bors
a9ea33fa30 Auto merge of #25437 - MazinZ1:master, r=alexcrichton
The download links of Windows installers on the Nightly Rust page are using beta builds instead of nightly builds, which caused some confusions when I was setting up my env. Probably it's better to use the links of nightly builds here.
2015-05-15 21:17:42 +00:00
Jim Blandy
0b04b17183 Make description of Borrow trait uses match the example. 2015-05-15 12:44:24 -07:00
Marin Atanasov Nikolov
92e44b0422 docs: Typo fix 2015-05-15 21:46:59 +03:00
Alex Burka
900f27dc7c trpl: change from "int" to "i32" in Traits
The Traits chapter uses "adding methods to `int`" as an example of "something bad", but there is no such thing as `int` anymore, right? So I changed it to `i32`.
2015-05-15 12:14:39 -04:00
Z1
26560e75b7 Fix download links of Nightly Windows installers
The download links of Windows installers on the Nightly Rust page are using beta builds instead of nightly builds, which caused some confusions when I was setting up my env. Probably it's better to use the links of nightly builds here.
2015-05-15 10:52:47 -04:00
bors
13a4b83c1a Auto merge of #25402 - parir:master, r=Manishearth
r? @steveklabnik
2015-05-15 13:35:49 +00:00
Pascal Hertleif
94be1153f1 TRPL: Fix Inline Code Typography 2015-05-15 14:42:58 +02:00
Pascal Hertleif
7d0ae692c9 TRPL: Remove Duplicate Reference
Pandoc shows a warning for this. I'm not sure if it's actually invalid Markdown.
2015-05-15 12:23:26 +02:00
parir
94ecc372b2 5 != 4
Closes #25430
2015-05-15 11:28:32 +02:00
Steve Klabnik
6df13d4d88 Rollup merge of #25420 - habnabit:master, r=steveklabnik
It seems to refer to something that used to exist, but got moved, and then not everything got cleaned up.
2015-05-14 20:30:44 -04:00
Steve Klabnik
5501f076c2 Rollup merge of #25418 - leunggamciu:patch-trpl, r=steveklabnik 2015-05-14 20:30:43 -04:00
Steve Klabnik
aa560115b0 Rollup merge of #25413 - killercup:patch-11, r=alexcrichton
r? @steveklabnik
2015-05-14 20:30:43 -04:00
Steve Klabnik
dd60abc697 Rollup merge of #25410 - durka:patch-2, r=steveklabnik 2015-05-14 20:30:42 -04:00
Steve Klabnik
765a55ed20 Rollup merge of #25408 - Nashenas88:rust-book-stack-and-heap-typo, r=steveklabnik
I fixed the typo of the value of e in the memory tables. It is a reference to d, and so it should contain the memory location of d. I also fixed the incorrectly formatted tables so they display properly in html pages.
2015-05-14 20:30:42 -04:00
Steve Klabnik
c3562110d0 Rollup merge of #25407 - durka:patch-1, r=alexcrichton 2015-05-14 20:30:42 -04:00
Steve Klabnik
0028f855e2 Rollup merge of #25405 - dreid:patch-3, r=nikomatsakis 2015-05-14 20:30:42 -04:00
Steve Klabnik
1f40cde836 Rollup merge of #25404 - dnaeon:doc-fixes, r=steveklabnik
This PR fixes a comment in the `while Loops` section of the Rust book with the correct type of a variable binding.
2015-05-14 20:30:41 -04:00
Aaron Gallagher
568f13ac70 Remove an almost-duplicated sentence.
It seems to refer to something that used to exist, but got moved, and
then not everything got cleaned up.
2015-05-14 17:04:00 -07:00
leunggamciu
82c7282bec trpl: Fix missing internal links 2015-05-15 06:25:01 +08:00
Pascal Hertleif
a1577db825 TRPL: Fix Internal Link 2015-05-14 21:24:09 +02:00
Alex Burka
c8b06891f0 trpl: punctuation fix in Patterns 2015-05-14 14:51:16 -04:00
Alex Burka
c147ac42ca trpl: fix link from Match to If Let 2015-05-14 14:43:50 -04:00
Alex Burka
66c0fe0d3d trpl: fix link from Enums to Traits 2015-05-14 14:35:46 -04:00
Alex Burka
dc6eb7839c trpl: fix link from Structs to Traits 2015-05-14 14:20:24 -04:00
Paul Faria
785cbe3ac9 I fixed the typo of the value of e in the memory tables. It is a reference to d, and so it should contain the memory location of d. I also fixed the incorrectly formatted tables. 2015-05-14 13:43:11 -04:00
Alex Burka
e2bb734ac1 trpl: punctuation fix 2015-05-14 12:20:33 -04:00
David Reid
acb5e02add Another thread->task fix. 2015-05-14 08:15:50 -07:00
Marin Atanasov Nikolov
b4e1ce56a3 trpl-docs: Specify correct type of variable binding 2015-05-14 17:38:22 +03:00
Manish Goregaokar
ff207b7a05 Rollup merge of #25397 - dreid:patch-2, r=alexcrichton 2015-05-14 19:33:09 +05:30
Manish Goregaokar
0cbef04817 Rollup merge of #25395 - dreid:patch-1, r=alexcrichton 2015-05-14 19:33:09 +05:30
parir
a499517328 Add some missing links. 2015-05-14 15:39:38 +02:00
parir
031ff41a41 Fix version numbers in the guessing game. 2015-05-14 15:30:32 +02:00
David Reid
f539c416a0 Fix automatic substitution of task->thread. 2015-05-13 20:41:03 -07:00
David Reid
71f7fb2b59 Fix table syntax. 2015-05-13 20:03:56 -07:00
Nick Hamann
809be9b7f4 Fix link to RFC 255 in Reference. 2015-05-13 19:07:19 -05:00
Steve Klabnik
87c903a95c Fix test failure in the reference 2015-05-13 17:53:57 -04:00
Steve Klabnik
a93c8b655f Rollup merge of #25382 - steveklabnik:typo_fix, r=alexcrichton
Thanks apdapreturns
2015-05-13 16:51:30 -04:00
Steve Klabnik
63f39a621b Rollup merge of #25379 - mpark:trpl, r=alexcrichton 2015-05-13 16:51:29 -04:00
Steve Klabnik
a96f09bf52 Rollup merge of #25376 - swaroopch:patch-2, r=steveklabnik
I don't recall reading about this `Debug` trait so far in the book. Please ignore this PR if I have missed that part.

r? @steveklabnik
2015-05-13 16:51:29 -04:00
Steve Klabnik
12c93aa278 Rollup merge of #25360 - steveklabnik:typo, r=alexcrichton
Thanks @quantheory!
2015-05-13 16:51:28 -04:00
Steve Klabnik
522ee203e0 Rollup merge of #25308 - nham:audit_ref_traits, r=alexcrichton
cc #16676
2015-05-13 16:51:28 -04:00
Steve Klabnik
22eb466dfd Fix typo
Thanks apdapreturns
2015-05-13 16:43:39 -04:00
Swaroop C H
f6e5369e53 trpl/error-handling - fix typo 2015-05-13 13:23:10 -07:00
Michael Park
ee57f28f49 TRPL: Fix a broken link to 'move semantics' 2015-05-13 11:41:25 -07:00
Swaroop C H
baef1327f4 Add link to Debug trait
I don't recall reading about this `Debug` trait so far in the book.
2015-05-13 09:49:11 -07:00
Steve Klabnik
4b5b9668e0 Fix a typo
Thanks @quantheory
2015-05-13 02:46:23 -04:00
Steve Klabnik
11f945cd00 Merge branch 'trpl_embedding' into rollup 2015-05-13 00:55:18 -04:00
Steve Klabnik
704fb9c2c9 Merge branch 'doc-fixes' of https://github.com/wheals/rust into rollup 2015-05-13 00:54:55 -04:00
Steve Klabnik
f26a2a6e89 Merge branch 'doc_release_channels' into rollup 2015-05-13 00:53:32 -04:00
Steve Klabnik
dd11c7f047 Rollup merge of #25348 - geofft:trpl-fix-enums, r=steveklabnik
The enums chapter at the moment is ... weird. The examples aren't about enums, they're about structs, and most of the chapter talks about how enums don't support comparison operators by default (which is also true of other compound data types.) I think there was a story here once, but some coherency got lost in refactoring.

There are two preliminary patches here, one to combine the struct and tuple-struct chapters, and one to document unit-like structs, because enum syntax is easier to explain once you have those three. The final patch moves the enum chapter after the struct chapter, and rewrites most of it to talk about enums usefully (including covering matches on enums).

r? @steveklabnik
2015-05-13 00:52:49 -04:00
Steve Klabnik
7964d4e512 Rollup merge of #25321 - steveklabnik:second_tutorial, r=alexcrichton
This is a little rough, and it needs squashed and section headers, but i'd like to get some eyes on it sooner rather than later.
2015-05-13 00:52:48 -04:00
Steve Klabnik
fe8a4e3dbf Rollup merge of #25317 - steveklabnik:trpl_drop, r=alexcrichton
r? @alexcrichton
2015-05-13 00:52:48 -04:00
Nick Hamann
b2f486feaf Improve wording for the "Trait objects" section of the reference. 2015-05-12 23:35:27 -05:00
Nick Hamann
857a12a01e Expand the "Traits" section of the reference. 2015-05-12 23:33:10 -05:00
Geoffrey Thomas
f59f41e04c trpl/match: Add an example for matching on enums 2015-05-12 20:21:21 -04:00
Geoffrey Thomas
8d50216e9d trpl/enums: Rewrite 2015-05-12 20:21:21 -04:00
Geoffrey Thomas
797d8e2869 trpl/structs: Document unit-like structs 2015-05-12 20:21:21 -04:00
Geoffrey Thomas
457aed7ca0 trpl: move tuple-structs.md into structs.md 2015-05-12 20:21:19 -04:00
Steve Klabnik
2ba61698cc TRPL: dining philosophers 2015-05-12 19:30:48 -04:00
Steve Klabnik
fc6372ea1f TRPL: Rust inside other languages 2015-05-12 18:26:03 -04:00
Steve Klabnik
9a3e98be1c TRPL: Drop 2015-05-12 15:10:44 -04:00
Steve Klabnik
0ad15bbc2b TRPL: release channels 2015-05-12 15:09:17 -04:00
Manish Goregaokar
25815655c0 Rollup merge of #25335 - nikomatsakis:updates-to-reference-manual, r=steveklabnik
I did a read through of the manual. This commit corrects various small points and expands some sections, while avoiding too much detail.

r? @steveklabnik
2015-05-12 22:57:54 +05:30
Manish Goregaokar
398148193b Rollup merge of #25331 - michaelsproul:err-idx-doc-link, r=Manishearth
At the moment, http://doc.rust-lang.org/error-index.html isn't linked to from anywhere (except Reddit). This should allow search engines to find error codes!

I also capitalised "The Standard Library" and neatened a few bits of grammar.

Also fixed: `#[main]` inside one of the error descriptions.
2015-05-12 22:57:53 +05:30
Manish Goregaokar
e216057dac Rollup merge of #25322 - frewsxcv:patch-23, r=steveklabnik
`if` can be a statement or also an expression.
2015-05-12 22:57:52 +05:30
Manish Goregaokar
e91d272fbb Rollup merge of #25221 - michal-czardybon:master, r=steveklabnik
I corrected some pretty obvious textual mistakes. One thing requires more attention - the paragraph at line 133 in Ownership. It was confusing, so I changed it, but I am no sure if this is what the author had in mind.
2015-05-12 22:57:52 +05:30
Manish Goregaokar
bea12a9998 Rollup merge of #25220 - brson:doc1, r=steveklabnik 2015-05-12 22:57:52 +05:30
Niko Matsakis
393a37ecbd Correct various small points, expand some sections, while avoiding
too much detail.
2015-05-12 12:02:39 -04:00
Shmuale Mark
a22b3270b8 book: typo fixes, wording improvements.
The text in iterators.md wasn't wrong, but it read awkwardly to my ear.
2015-05-12 11:58:07 -04:00
Steve Klabnik
e780fb270c TRPL: Borrow and AsRef
These two traits are commonly confused. As such, explain the difference.

Fixes #24163
2015-05-12 10:53:50 -04:00
Michael Sproul
6faa8d6793 Add a link to the error index to the main doc page.
I also capitalised "The Standard Library" and neatened a few bits of grammar.

Also fixed: `#[main]` inside one of the error descriptions.
2015-05-12 21:21:26 +10:00
Corey Farwell
d13f765be8 Make mention of if more generic
`if` can be a statement or also an expression.
2015-05-12 00:33:22 -04:00
Steve Klabnik
28b923c477 Rollup merge of #25314 - steveklabnik:static_to_associated, r=alexcrichton 2015-05-11 23:24:20 -04:00
Steve Klabnik
f3849431a9 Rollup merge of #25304 - oli-obk:patch-2, r=steveklabnik 2015-05-11 23:24:20 -04:00
Steve Klabnik
425455b18e Rollup merge of #25292 - steveklabnik:stack_and_heap, r=nikomatsakis
I think someday I'd like to make these drawings rather than text, but for now, this will have to be good enough.
2015-05-11 23:24:19 -04:00
Steve Klabnik
adf5b84394 Rollup merge of #25283 - steveklabnik:gh24999, r=alexcrichton
and remove references to the unit type, which no longer exists

Fixes #24999
2015-05-11 23:24:19 -04:00
Steve Klabnik
f8df5ea8a7 Rollup merge of #25282 - badboy:reference-macro-1, r=alexcrichton
As mentioned in https://github.com/rust-lang/rust/issues/16676#issuecomment-100676326 this makes it a little bit more correct.

I'm a bit unsure whether or not it should be explained that the transcriber can be wrapped in parentheses or curly braces if necessary.
2015-05-11 23:24:18 -04:00
Steve Klabnik
42240dccb6 static method -> associated function 2015-05-11 18:22:49 -04:00
Steve Klabnik
e66653bee5 TRPL: the stack and the heap 2015-05-11 16:18:12 -04:00
Steve Klabnik
dd7d0f5e9c Fix links in the referece
and remove references to the unit type, which no longer exists

Fixes #24999
2015-05-11 12:49:17 -04:00
Oliver Schneider
7dd7bea3ac trpl: item macros must be followed by a semicolon 2015-05-11 16:46:24 +02:00
Manish Goregaokar
2b0191e6d5 Rollup merge of #25297 - carols10cents:grammar-todos, r=steveklabnik
Hiiii, I've got another chunk of updates to the grammar documentation!  🌟 🌠 

Chipping away at #22445, still have some more to go. I'm learning so much!!!
2015-05-11 19:58:58 +05:30
Manish Goregaokar
dec422541b Rollup merge of #25291 - johannhof:let-expressions-example, r=steveklabnik
Maybe it's me, but I really needed an example to understand if let and refutable statements.
Playpen: http://is.gd/mjX3Gf

Let me know if the variable names are too, uh, culinary.
2015-05-11 19:58:57 +05:30
Manish Goregaokar
f2c2736cd8 Rollup merge of #25290 - bluss:docfixes, r=steveklabnik
Several Minor API / Reference Documentation Fixes

- Fix a few small errors in the reference.
- Fix paper cuts in the API docs.

Fixes #24882
Fixes #25233
Fixes #25250
2015-05-11 19:58:57 +05:30
Manish Goregaokar
8f01d8d7c2 Rollup merge of #25287 - petehunt:patch-2, r=steveklabnik 2015-05-11 19:58:57 +05:30
Manish Goregaokar
1b8f52bb69 Rollup merge of #25286 - johannhof:patch-1, r=steveklabnik
The reference was claiming all vectors all bounds-checked at run-time, when constant vectors are usually checked at compile-time.

For the changed example see http://is.gd/28ak9E

Also fixed a minor grammar issue.
2015-05-11 19:58:57 +05:30
Manish Goregaokar
b0b6db6cb3 Rollup merge of #25284 - petehunt:patch-1, r=steveklabnik
Noticed this while perusing the docs
2015-05-11 19:58:56 +05:30
bors
8004fc9fe0 Auto merge of #25277 - polachok:docfix, r=steveklabnik
r? @steveklabnik
2015-05-11 12:07:39 +00:00
Michał Czardybon
bff170786c Fixed one textual mistake and one casing error.
Corrected "Ownership":

- [`Variable bindings`] link was not processed properly.
- Changed the paragraph about move semantics with two vectors, because it was confusing.
- Removed "So it may not be as inefficient as it initially seems", because there is nothing that seems inefficient in copying pointers only.
- Other text corrections.

Fixed copied-and-pasted text mistakes.

Revised the paragraph about moving a vector (taking into account suggestions by echochamber).

Fixed markdown.

Fixes requested by steveklabnik.

Brought back a sentence about supposed inefficiency.
2015-05-11 09:02:25 +02:00
Carol Nichols
218d38fb94 Overwrite grammar sections with what was removed from the reference
Between ffc5f1c, when grammar.md was created by copying parts of the
reference, and 8cf2552, when all EBNF was removed from reference.md,
there were parts of the grammar that were updated in reference.md but
not grammar.md, and then they weren't copied over because they existed
already, but they were slightly out of date.

Example: the `path_item : ident | "self" ;` rule in Use declarations was
changed from "mod" to "self" in the reference in 195fd9a but wasn't
updated in the grammar.
2015-05-10 22:47:39 -04:00
Carol Nichols
53cd0bc772 Add literal semicolon to the grammar of view_item
Both external crate declarations and use declarations need to end with a
semicolon.
2015-05-10 22:47:39 -04:00
Carol Nichols
c3156a8ff4 Remove operator precedence section covered in the reference 2015-05-10 22:47:39 -04:00
Carol Nichols
e607d76564 Fill in more parts of the grammar for Expressions 2015-05-10 22:47:31 -04:00
Carol Nichols
ab913c881c Fill in grammar for Statements
Some of this text is duplicated in the reference (and belongs there) so
remove it. It says item grammar is the same, so point to that grammar
section.
2015-05-10 22:37:31 -04:00
Carol Nichols
a5c651cfdf Point to the use declaration section from the re-exporting section
The syntax for re-exporting privacy is covered in the use declaration
item.
2015-05-10 22:27:10 -04:00
Carol Nichols
c9c8ff1762 Add visibility section of the grammar
Namely an optional "pub" before any item. The "pub" in the Use
declaration section should use this too.
2015-05-10 22:26:45 -04:00
Ulrik Sverdrup
12d50b2da0 docs: Fixes in Reference Chapter 6.1 2015-05-11 03:41:54 +02:00
Johann
6a19046423 Four spaces indent, rephrasing 2015-05-11 02:40:02 +02:00
Johann Hofmann
770f0e95a1 Add if let expressions example 2015-05-11 02:03:37 +02:00
Johann Hofmann
295b62dfb9 Docs: Compile-time bounds check in index expression
The reference was claiming all vectors all bounds-checked at run-time, when constant vectors are usually checked at compile-time.

For the changed example see http://is.gd/28ak9E
2015-05-11 01:22:57 +02:00
Pete Hunt
a168a15008 Fix typo in references-and-borrowing docs 2015-05-10 16:10:02 -07:00
Pete Hunt
6d410132dc Fix typo in guessing-game docs 2015-05-10 15:11:40 -07:00
Jan-Erik Rediger
f11c4ba30c Remove extra parentheses 2015-05-10 23:22:00 +02:00
Steve Klabnik
c70458ba5d Rollup merge of #25263 - fhinkel:master, r=steveklabnik 2015-05-10 16:44:24 -04:00
Steve Klabnik
7ae332c39f Rollup merge of #25257 - dpetersen:mutability-docfix, r=steveklabnik
I think there's a trivial missing word in the Mutability document. I reformatted the resulting paragraph in vim, which seems to match what the rest of the document is doing as far as word wrapping.

Edit: I found another minor thing as I continued reading.

P.S. I'm re-reading the docs, since so much has changed since my first read, and they've gotten even better! Nice job!

r? @steveklabnik
2015-05-10 16:44:23 -04:00
Steve Klabnik
fa207fafc6 Rollup merge of #25239 - sindreij:patch-1, r=alexcrichton 2015-05-10 16:44:22 -04:00
Steve Klabnik
ba8eb58257 Rollup merge of #25222 - GuillaumeGomez:doc-ref, r=steveklabnik
r? @steveklabnik
2015-05-10 16:44:22 -04:00
Steve Klabnik
a7253780b2 Rollup merge of #25188 - tincann:patch-1, r=steveklabnik 2015-05-10 16:44:22 -04:00