Daniel Keep
a34274c8ea
trpl: additions & fixes for syntax index.
...
* `const`: Add reference to raw pointers
* Change `expr!(...)` etc. examples to use `ident` instead.
*Technically*, it should be `pat`, but that's not how it works in
practice.
* `|`: add reference to closure syntax.
* Closure syntax entry.
* Indexing and slicing entries.
2015-12-01 19:39:52 +11:00
Steve Klabnik
06df5d8042
Rollup merge of #30122 - steveklabnik:last_trpl_fix, r=Manishearth
...
Along with https://github.com/rust-lang/rust/pull/30121 , this should fix the last fallout from https://github.com/rust-lang/rust/pull/29932
2015-11-30 18:02:22 -05:00
Steve Klabnik
30221eaedf
Rollup merge of #30115 - nilcons-contrib:fix-book-stack, r=steveklabnik
...
The `f` argument will reference the actual value in the `d` box, not the box in the `bar`'s stack frame.
I am just learning Rust, so I don't know how to explain this well, but just from `f`'s type it is clear that it will be a pointer to an `i32`, not a pointer to a pointer. Some `println!("{:p}", ...)`'s can easily confirm this.
I would actually suggest to remove/simplify this part of the example. This is a subtle issue that can easily confuse people at the early stages of familiarizing with the language. (As I got confused by it. :))
2015-11-30 18:02:21 -05:00
Steve Klabnik
5000bd25d9
Rollup merge of #30114 - sourcefrog:doc-casts2, r=Manishearth
2015-11-30 18:02:21 -05:00
Steve Klabnik
e4ab0398ff
Rollup merge of #30108 - bhargavrpatel:master, r=steveklabnik
2015-11-30 18:02:21 -05:00
Steve Klabnik
4bdb60cc34
Fix path to TRPL in doc README
2015-11-30 15:00:30 -05:00
Martin Pool
b00b32cdaa
Correct grammar
...
Thanks @Manishearth
2015-11-30 10:16:36 -08:00
Martin Pool
f183d7a26e
Additional text and examples around casting
2015-11-30 08:02:18 -08:00
Mihaly Barasz
7728742a44
Fix pointer value in the 'complex example'
...
The `f` argument will reference the actual value in the `d` box, not the
box in the `bar`'s stack frame.
2015-11-30 16:51:38 +01:00
Martin Pool
4a63d9fa2c
Remove broken explicit coercion example
2015-11-30 07:42:14 -08:00
Bhargav Patel
7a93a3a821
Change verbiage in Stack & Heap page
...
Made a small change in the sentence. It seemed confusing to read the word "actual" twice in the sentence; I removed it completely.
2015-11-29 22:18:13 -05:00
bors
15ad1d199b
Auto merge of #30088 - sourcefrog:doc-casts, r=steveklabnik
...
Based on the description in 219eca11b0/src/librustc_typeck/check/cast.rs (L11) and https://doc.rust-lang.org/nightly/nomicon/casts.html
2015-11-29 21:10:36 +00:00
Martin Pool
797d5433c9
Rephrased description of casting
2015-11-29 12:00:07 -08:00
Martin Pool
34e6995aa3
Add information about numeric casts, from the nomicon
2015-11-29 11:54:29 -08:00
bors
3db9bee903
Auto merge of #30059 - androm3da:master, r=bluss
2015-11-29 16:30:15 +00:00
bors
0b3424321c
Auto merge of #29651 - tshepang:misc, r=steveklabnik
2015-11-28 18:09:07 +00:00
xd1le
fb5f3faa6b
doc(book/ffi): remove duplicate link reference `[libc]'
2015-11-28 16:58:39 +11:00
Martin Pool
d6952121e0
Attempted documentation of coercions
...
Trying to summarize here only the cases that will make sense at the
level of the rust book
2015-11-27 17:35:12 -08:00
Martin Pool
f34e6ff084
Copy in some documentation about which casts are legal
2015-11-27 17:15:05 -08:00
ebadf
797a0bd1c1
Shifted focus of while-let example per review.
2015-11-27 10:23:58 -06:00
Marvin Löbel
296c3613ca
Added stmt_expr_attribute feature gate
2015-11-26 21:47:44 +01:00
Ariel Ben-Yehuda
52dd2b4c35
fix tests & rustdoc
2015-11-26 18:22:40 +02:00
Ariel Ben-Yehuda
1430a35000
move librustc/plugin to librustc_plugin
...
this is a [breaking-change] to all plugin authors - sorry
2015-11-26 18:22:39 +02:00
bors
6d88afe477
Auto merge of #30015 - petrochenkov:staged, r=brson
...
Closes https://github.com/rust-lang/rust/issues/30008
`#[stable]`, `#[unstable]` and `#[rustc_deprecated]` are now guarded by `#[feature(staged_api)]`
r? @brson
2015-11-26 10:22:37 +00:00
ebadf
465a5cb194
Corrections to the while-let example per review.
2015-11-25 20:05:45 -06:00
bors
1805bba399
Auto merge of #30053 - JIghtuse:master, r=steveklabnik
2015-11-26 00:20:37 +00:00
Tshepang Lekhonkhobe
05dde0d325
book: miscellaneous improvements to "dining philosophers" example
2015-11-26 00:21:23 +02:00
Vadim Petrochenkov
5127d24a3e
Remove #[staged_api]
2015-11-25 21:55:26 +03:00
androm3da
b1c5c26c68
Updated "while let" example.
2015-11-25 12:46:35 -06:00
Boris Egorov
b892b5a690
trpl: Fix example logic in error handling chapter
2015-11-25 14:07:43 +06:00
Manish Goregaokar
3f25c5c655
Rollup merge of #30038 - Carreau:cargo-philosopher, r=steveklabnik
...
At this point of the book, reader have likely use `cargo new --bin`,
likely 2 times, once if they are lazy. This remind them of the `cargo`
syntax.
I was myself unsure whether it was `cargo create`, `cargo new`, and
whether it would initialize in current working directory or needed a
target.
--
Otherwise thanks, I've been writing rust for a few hours, and likes it so far.
2015-11-25 09:21:18 +05:30
bors
5faed4c451
Auto merge of #29687 - Havvy:ux-guidelines, r=pnkfelix
...
See https://github.com/rust-lang/rfcs/pull/1246 for discussion.
2015-11-25 01:14:43 +00:00
Matthias Bussonnier
5aa45071db
Add cargo instructions for dinning_philosopher project
...
At this point of the book, reader have likely use `cargo new --bin`,
likely 2 times, once if they are lazy. This remind them of the `cargo`
syntax.
I was myself unsure whether it was `cargo create`, `cargo new`, and
whether it would initialize in current working directory or needed a
target.
2015-11-24 21:58:18 +01:00
Steve Klabnik
fab9dd6c80
Rollup merge of #30020 - Manishearth:unit, r=bluss
...
`unit` was in code formatting, which is wrong, since it's not actual code. The correct code is `()`.
2015-11-24 09:43:46 -05:00
Manish Goregaokar
c3600114cc
Update reference.md
2015-11-24 11:56:27 +05:30
Alex Gaynor
563adbbea5
fixed inconsistent indentation in book example
...
looks like a case of mixed tabs and spaces
2015-11-24 01:24:27 -05:00
bors
040a77f772
Auto merge of #29952 - petrochenkov:depr, r=brson
...
Part of https://github.com/rust-lang/rust/issues/29935
The deprecation lint is still called "deprecated", so people can continue using `#[allow(deprecated)]` and similar things.
2015-11-23 20:08:49 +00:00
Philipp Matthias Schäfer
e4e03bc74a
wording: results don't fail
2015-11-23 09:39:58 +01:00
Matthias Kauer
e37cd6d5fd
change link on book front page trpl -> book
2015-11-21 07:49:38 +08:00
Florian Hahn
c53722daae
Remove slice pattern from compiler plugin example
...
closes #29930
2015-11-20 14:31:04 +01:00
Vadim Petrochenkov
a613059e3f
Rename #[deprecated] to #[rustc_deprecated]
2015-11-20 16:11:20 +03:00
Steve Klabnik
024aa9a345
src/doc/trpl -> src/doc/book
...
The book was located under 'src/doc/trpl' because originally, it was
going to be hosted under that URL. Late in the game, before 1.0, we
decided that /book was a better one, so we changed the output, but
not the input. This causes confusion for no good reason. So we'll change
the source directory to look like the output directory, like for every
other thing in src/doc.
2015-11-19 11:30:18 -05:00
Steve Klabnik
6e4f6c8f5f
Rollup merge of #29891 - steveklabnik:gh29470, r=alexcrichton
...
Fixes #29470
2015-11-17 18:13:06 -05:00
Steve Klabnik
370b793969
Rollup merge of #29890 - steveklabnik:gh29742, r=Manishearth
...
FIxes #29742
2015-11-17 18:13:06 -05:00
Steve Klabnik
8adfcf1b7c
Rollup merge of #29889 - steveklabnik:gh29801, r=manishearth
...
First, re-word the section on if let/while let to be more clear.
Second, actually call them let statements in the statement section
Fixes #29801
2015-11-17 18:13:05 -05:00
Steve Klabnik
fb6687150c
Rollup merge of #29888 - steveklabnik:gh29762, r=sanxiyn
...
Fixes #29762
2015-11-17 18:13:05 -05:00
Steve Klabnik
cf384c21ea
Clear up the reference around let
...
First, re-word the section on if let/while let to be more clear.
Second, actually call them let statements in the statement section
Fixes #29801
2015-11-17 17:41:26 -05:00
Steve Klabnik
9ca257a5b6
Fix up escapes in the reference
...
Fixes #29470
2015-11-17 11:54:20 -05:00
Steve Klabnik
dcf7e4da69
Clarify comment about structs and lifetimes
...
FIxes #29742
2015-11-17 11:42:17 -05:00
Steve Klabnik
0f5ba5459b
Mention libc from crates.io in TRPL: FFI
...
Fixes #29762
2015-11-17 11:12:57 -05:00