Commit Graph

3493 Commits

Author SHA1 Message Date
bors
ee597a8ee1 Auto merge of #30292 - Xmasreturns:patch-3, r=steveklabnik
Updated structs.md in the book
2015-12-10 04:54:03 +00:00
Xmasreturns
2adba31682 Fixes from review
Traits -> Field labels
Revert a change to convention
2015-12-09 13:25:53 -08:00
Xmasreturns
6bbe6759a5 Grammar and slight ordering changes 2015-12-09 11:37:57 -08:00
Xmasreturns
99fdf3414f Grammar changes for readability 2015-12-09 10:07:02 -08:00
Steve Klabnik
1f0f7d6fba Rollup merge of #30273 - Xmasreturns:patch-1, r=steveklabnik
Changes to readability and some clarifications for beginners
2015-12-09 00:01:17 -05:00
Steve Klabnik
ac2cb1fb7d Rollup merge of #30224 - matklad:super-docs, r=steveklabnik
Make clear that `super` may be included in the path several times.

r? @steveklabnik
2015-12-09 00:01:17 -05:00
Xmasreturns
88c407c74f Update traits.md 2015-12-08 14:56:42 -08:00
Xmasreturns
f5a4383b21 Update traits.md
Changes to readability and some clarifications for beginners
2015-12-08 14:38:55 -08:00
Steve Klabnik
de39b2cada Re-order the sections in TRPL
This ordering was significantly more confusing.
2015-12-08 15:14:56 -05:00
bors
85b031b3bc Auto merge of #30234 - vyp:doc-typo, r=apasel422 2015-12-06 13:23:43 +00:00
xd1le
85a90a3c20 doc(book/error-handling): fix typo 2015-12-06 20:32:49 +11:00
bors
078aff8928 Auto merge of #30221 - thyrgle:concurrency_doc, r=alexcrichton
The example code in the Channels subsection of the rust book give warnings about

    unused result which must be used, #[warn(unused_must_use)] on by default

Added a small pattern match to resolve those warnings.
2015-12-06 08:50:49 +00:00
bors
c4b16384f1 Auto merge of #30187 - alexcrichton:stabilize-1.6, r=aturon
This commit is the standard API stabilization commit for the 1.6 release cycle.
The list of issues and APIs below have all been through their cycle-long FCP and
the libs team decisions are listed below

Stabilized APIs

* `Read::read_exact`
* `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`)
* libcore -- this was a bit of a nuanced stabilization, the crate itself is now
  marked as `#[stable]` and the methods appearing via traits for primitives like
  `char` and `str` are now also marked as stable. Note that the extension traits
  themeselves are marked as unstable as they're imported via the prelude. The
  `try!` macro was also moved from the standard library into libcore to have the
  same interface. Otherwise the functions all have copied stability from the
  standard library now.
* `fs::DirBuilder`
* `fs::DirBuilder::new`
* `fs::DirBuilder::recursive`
* `fs::DirBuilder::create`
* `os::unix::fs::DirBuilderExt`
* `os::unix::fs::DirBuilderExt::mode`
* `vec::Drain`
* `vec::Vec::drain`
* `string::Drain`
* `string::String::drain`
* `vec_deque::Drain`
* `vec_deque::VecDeque::drain`
* `collections::hash_map::Drain`
* `collections::hash_map::HashMap::drain`
* `collections::hash_set::Drain`
* `collections::hash_set::HashSet::drain`
* `collections::binary_heap::Drain`
* `collections::binary_heap::BinaryHeap::drain`
* `Vec::extend_from_slice` (renamed from `push_all`)
* `Mutex::get_mut`
* `Mutex::into_inner`
* `RwLock::get_mut`
* `RwLock::into_inner`
* `Iterator::min_by_key` (renamed from `min_by`)
* `Iterator::max_by_key` (renamed from `max_by`)

Deprecated APIs

* `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`)
* `OsString::from_bytes`
* `OsStr::to_cstring`
* `OsStr::to_bytes`
* `fs::walk_dir` and `fs::WalkDir`
* `path::Components::peek`
* `slice::bytes::MutableByteVector`
* `slice::bytes::copy_memory`
* `Vec::push_all` (renamed to `extend_from_slice`)
* `Duration::span`
* `IpAddr`
* `SocketAddr::ip`
* `Read::tee`
* `io::Tee`
* `Write::broadcast`
* `io::Broadcast`
* `Iterator::min_by` (renamed to `min_by_key`)
* `Iterator::max_by` (renamed to `max_by_key`)
* `net::lookup_addr`

New APIs (still unstable)

* `<[T]>::sort_by_key` (added to mirror `min_by_key`)

Closes #27585
Closes #27704
Closes #27707
Closes #27710
Closes #27711
Closes #27727
Closes #27740
Closes #27744
Closes #27799
Closes #27801
cc #27801 (doesn't close as `Chars` is still unstable)
Closes #28968
2015-12-06 04:12:54 +00:00
Alex Crichton
464cdff102 std: Stabilize APIs for the 1.6 release
This commit is the standard API stabilization commit for the 1.6 release cycle.
The list of issues and APIs below have all been through their cycle-long FCP and
the libs team decisions are listed below

Stabilized APIs

* `Read::read_exact`
* `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`)
* libcore -- this was a bit of a nuanced stabilization, the crate itself is now
  marked as `#[stable]` and the methods appearing via traits for primitives like
  `char` and `str` are now also marked as stable. Note that the extension traits
  themeselves are marked as unstable as they're imported via the prelude. The
  `try!` macro was also moved from the standard library into libcore to have the
  same interface. Otherwise the functions all have copied stability from the
  standard library now.
* The `#![no_std]` attribute
* `fs::DirBuilder`
* `fs::DirBuilder::new`
* `fs::DirBuilder::recursive`
* `fs::DirBuilder::create`
* `os::unix::fs::DirBuilderExt`
* `os::unix::fs::DirBuilderExt::mode`
* `vec::Drain`
* `vec::Vec::drain`
* `string::Drain`
* `string::String::drain`
* `vec_deque::Drain`
* `vec_deque::VecDeque::drain`
* `collections::hash_map::Drain`
* `collections::hash_map::HashMap::drain`
* `collections::hash_set::Drain`
* `collections::hash_set::HashSet::drain`
* `collections::binary_heap::Drain`
* `collections::binary_heap::BinaryHeap::drain`
* `Vec::extend_from_slice` (renamed from `push_all`)
* `Mutex::get_mut`
* `Mutex::into_inner`
* `RwLock::get_mut`
* `RwLock::into_inner`
* `Iterator::min_by_key` (renamed from `min_by`)
* `Iterator::max_by_key` (renamed from `max_by`)

Deprecated APIs

* `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`)
* `OsString::from_bytes`
* `OsStr::to_cstring`
* `OsStr::to_bytes`
* `fs::walk_dir` and `fs::WalkDir`
* `path::Components::peek`
* `slice::bytes::MutableByteVector`
* `slice::bytes::copy_memory`
* `Vec::push_all` (renamed to `extend_from_slice`)
* `Duration::span`
* `IpAddr`
* `SocketAddr::ip`
* `Read::tee`
* `io::Tee`
* `Write::broadcast`
* `io::Broadcast`
* `Iterator::min_by` (renamed to `min_by_key`)
* `Iterator::max_by` (renamed to `max_by_key`)
* `net::lookup_addr`

New APIs (still unstable)

* `<[T]>::sort_by_key` (added to mirror `min_by_key`)

Closes #27585
Closes #27704
Closes #27707
Closes #27710
Closes #27711
Closes #27727
Closes #27740
Closes #27744
Closes #27799
Closes #27801
cc #27801 (doesn't close as `Chars` is still unstable)
Closes #28968
2015-12-05 15:09:44 -08:00
Christopher Sumnicht
bfb7361540 Uses unwrap instead of pattern matching 2015-12-05 15:01:05 -08:00
Aleksey Kladov
c8b7e24b14 DOCS: update reference about paths 2015-12-05 21:55:34 +03:00
Christopher Sumnicht
658f91a0cc Resolved warnings about unused result 2015-12-05 03:17:18 -08:00
Jake Worth
2217cf1af2 Fix typo 2015-12-04 12:32:36 -05:00
bors
77ed39cfe3 Auto merge of #29850 - Kimundi:attributes_that_make_a_statement, r=pnkfelix
See https://github.com/rust-lang/rfcs/pull/16 and https://github.com/rust-lang/rust/issues/15701

- Added syntax support for attributes on expressions and all syntax nodes in statement position.
- Extended `#[cfg]` folder to allow removal of statements, and
of expressions in optional positions like expression lists and trailing
block expressions.
- Extended lint checker to recognize lint levels on expressions and
locals.
- As per RFC, attributes are not yet accepted on `if` expressions.

Examples:
  ```rust
let x = y;
{
        ...
}
assert_eq!((1, #[cfg(unset)] 2, 3), (1, 3));

let FOO = 0;
```

Implementation wise, there are a few rough corners and open questions:
- The parser work ended up a bit ugly.
- The pretty printer change was based mostly on guessing.
- Similar to the `if` case, there are some places in the grammar where a new `Expr` node starts,
  but where it seemed weird to accept attributes and hence the parser doesn't. This includes:
  - const expressions in patterns
  - in the middle of an postfix operator chain (that is, after `.`, before indexing, before calls)
  - on range expressions, since `#[attr] x .. y` parses as  `(#[attr] x) .. y`, which is inconsistent with
    `#[attr] .. y` which would parse as `#[attr] (.. y)`
- Attributes are added as additional `Option<Box<Vec<Attribute>>>` fields in expressions and locals.
- Memory impact has not been measured yet.
- A cfg-away trailing expression in a block does not currently promote the previous `StmtExpr` in a block to a new trailing expr. That is to say, this won't work:
```rust
let x = {
    #[cfg(foo)]
    Foo { data: x }
    #[cfg(not(foo))]
    Foo { data: y }
};
```
- One-element tuples can have their inner expression removed to become Unit, but just Parenthesis can't. Eg, `(#[cfg(unset)] x,) == ()` but `(#[cfg(unset)] x) == error`. This seemed reasonable to me since tuples and unit are type constructors, but could probably be argued either way.
- Attributes on macro nodes are currently unconditionally dropped during macro expansion, which seemed fine since macro disappear at that point?
- Attributes on `ast::ExprParens` will be prepend-ed to the inner expression in the hir folder.
- The work on pretty printer tests for this did trigger, but not fix errors regarding macros:
  - expression `foo![]` prints as `foo!()`
  - expression `foo!{}` prints as `foo!()`
  - statement `foo![];` prints as `foo!();`
  - statement `foo!{};` prints as `foo!();`
  - statement `foo!{}` triggers a `None` unwrap ICE.
2015-12-04 08:46:29 +00:00
Mika Attila
87b865c83c Link to lazy_static crate in Design FAQ
Replace the old link pointing to an out-of-date gist with a
link to the lazy_static crate on crates.io.

We also don't need to state the author, as the crates.io page
shows the authors and owners.
2015-12-03 20:11:29 +01:00
bors
a2f58f3644 Auto merge of #30169 - shepmaster:for-loop-into-iterator, r=steveklabnik 2015-12-03 04:34:43 +00:00
Jake Goulding
06e4b709c3 Clarify that a for loop uses IntoIterator 2015-12-02 14:48:10 -05:00
bors
01bd93d310 Auto merge of #30161 - JIghtuse:master, r=steveklabnik 2015-12-02 15:06:37 +00:00
Boris Egorov
63bb3e66ee book: Provide link to tuple structs in type aliases chapter 2015-12-02 10:47:53 +06:00
Steve Klabnik
9823511b2a Rollup merge of #30154 - salty-horse:guessing_panic, r=steveklabnik
The text mentions ```return```, but what's actually happening is a ```panic!```.
2015-12-01 19:01:42 -05:00
Steve Klabnik
63015e8dc0 Rollup merge of #30153 - durka:patch-11, r=steveklabnik
I think this fixes #30137. I basically just repeated some details that were scattered around other places in this document, and emphasized that you probably don't want an `extern crate` or `mod` statement to end up inside a function.
2015-12-01 19:01:42 -05:00
Steve Klabnik
da095eecc7 Rollup merge of #30144 - pjungwir:clarify-semver-rules, r=steveklabnik
The documentation shows this:

    [dependencies]

    rand="0.3.0"

and says it allows any version compatible with 0.3.0, but then it says, "If we wanted to use only 0.3.0 exactly, we could use `=0.3.0`." That is very easy to misunderstand, so hopefully this PR will help others not to be as confused as me. :-)
2015-12-01 19:01:41 -05:00
Steve Klabnik
5e4adf96cf Rollup merge of #30134 - salty-horse:patch-1, r=steveklabnik
random/secret guess -> secret number.
2015-12-01 19:01:41 -05:00
Ori Avtalion
fa0009136d book: Change mention of unused return to panic! 2015-12-02 01:34:08 +02:00
Alex Burka
ca07c2ec21 trpl: explain how to inhibit rustdoc's auto-main
I think this fixes #30137. I basically just repeated some details that were scattered around other places in this document, and emphasized that you probably don't want an `extern crate` or `mod` statement to end up inside a function.
2015-12-01 18:18:19 -05:00
Paul A. Jungwirth
dfa0cbcb3e Clarify ambiguity about how to ask Cargo for a specific version 2015-12-01 10:03:46 -08:00
Ori Avtalion
4a35a732b7 Fix wording in Guessing Game 2015-12-01 11:59:04 +02:00
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
Manish Goregaokar
e81c72e78e Rollup merge of #29881 - jeanm:patch-1, r=Manishearth
Change conditional perfect to past perfect.
2015-11-17 15:12:15 +05:30
Manish Goregaokar
bf565467c0 Rollup merge of #29875 - steveklabnik:gh29784, r=Manishearth
Fixes #29784
2015-11-17 15:12:15 +05:30
Manish Goregaokar
ff2f74561d Rollup merge of #29873 - steveklabnik:gh29493, r=nikomatsakis
Fixes #29493
2015-11-17 15:12:14 +05:30
bors
3037b29a93 Auto merge of #29860 - steveklabnik:stackheapfixes, r=huonw
Fixes #29853
Fixes #29852

While these points are true, we're not going for 100% accuracy here,
this is introductory material. Changing these things would be more
confusing, but it is important to note that we're presenting an
abstraction here.

r? @huonw
2015-11-17 04:08:11 +00:00
Jean Maillard
4ff4d32206 Fix grammar
Change conditional perfect to past perfect.
2015-11-17 02:39:09 +00:00
Steve Klabnik
646128d79a Remove nomicon reference to copy_lifetime
Fixes #29784
2015-11-16 16:58:52 -05:00
Steve Klabnik
9e25a1ccd3 Improve UFCS example
Fixes #29493
2015-11-16 16:51:58 -05:00
Steve Klabnik
bc6c16d4cb Rollup merge of #29863 - steveklabnik:gh29526, r=alexcrichton
Fixes #29526
2015-11-16 16:22:48 -05:00
Steve Klabnik
f0b719d41e Rollup merge of #29549 - brson:docidx, r=steveklabnik
I noticed the nomicon was not listed!

I also removed links to racer and rustfmt since they were not *doc-specific* links, just links to tools, as well as pointed the cargo link directly at the docs.

Removed all the community stuff. There are lots of other places to find this now, including the website.

With pending website changes this page will continue to be pared back, reflecting only what's in-tree, not general Rust docs.

r? @steveklabnik
2015-11-16 16:22:47 -05:00
Brian Anderson
5cc0a37123 Minor tweaks to doc index 2015-11-16 11:48:18 -08:00
bors
3042fedb4f Auto merge of #29805 - norcalli:patch-1, r=steveklabnik
Fixes #29730
2015-11-16 17:18:21 +00:00
Steve Klabnik
ca4ab32a1e Nomicon: mention tuple structs with repr(c)
Fixes #29526
2015-11-16 12:04:25 -05:00
Steve Klabnik
54db4d6c68 Reaffirm that this is an abstraction
Fixes #29853
Fixes #29852

While these points are true, we're not going for 100% accuracy here,
this is introductory material. Changing these things would be more
confusing, but it is important to note that we're presenting an
abstraction here.
2015-11-16 10:38:25 -05:00
Jan Likar
8bcbcae866 Fix a typo 2015-11-15 14:21:13 +01:00
Jan Likar
235aca56b5 Improve Strings chapter 2015-11-15 08:14:46 +01:00
Jan Likar
2b05fdb38a Update 'Strings' chapter of the book
Fix #29823 by further explaining `&str` and pointing out the
difference between `&str` and `&'static str`.
2015-11-15 06:55:30 +01:00
mdinger
4e74f9b874 Document block doc comments better 2015-11-13 16:06:00 -05:00
Ashkan Kiani
7b9b9df309 Update references and borrowing (Fixes #29730)
Fixes #29730
2015-11-12 10:35:53 -08:00
Kevin Butler
5ae1937129 trpl: add a small section outlining doctest configuration 2015-11-12 05:17:11 +00:00
bors
ad3bd1b46d Auto merge of #29726 - petrochenkov:privsan, r=alexcrichton
- Check privacy sanity in all blocks, not only function bodies
- Check all fields, not only named
- Check all impl items, not only methods
- Check default impls
- Move the sanity check in the beginning of privacy checking, so others could rely on it

Technically it's a [breaking-change], but I expect no breakage because, well, it's *sane* privacy visitor, if code is broken it must be insane by definition!
2015-11-11 00:25:08 +00:00
Steve Klabnik
d64195f365 Rollup merge of #29715 - defuz:patch-3, r=alexcrichton
r? @steveklabnik

See #27305
2015-11-10 10:51:48 -05:00
Steve Klabnik
fb2ae896bb Rollup merge of #29420 - efindlay:master, r=steveklabnik
r? @steveklabnik
2015-11-10 10:51:47 -05:00
Vadim Petrochenkov
ef6850643e rustc_privacy: Fix bugs in SanePrivacyVisitor 2015-11-09 21:15:53 +03:00
Ivan Ivaschenko
c618c5f36a Doc: Fix broken link on for-loop.html 2015-11-09 17:49:30 +02:00
bors
00aa3cbecc Auto merge of #29695 - dtrebbien:remove-mention-of-struct_variant-feature, r=sanxiyn
The struct_variant feature was accepted and is no longer feature gated.
See #19122, #19124

§6.1.6 Enumerations shows an example of a struct-like enum variant.
2015-11-09 11:14:26 +00:00
bors
9eb099daa4 Auto merge of #29686 - jrburke:docs-error-handling-search-case, r=BurntSushi
In src/doc/trpl/error-handling.md, in this section:

It mentions three steps, to "convert this to proper error handling", the last one being:

3. Handle the error in main.

However, it is not shown. This pull request adds a code example showing how `main`'s call to `search` should use case analysis. I am still very much new to learning Rust, so this may not be idiomatic. Happy to make changes with guidance.
2015-11-08 20:20:16 +00:00
jrburke
0dd2c1c07d doc: error-handling.md: main case analysis for search 2015-11-08 09:53:21 -08:00
Daniel Trebbien
9f7afd060b reference: Remove struct_variant from Compiler Features
The struct_variant feature was accepted and is no longer feature gated.
See #19122, #19124

§6.1.6 Enumerations shows an example of a struct-like enum variant.
2015-11-08 11:27:40 -05:00
Jake Worth
8a41d1292f Fix double word 'be' 2015-11-08 09:39:01 -06:00
Ryan Scheel (Havvy)
13b7b07075 Add rustc UX guidelines.
See https://github.com/rust-lang/rfcs/pull/1246 for discussion.
2015-11-08 13:23:18 +00:00
Eric Findlay
dda7a3c2a1 Fixed "foo()" in try! example, r=steveklabnik 2015-11-08 11:00:03 +09:00
Eric Findlay
46b30ccd89 Added foo() to rustdoc example, r=steveklabnik
Fixes #29234
2015-11-08 10:05:20 +09:00
Jake Worth
ac19178078 Fix typo 2015-11-07 12:27:58 -06:00
Manish Goregaokar
d9dd67d908 Rollup merge of #29660 - steveklabnik:gh28461, r=brson
Fixes #28461
2015-11-07 06:44:46 +05:30
Manish Goregaokar
be4cd07a7e Rollup merge of #29622 - steveklabnik:gh29621, r=bstrie
Now that thread::sleep is a real thing, let's use it

Fixes #29621

r? @bstrie
2015-11-07 06:44:45 +05:30
Manish Goregaokar
50e8707cc3 Rollup merge of #29617 - steveklabnik:gh29591, r=alexcrichton
Fixes #29591
2015-11-07 06:44:45 +05:30
bors
475f91f46e Auto merge of #29582 - oli-obk:token_tree, r=sfackler 2015-11-06 21:11:06 +00:00
Steve Klabnik
801f83ff65 sleep_ms -> sleep
Now that thread::sleep is a real thing, let's use it

Fixes #29621
2015-11-06 18:00:29 +01:00
Steve Klabnik
586eb3d50f Add multi-line string literals to TRPL
Fixes #29591
2015-11-06 17:58:27 +01:00
Steve Klabnik
5eacf66c48 Make a note about "gigabyte"
Fixes #28461
2015-11-06 17:44:04 +01:00
Oliver Schneider
fcc7067904 remove Tt prefix from TokenType variants
[breaking change]
2015-11-06 14:52:02 +01:00
Ivan Ivaschenko
1ebdb734aa Opps, fix incorrect call 2015-11-06 13:52:17 +02:00
Ivan Ivaschenko
d071bd00bf Removing the hack from error handling chapter, which is does not make sense anymore. 2015-11-06 13:44:42 +02:00
Steve Klabnik
115c223e73 Rollup merge of #29619 - steveklabnik:gh28824, r=alexcrichton
Fixes #28824
2015-11-05 22:28:49 +01:00
Steve Klabnik
15dd4170ff Rollup merge of #29613 - steveklabnik:29506, r=alexcrichton
in favor of just expect()

Fixes #29506
2015-11-05 22:28:49 +01:00
Steve Klabnik
fdccd94269 Rollup merge of #29611 - steveklabnik:gh25918, r=alexcrichton
Originally, this was my 30 minute introduction, and we eventually made
it the opener to the book. But as #25918 has shown, the example I use
here has some issues. The good news is that Rust makes heap allocation
syntatically expensive, but the bad news is that that means showing
equivalent programs from Rust and other languages is difficult. After
thinking about it, I'm not sure this section is pulling its weight, and
since it has problems, I'd rather just pull it than try to re-write it
right now. I think the book is fine without it.

FIxes #25918
2015-11-05 22:28:49 +01:00
Steve Klabnik
58628b3f79 Beef up macro designator docs
Fixes #28824
2015-11-05 16:46:56 +01:00
Steve Klabnik
6d9502d35b Remove .ok().expect()
in favor of just expect()

Fixes #29506
2015-11-05 14:40:50 +01:00
Steve Klabnik
f70f8b4301 Remove short intro from README
Originally, this was my 30 minute introduction, and we eventually made
it the opener to the book. But as #25918 has shown, the example I use
here has some issues. The good news is that Rust makes heap allocation
syntatically expensive, but the bad news is that that means showing
equivalent programs from Rust and other languages is difficult. After
thinking about it, I'm not sure this section is pulling its weight, and
since it has problems, I'd rather just pull it than try to re-write it
right now. I think the book is fine without it.

FIxes #25918
2015-11-05 14:04:39 +01:00
Steve Klabnik
f04e77d598 Rollup merge of #29571 - steveklabnik:gh29322, r=apasel422
Fixes #29322
2015-11-05 12:43:03 +01:00
Steve Klabnik
92eb851f58 Rollup merge of #29567 - Toby-S:patch-1, r=steveklabnik
Reword "Writing the logic" paragraph to prevent `unwrap` being confused for a macro (and other small changes to improve the flow of the paragraph).

cc @steveklabnik
2015-11-05 12:43:02 +01:00
Steve Klabnik
268e360f39 Rollup merge of #29538 - steveklabnik:ch1_edits, r=brson
I did some preliminary editing work with No Starch on the first chapter of the book, and here's some of the results. We're going to want to return to this later when @brson etc's new rustup work is done, so this is mostly just a first pass.

But, we agreed that having separate chapters for each of this bit of intro is a bit excessive. So let's move all of this intro stuff into one chapter.

I'd appreciate a careful review of this, as there was also some confusion about some things, which resulted in me taking one huge markdown file apart and splitting it back up, as well as some editor issues, so I _think_ this looks good, but double checking things matters!

/cc @aturon
2015-11-05 12:43:02 +01:00
Steve Klabnik
7bb193c0ae Fixes as per @brson's review 2015-11-05 09:45:38 +01:00
bors
14db074659 Auto merge of #29528 - amitsaha:rust-inside-other-languages-minor, r=nikomatsakis
When referring to the different shared library extensions, specify the OS explicitly.
2015-11-04 13:24:50 +00:00
Steve Klabnik
0c93e727c2 Mention multiple impl blocks in TRPL
Fixes #29322
2015-11-04 10:35:09 +01:00
Steve Klabnik
2f4fbb2bf5 Merge first three chapters into one.
Conceptually, this makes more sense as one introductory chapter.
2015-11-04 10:06:50 +01:00
Toby Scrace
6fb2333d77 Fix #29542
Reword "Writing the logic" paragraph to prevent `unwrap` being confused
for a macro.
2015-11-04 07:42:54 +00:00
Brian Anderson
48c170df36 doc: Link to cargo docs, not just crates.io 2015-11-03 12:55:03 -08:00
Brian Anderson
6ca0fa9af2 doc: Add the Rustonomicon 2015-11-03 12:52:18 -08:00
Brian Anderson
53fad90608 doc: Remove community info 2015-11-03 12:49:21 -08:00
Brian Anderson
f553292cf6 doc: Remove non-documentation tool links 2015-11-03 12:48:47 -08:00
Brian Anderson
be9afcca89 doc: Remove irrelevant info about rbe 2015-11-03 12:47:57 -08:00
Steve Klabnik
75a6d51750 Make some edits as per No Starch.
Lots of little details and things.
2015-11-03 13:56:06 +01:00
Toby Scrace
d9df16bf61 Fix #29533
This replaces usage of the (missing) `fatal!` macro with `panic!`.
2015-11-03 11:46:05 +00:00
Amit Saha
900f36fde3 Specify Microsoft Windows and Mac OS X explicitly
When referring to the different shared library extensions, specify the OS explicitly.
2015-11-03 10:50:20 +11:00
Kyle Mayes
6e5d78dba3 Minor fix to Rust Book, Macros chapter
Fixes one of the `expr` examples to be a proper expression
2015-11-02 08:52:05 -05:00
bors
7caf54bc0f Auto merge of #29505 - rjbs:docs-where-type, r=steveklabnik
I read this section a few times before even having a guess what
was meant, then consulted IRC for confirmation.  It may be that I
was thick-headed, but I think this is a useful addition.
2015-11-02 08:01:56 +00:00
Ricardo Signes
21a0c40ab3 Attempt to clarify use of `where i32: ConvertTo<T>
I read this section a few times before even having a guess what
was meant, then consulted IRC for confirmation.  It may be that I
was thick-headed, but I think this is a useful addition.
2015-11-01 20:41:22 -05:00