Commit graph

1155 commits

Author SHA1 Message Date
Steve Klabnik
8851ec647a New Guide: crates and modules 2014-10-20 17:29:57 -04:00
bors
b2e5773655 auto merge of #18145 : neilpa/rust/master, r=steveklabnik
Noticed a type while reading through the intro
2014-10-20 20:27:32 +00:00
Steve Klabnik
f358407dcf Some String Guide improvements.
Fixes #17340
2014-10-20 16:25:35 -04:00
bors
6353465f4d auto merge of #18186 : cakebaker/rust/fix_test_count, r=alexcrichton 2014-10-20 17:57:39 +00:00
Daniel Hofstetter
555ab2b3a4 Guide: Fix test count 2014-10-20 16:17:59 +02:00
Daniel Hofstetter
cf3d3dc486 Guide: Fix typo in path 2014-10-20 15:26:09 +02:00
bors
c121cbab35 auto merge of #18139 : JelteF/rust-1/patch-1, r=steveklabnik
The explanation of fold talks about three elements that should be summed, but it uses different values in the provided code.
2014-10-19 13:52:06 +00:00
bors
4bb21f37ef auto merge of #18135 : EduardoBautista/rust/fix-misaligned-carot, r=steveklabnik 2014-10-19 07:17:15 +00:00
bors
c46812f659 auto merge of #18120 : jrincayc/rust/match_exp, r=thestinger
Use a match expression directly in the println statement, instead of creating a second variable.  It seems weird that the current guide.md complains about creating an extra variable, when the same feature could be demonstrated without creating the extra variable.
2014-10-19 00:47:18 +00:00
Neil Pankey
66939dfe64 [Docs] more intro typos 2014-10-18 17:40:57 -07:00
Neil Pankey
e1389530cf [Docs] intro typo 2014-10-18 17:37:54 -07:00
Jelte Fennema
2a668149c2 Fix fold explanation in the guide
The explanation of fold talks about three elements that should be summed, but it uses different values in the provided code.
2014-10-18 19:29:53 +02:00
Eduardo Bautista
cef0b55c78 Fix misaligned carot in guide 2014-10-18 01:34:50 -05:00
bors
1270f8e77a auto merge of #17955 : rjz/rust/tweak-tasks-guide, r=brson 2014-10-18 02:37:16 +00:00
jrincayc
ce83a24b5f Use match expression directly in guide.md
Use a match expression directly in the println statement, instead of creating a second variable.
2014-10-17 07:00:29 -06:00
bors
fa59bb0869 auto merge of #18052 : IvanUkhov/rust/raw-byte-string-literals, r=aturon
Hello,


The pull request fixes a typo in the description of raw string literals in [reference.md](https://github.com/rust-lang/rust/blob/master/src/doc/reference.md#byte-and-byte-string-literals).


Regards,
Ivan
2014-10-17 07:32:17 +00:00
Luqman Aden
3410c52eec librustc: Remove trans::reflect and the opaque and ty_visitor lang items. 2014-10-16 11:15:36 -04:00
Luqman Aden
38aca17c47 Remove libdebug and update tests. 2014-10-16 11:15:34 -04:00
Ivan Ukhov
a923b4ff6d Fix the description of raw byte string literals 2014-10-15 06:36:13 +02:00
John Kleint
1ce5a5626e Guide: develop the exposition of arrays, vectors, and slices.
The array is the fundamental concept; vectors are growable arrays, and
slices are views into either.  Show common array ops up front: length
and iteration.  Mention arrays are immutable by default.  Highlight
definite initialization and bounds-checking as safety features.  Show
that you only need a type suffix on one element of initializers.
Explain that vectors are a value-add library type over arrays, not a
fundamental type; show they have the same "interface." Motivate slices
as efficient views into arrays; explain you can slice vectors, Strings,
&str because they're backed by arrays.
2014-10-14 23:23:57 -04:00
Alex Crichton
1263a36a62 rollup merge of #17993 : redcape/fix-ffi-docs 2014-10-13 15:10:10 -07:00
Alex Crichton
f006e86eed rollup merge of #17992 : jkleint/guide-double-borrow 2014-10-13 15:10:08 -07:00
Alex Crichton
ad25e560a0 rollup merge of #17986 : gamazeps/docissue 2014-10-13 15:10:01 -07:00
Alex Crichton
48d0359273 rollup merge of #17979 : jkleint/guide-guess-counter 2014-10-13 15:09:52 -07:00
Alex Crichton
001814fda2 rollup merge of #17977 : Behemecoatyl/master 2014-10-13 15:09:48 -07:00
Alex Crichton
0dd4cd57fe rollup merge of #17968 : nodakai/really-fix-kw-table 2014-10-13 15:09:35 -07:00
bors
c7e0724274 auto merge of #17733 : jgallagher/rust/while-let, r=alexcrichton
This is *heavily* based on `if let` (#17634) by @jakub- and @kballard

This should close #17687
2014-10-13 19:37:40 +00:00
bors
d670d76221 auto merge of #17963 : sfackler/rust/cfg-error, r=alexcrichton
All deprecation warnings have been converted to errors. This includes
the warning for multiple cfgs on one item. We'll leave that as an error
for some period of time to ensure that all uses are updated before the
behavior changes from "or" to "and".
2014-10-13 12:27:43 +00:00
Gil Cottle
c6f9b8ff17 Doc: Fix C-Code Example in FFI Docs
Add missing void* for passed RustObject.
2014-10-13 01:36:10 -04:00
John Kleint
ed7d1be12f Guide: specify that both shared and mutable borrows can be re-lent. 2014-10-12 23:50:22 -04:00
Felix Raimundo
1cbce309fe Fixes small error on the doc (task part) 2014-10-13 00:13:41 +02:00
John Kleint
67418f5509 Guide: remove promise of a counter in the guessing game.
Issue #17964.
2014-10-12 15:24:39 -04:00
Steven Fackler
aa3b1261b1 Continue cfg syntax transition
All deprecation warnings have been converted to errors. This includes
the warning for multiple cfgs on one item. We'll leave that as an error
for some period of time to ensure that all uses are updated before the
behavior changes from "or" to "and".
2014-10-12 11:40:19 -07:00
Erwan
d7dc97e384 fix broken link in guide-strings.md 2014-10-12 18:51:11 +02:00
NODA, Kai
e2fed746c2 src/doc/README.md: fix a dead link.
Also make some typographical changes.
2014-10-12 17:29:07 +08:00
NODA, Kai
b2949ae543 Fix HTML version of the keyword table.
This should really fix rust-lang/rust#17528.
2014-10-12 17:26:37 +08:00
rjz
a35c53d65b Tweak copy and formatting of Tasks guide 2014-10-11 13:00:01 -07:00
Jakub Wieczorek
4442e6d890 Remove virtual structs from the reference 2014-10-11 19:42:26 +02:00
bors
ba246100ca auto merge of #17928 : steveklabnik/rust/remove_runtime_guide, r=alexcrichton
Now that libgreen is gone, this is all wrong.

Fixes #17923
2014-10-11 07:12:02 +00:00
John Gallagher
0d6dafa51f Add while let to the reference
Closes #17687
2014-10-10 20:30:32 -04:00
John Gallagher
660cf18070 Move while let behind while_let feature gate 2014-10-10 20:30:32 -04:00
Steve Klabnik
51c5a8eb1b Remove the runtime guide.
Now that libgreen is gone, this is all wrong.

Fixes #17923
2014-10-10 13:30:17 -04:00
Alex Crichton
a3e8f41212 doc: Document constants in the reference 2014-10-09 09:44:52 -07:00
bors
8f96590150 auto merge of #17873 : steveklabnik/rust/gh16413, r=alexcrichton
A fix for the issues mentioned in https://github.com/rust-lang/rust/issues/16413
2014-10-09 05:22:27 +00:00
bors
63fe80e1ff auto merge of #17867 : jbcrail/rust/unclear-macros-doc, r=alexcrichton
I rearranged one sentence in the macros guide to make it less awkward.
2014-10-08 23:42:39 +00:00
Steve Klabnik
557014cd83 add mention of test attribute
Fixes #16413
2014-10-08 16:46:01 -04:00
Steve Klabnik
3f1ed8608d remove crate_id attribute, add crate_name one
this is true as of https://github.com/rust-lang/rust/pull/15319
2014-10-08 16:44:40 -04:00
bors
afb5fcd553 auto merge of #17843 : coffeejunk/rust/guide-macros, r=steveklabnik
The old version switched in between examples from the value `5i` to `"Hello"` and back.

Additionally, the code generated by `rustc print.rs --pretty=expanded` is not as verbose anymore.
2014-10-08 17:52:08 +00:00
bors
eb2240aca3 auto merge of #17855 : steveklabnik/rust/fix_table_reference, r=alexcrichton
Markdown tables require a header, and we don't want one.

Fixes #17528
2014-10-08 11:32:11 +00:00
Joseph Crail
daa91d8ef4 Fix unclear macros documentation. 2014-10-07 22:18:10 -04:00
bors
0606234880 auto merge of #17836 : typelist/rust/guide-tuples, r=steveklabnik
Currently, the Guide says tuples "are only equivalent if the arity, types, and values are all identical", before presenting an example that uses `==` to compare two tuples whose arity and contained types match. This is misleading, because it implies that `==` can dynamically check whether two tuples have the same arity and contained types, whereas trying to do this would lead to a compiler error.

I tried to avoid destroying the flow of this section, but I'm not sure if I've been successful.
2014-10-08 01:02:10 +00:00
Steve Klabnik
3610f8fdc2 Fix keyword table
Markdown tables require a header, and we don't want one.

Fixes #17528
2014-10-07 15:01:26 -04:00
bors
683e40f355 auto merge of #16641 : steveklabnik/rust/intro_redux, r=alexcrichton
Because my '30 minute intro' was originally a blog post, the tone was a bit too light. It also was written a long time ago, and deserves a bit of a refresher for modern Rust. now that my work on the Guide is wrapping up, I want to give it a quick re-write as well.

This is not yet done, but I'm submitting it for feedback so far. I'd really like some comments on the ownership part in particular, which gets lower level than before, but is not strictly 100% accurate. Trying to strike a balance.

In general, I'm not sure I go into enough detail for those without systems experience, but am afraid of too much detail for those that do.

Rendered view: https://github.com/steveklabnik/rust/blob/intro_redux/src/doc/intro.md

/cc @wycats @nikomatsakis @brson etc
2014-10-07 14:32:09 +00:00
bors
95090922b3 auto merge of #17832 : brson/rust/updateversion, r=alexcrichton 2014-10-07 11:32:04 +00:00
Maximilian Haack
e656affa79 Guide: Fix inconsistency in 'Marcos' section
The old version switched in between examples from the value `5i` to `"Hello"`
and back. Additionally, the code generated by `rustc print.rs
--pretty=expanded` is not as verbose anymore.
2014-10-07 13:12:27 +02:00
Johannes Muenzel
c211d132c3 Clarify that assigning/comparing different tuple types to one another won't compile 2014-10-07 01:43:18 -04:00
Nick Cameron
2d3823441f Put slicing syntax behind a feature gate.
[breaking-change]

If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-07 15:49:53 +13:00
Brian Anderson
25e81d2f5f doc: Update output of rustc --version 2014-10-06 16:22:44 -07:00
Brian Campbell
fe8f43030a docs: Reference hoedown instead of sundown 2014-10-04 13:42:23 -04:00
bors
8794107f74 auto merge of #17754 : O-I/rust/update-guide, r=steveklabnik
Hi,

These are a few small edits to the Guide that I made while reading online. Really well done and approachable.

I have a few questions below, but I don't know if this is the proper place to ask them, so feel free to ignore the below.

1. Trailing commas seem to be a convention in Rust and are used quite a bit throughout the Guide, but are never explicitly mentioned. Maybe adding a short mention about them when they first appear in the Structs section might be helpful to those who are unfamiliar with or don't use them in other languages.

2. In the Iterators section, there is a block of code like this:

```rust
let mut range = range(0i, 10i);

loop {
    match range.next() {
        Some(x) => {
            println!("{}", x);
        }  // no comma needed?
        None => { break }
    }
}
```

My inclination would be to put a comma where the comment is to separate the two arms to get this to compile, but it runs fine either way. Is there a convention on commas for scenarios like this where each arm is enclosed in `{}`?

All the best,
O-I
2014-10-04 04:27:05 +00:00
bors
c348550f4f auto merge of #17743 : steveklabnik/rust/receiver_fix, r=alexcrichton 2014-10-03 22:32:02 +00:00
Rahul Horé
9040948ef3 Adds comma
Oddly (to me), this code runs fine without the comma separating the `Some` and `None` arms of the `match` construct. It seems like Rust doesn't require you to separate arms with commas if all the expressions are enclosed in braces.
2014-10-03 16:40:58 -04:00
Rahul Horé
083b46dd29 Fixes wording 2014-10-03 15:59:57 -04:00
Rahul Horé
0eb4df9ace Removes extra . 2014-10-03 15:41:59 -04:00
Rahul Horé
d3f8f8a849 Adds missing cd 2014-10-03 14:47:57 -04:00
Alex Crichton
39f4bf7b1c Test fixes from the rollup 2014-10-03 11:43:15 -07:00
Rahul Horé
816c56e1d5 Use similar syntax in all arms
See issue #17672. This was started in commit ee1cbb9c71, but there were a few more lines to update.
2014-10-03 14:41:55 -04:00
Rahul Horé
060224af68 Fixes output 2014-10-03 13:59:32 -04:00
Rahul Horé
e8ddad18e8 Adds trailing comma 2014-10-03 13:50:42 -04:00
Rahul Horé
8a6342f751 Fixes spacing 2014-10-03 13:37:05 -04:00
Steve Klabnik
71f752bbc4 Update signature of try_recv() 2014-10-03 11:58:52 -04:00
Steve Klabnik
6c5bf9f2a4 Re-do the 30 minute intro
This was originally on my blog, so it's incredibly informal. Let's make
it better.
2014-10-03 11:22:44 -04:00
bors
9a2286d3a1 auto merge of #16995 : kmcallister/rust/plugin-tutorial, r=alexcrichton
@steveklabnik, are you interested in looking this over?
2014-10-03 07:33:26 +00:00
Alex Crichton
7ae802f57b rollup merge of #17666 : eddyb/take-garbage-out
Conflicts:
	src/libcollections/lib.rs
	src/libcore/lib.rs
	src/librustdoc/lib.rs
	src/librustrt/lib.rs
	src/libserialize/lib.rs
	src/libstd/lib.rs
	src/test/run-pass/issue-8898.rs
2014-10-02 14:53:18 -07:00
Alex Crichton
005ae8e3dd rollup merge of #17717 : steveklabnik/gh17190 2014-10-02 14:50:46 -07:00
Alex Crichton
6ee3c2854f rollup merge of #17698 : jistr/guide_export 2014-10-02 14:50:27 -07:00
Alex Crichton
979f7cd7d7 rollup merge of #17695 : steveklabnik/various_docs 2014-10-02 14:50:24 -07:00
Steve Klabnik
85a8b92b51 extra comment about macros
Fixes #17190
2014-10-02 15:12:27 -04:00
Steve Klabnik
16cca6dbad I am bad at math 2014-10-02 15:07:44 -04:00
Aaron Turon
7bf56df4c8 Revert "Put slicing syntax behind a feature gate."
This reverts commit 95cfc35607.
2014-10-02 11:47:51 -07:00
Eduard Burtescu
aa0b350c97 docs: remove mentions of Gc. 2014-10-02 16:59:31 +03:00
Nick Cameron
95cfc35607 Put slicing syntax behind a feature gate.
[breaking-change]

If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-02 13:23:36 +13:00
Steve Klabnik
dc35a53d15 Fix incorrect statement about ok()
Fixes #17676.
2014-10-01 17:16:34 -04:00
Steve Klabnik
e2357cf41b Don't compare () to null.
Fixes #17671.
2014-10-01 17:14:29 -04:00
Steve Klabnik
ee1cbb9c71 use similar syntax in all arms
Fixes #17672
2014-10-01 17:12:29 -04:00
Steve Klabnik
fc818ff33b 🔥 τ
Fixes #17674
2014-10-01 17:11:05 -04:00
Keegan McAllister
eb1cbf3d1d Link plugins guide from elsewhere 2014-10-01 13:21:52 -07:00
Keegan McAllister
61bf75bb5e Add a guide to compiler plugins
Fixes #16983.
2014-10-01 13:21:52 -07:00
Keegan McAllister
58c428fbf2 Add a red-box warning to the macros guide 2014-10-01 13:21:52 -07:00
Keegan McAllister
dfcfd008fa Update some old references to rust.md 2014-10-01 13:21:52 -07:00
Keegan McAllister
e3828026d5 Use relative doc URLs in top-level guides 2014-10-01 13:21:52 -07:00
Keegan McAllister
4ced7a9637 Add some notes about macro scoping 2014-10-01 13:21:52 -07:00
Jiří Stránský
ac956c013f Guide: clarify exporting
Mention that using `pub` is called exporting.

Remove that `use` is called re-exporting, because `pub use` should be
called re-exporting. The guide currently doesn't cover `pub use`.
2014-10-01 22:20:58 +02:00
Keegan McAllister
c8bdba77fc rust.css: Make it more clear when code spans are links 2014-10-01 12:12:56 -07:00
Aaron Turon
60b859ab8a Remove all use of librustuv 2014-10-01 10:33:11 -07:00
bors
2f15dcd4d3 auto merge of #17584 : pcwalton/rust/range-patterns-dotdotdot, r=nick29581
This breaks code that looks like:

    match foo {
        1..3 => { ... }
    }

Instead, write:

    match foo {
        1...3 => { ... }
    }

Closes #17295.

r? @nick29581
2014-10-01 03:17:24 +00:00
Jakub Wieczorek
e53f4a6b94 Add if let to the reference 2014-09-30 18:54:03 +02:00
Kevin Ballard
13e00e4a3d Update based on PR feedback 2014-09-30 18:54:03 +02:00
Kevin Ballard
8a60952100 Move if let behind a feature gate 2014-09-30 18:54:03 +02:00
Patrick Walton
416144b827 librustc: Forbid .. in range patterns.
This breaks code that looks like:

    match foo {
        1..3 => { ... }
    }

Instead, write:

    match foo {
        1...3 => { ... }
    }

Closes #17295.

[breaking-change]
2014-09-30 09:11:26 -07:00
Alex Crichton
1ebf456fb0 rollup merge of #17510 : MatejLach/find_fix 2014-09-29 08:10:32 -07:00
bors
eb816eee0f auto merge of #17535 : Manishearth/rust/patch-2, r=steveklabnik
It's a rather useful syntax, and non-obvious.

A friend of mine is learning Rust and was trying to find a way to easily do such an initialization — he couldn't find it in the guide and was pretty surprised when I showed him. Looks like something that should be mentioned.

r? @steveklabnik
2014-09-29 07:43:07 +00:00
bors
34dfa45718 auto merge of #17511 : MatejLach/rust/iter_guide_typo, r=alexcrichton
The sentence "The new iterator `filter()` produces returns only the elements that that closure returned `true` for:"  can be structured as:

"The new iterator `filter()` produces only the elements that that closure returned `true` for:"

or as:

"The new iterator `filter()` returns only the elements that that closure returned `true` for:"

however, not both. 

I went with "produces", since it then talks about returning true and having "return" so close together doesn't sound nice. 
r @steveklabnik ?
2014-09-27 13:52:54 +00:00
bors
6cde5c340d auto merge of #17512 : nodakai/rust/fix-ptr-guide, r=alexcrichton
Fix rust-lang/rust#17255

This is such a trivial change.  Devs: perhaps you might want to omit to run `make check` on Travis.
2014-09-27 07:43:24 +00:00
bors
43d7d7c15e auto merge of #17506 : sfackler/rust/cfg-attr, r=alexcrichton
cc #17490 

Reopening of #16230
2014-09-27 01:37:53 +00:00
Manish Goregaokar
1f4cd80ac5 Mention array sugar in guide 2014-09-26 00:00:27 +05:30
Niko Matsakis
6473909a1b Fix various places that were affected by adding core as dep of libc 2014-09-25 13:59:24 -04:00
Matej Lach
9ca399f14e Correct tense 2014-09-25 16:13:20 +01:00
Florian Hahn
1c7d253ca3 Rename fail_ lang item to fail, closes #16114 2014-09-25 01:09:09 +02:00
Florian Hahn
9a01da9460 Rename begin_unwind lang item to fail_fmt, refs #16114 2014-09-24 23:44:00 +02:00
NODA, Kai
de027a8b1f guide-pointers.md: C sample code should match the Rust version.
Fix rust-lang/rust#17255
2014-09-24 21:53:11 +08:00
Matej Lach
5a25537faf Correct typo in the Iterator adapters section 2014-09-24 13:35:33 +01:00
Matej Lach
3c47d89614 Remove unnecessary code from an example 2014-09-24 12:39:16 +01:00
Steven Fackler
65cca7c8b1 Deprecate #[ignore(cfg(...))]
Replace `#[ignore(cfg(a, b))]` with `#[cfg_attr(all(a, b), ignore)]`
2014-09-23 23:49:20 -07:00
bors
c669411afa auto merge of #17402 : steveklabnik/rust/update_manual, r=brson
Because I'm still 😷 😷 😷 , I figured some mindless tasks would be better than trying to finish the ownership guide. 

The manual has long been waiting for some ❤️ ❤️ ❤️ , and so I gave it a quick once-over. I made small commits in case any of the changes are a bit weird, I mostly did a few things:

1. changed 'manual' to 'reference.' I feel like this name is better. If it's not, It's not a huge deal. it shouldn't be `rust.md` though.
2. word wrapped everything appropriately. Changes 1&2 are in the first commit, so that its' easier to see the changes in the later ones.
3. fixed other small style issues
4. removed references to things that are in the standard library, and not the language itself

There's still lots of gross in here, but I didn't want to pile on too too many changes.

/cc @brson @nikomatsakis
2014-09-23 22:05:38 +00:00
bors
7fbbfe6bf2 auto merge of #17366 : ohazi/rust/master, r=steveklabnik
See: http://doc.rust-lang.org/std/from_str/trait.FromStr.html
```
let input_num = from_str::<Option<uint>>("5");
```
```
<anon>:2:21: 2:45 error: failed to find an implementation of trait std::from_str::FromStr for core::option::Option<uint>
<anon>:2     let input_num = from_str::<Option<uint>>("5");
                             ^~~~~~~~~~~~~~~~~~~~~~~~
```
2014-09-23 20:20:41 +00:00
Steve Klabnik
c765178bf6 clean up some references to 'owned' 2014-09-22 17:54:10 -04:00
Steve Klabnik
64813d33d8 vectors are not in the language 2014-09-22 17:54:10 -04:00
Steve Klabnik
c94d479a90 die 'managed' 2014-09-22 17:54:10 -04:00
Steve Klabnik
84bd6bba45 logging is an external crate 2014-09-22 17:54:10 -04:00
Steve Klabnik
68b8901fff no it won't 2014-09-22 17:54:10 -04:00
Steve Klabnik
7866f515a5 runtime has no C++ 2014-09-22 17:54:10 -04:00
Steve Klabnik
667276040f Remove lies about task scheduling
it's 1:1 by default now, and N:M is on its way out
2014-09-22 17:54:10 -04:00
Steve Klabnik
fdd511d124 Fix terminology around boxes
it's just 'box' not 'owned box'
2014-09-22 17:54:10 -04:00
Steve Klabnik
72c27aba9c fix example 2014-09-22 17:54:10 -04:00
Steve Klabnik
f95958b526 glob imports are an external crate 2014-09-22 17:54:10 -04:00
Steve Klabnik
6c348dfe72 rust -> Rust 2014-09-22 17:54:09 -04:00
Steve Klabnik
19e814ed98 uhhh weird triple backticks 2014-09-22 17:54:09 -04:00
Steve Klabnik
96180d7e6b 'merican English 2014-09-22 17:54:09 -04:00
Steve Klabnik
64a77b1ff5 move keywords to table 2014-09-22 17:54:09 -04:00
Steve Klabnik
68227d01f9 '. ' -> '. ' 2014-09-22 17:54:09 -04:00
Steve Klabnik
bfb5fb3b45 Remove disclaimer
This is just true of all of Rust, and doesn't make a lot of sense now.
Especially as we move towards finalizing things, I think it's time for
this to go.
2014-09-22 17:54:09 -04:00
Steve Klabnik
eaa7b8eb4c make note of language vs libraries 2014-09-22 17:54:09 -04:00
Steve Klabnik
1f2b5061d3 modernize code blocks 2014-09-22 17:54:09 -04:00
Steve Klabnik
47682f96de manual -> reference & formatting
'reference' sounds better than 'manual' to me here, and rust.html is
certainly wrong.

I also wrapped everything to 80 cols.
2014-09-22 17:54:09 -04:00
Alfie John
9d95729af4 doc: Removing repeated variable name to make it less ambiguious 2014-09-22 20:48:10 +00:00
Alex Crichton
0169218047 Fix fallout from Vec stabilization 2014-09-21 22:15:51 -07:00
Alex Crichton
dbaa9300ac rollup merge of #17350 : pablobm/doc-fix 2014-09-19 10:00:32 -07:00
Oren Hazi
c942df9fa5 from_str has an impl for uint, not Option<uint> 2014-09-18 00:52:42 -07:00
Patrick Walton
78a841810e librustc: Implement associated types behind a feature gate.
The implementation essentially desugars during type collection and AST
type conversion time into the parameter scheme we have now. Only fully
qualified names--e.g. `<T as Foo>::Bar`--are supported.
2014-09-17 16:38:57 -07:00
Pablo Brasero
17674e02fc Fix warning and make code follow the text better 2014-09-17 21:05:16 +01:00
Alex Crichton
1921055dda rollup merge of #17294 : theevocater/master 2014-09-17 08:49:31 -07:00
Alex Crichton
9dfcb41926 rollup merge of #17292 : thestinger/tasks 2014-09-17 08:49:28 -07:00
Alex Crichton
b27947ac4d rollup merge of #17278 : steveklabnik/gh17242 2014-09-17 08:49:08 -07:00
Alex Crichton
b4bff574d2 rollup merge of #17277 : steveklabnik/doc_fix_rollup 2014-09-17 08:49:06 -07:00
bors
ff613abaa2 auto merge of #17227 : tshepang/rust/stronger-break, r=aturon
Remove trailing whitespace while at it
2014-09-17 03:46:15 +00:00
bors
0e784e1684 auto merge of #17268 : aturon/rust/mut-conventions, r=alexcrichton
As per [RFC 52](https://github.com/rust-lang/rfcs/blob/master/active/0052-ownership-variants.md), use `_mut` suffixes to mark mutable variants, and `into_iter` for moving iterators. Additional details and motivation in the RFC.

Note that the iterator *type* names are not changed by this RFC; those are awaiting a separate RFC for standardization.

Closes #13660
Closes #16810

[breaking-change]
2014-09-16 23:26:11 +00:00
Aaron Turon
fc525eeb4e Fallout from renaming 2014-09-16 14:37:48 -07:00
bors
ceb9bbfbf5 auto merge of #17213 : mo/rust/fix_typos, r=aturon 2014-09-16 21:36:08 +00:00
Jake Kaufman
7d00eb6133 Update triple per comments 2014-09-16 08:44:47 -07:00
bors
946654a721 auto merge of #17197 : nikomatsakis/rust/issue-5527-trait-reform-revisited, r=pcwalton
This patch does not make many functional changes, but does a lot of restructuring towards the goals of #5527. This is the biggest patch, basically, that should enable most of the other patches in a relatively straightforward way.

Major changes:

- Do not track impls through trans, instead recompute as needed.
- Isolate trait matching code into its own module, carefully structure to distinguish various phases (selection vs confirmation vs fulfillment)
- Consider where clauses in their more general form
- Integrate checking of builtin bounds into the  trait matching process, rather than doing it separately in kind.rs (important for opt-in builtin bounds)

What is not included:

- Where clauses are still not generalized. This should be a straightforward follow-up patch.
- Caching. I did not include much caching. I have plans for various kinds of caching we can do. Should be straightforward. Preliminary perf measurements suggested that this branch keeps compilation times roughly what they are.
- Method resolution. The initial algorithm I proposed for #5527 does not work as well as I hoped. I have a revised plan which is much more similar to what we do today.
- Deref vs deref-mut. The initial fix I had worked great for autoderef, but not for explicit deref. 
- Permitting blanket impls to overlap with specific impls. Initial plan to consider all nested obligations before considering an impl to match caused many compilation errors. We have a revised plan but it is not implemented here, should be a relatively straightforward extension.
2014-09-16 15:25:59 +00:00
bors
c09437ab2d auto merge of #17244 : spastorino/rust/patch-1, r=alexcrichton 2014-09-16 11:11:03 +00:00
bors
e6a3dabe43 auto merge of #17232 : untitaker/rust/patch-1, r=alexcrichton
The wording is correct if you consider that two of these lines were extracted from the original example. It still tripped me up while reading, so i just removed any reference to the linecount.
2014-09-16 09:26:03 +00:00
Jake Kaufman
2f35723170 Correct windows install link in guide
This closes #17260. The guide references the old install location for
the windows rust install before it was split into 64bit and 32bit
installers. This adds a link to each binary.
2014-09-15 23:36:17 -07:00
Daniel Micay
7ce2ea0d14 stop spawning so many tasks in guide-tasks
1000 tasks * 2MiB stack size -> 2GiB of virtual memory

On a 64-bit OS, a 32-bit executable has 4GiB available, but the kernel
gets half of the available address space so the limit is 2GiB on 32-bit.

Closes #17044
2014-09-16 00:47:49 -04:00
Niko Matsakis
eafeb335a0 Update docs to include Sized trait, which is needed 2014-09-15 18:52:20 -04:00
Martin Olsson
7caf2ab802 Fix two typos 2014-09-15 23:04:08 +02:00
Dan Connolly
2ee91ea437 use _sample configurations..._ rather than _here_ as link text 2014-09-15 13:40:16 -04:00
Steve Klabnik
51b4c515f4 remove rendundant function
Fixes #17230.
2014-09-15 13:23:46 -04:00
Steve Klabnik
b45853860c remove references to HM inference
Fixes #17229.
2014-09-15 13:23:31 -04:00
Steve Klabnik
df6240dc9e properly annotate C code in the guide
Without 'notrust,' we were getting a playpen link.

Fixes #17228.
2014-09-15 13:23:12 -04:00
Steve Klabnik
b3432b267d Don't use 'here'
Fixes #17225
2014-09-15 13:21:50 -04:00
bors
8e2860407b auto merge of #16887 : steveklabnik/rust/guide_iterators, r=alexcrichton
This isn't ready to merge yet.

The 'containers and iterators' guide is basically just a collection of stuff that should be in the module definitions. So I'm moving the guide to just an 'iterators' guide, and moved the info that was there into the right places.

So, is this a good path forward, and is all of the information still correct?
2014-09-15 15:11:12 +00:00
Santiago Pastorino
f8bbf6d0e1 rustc main.rs generates main binary file 2014-09-13 22:25:38 -03:00
Steve Klabnik
1b818020a0 Remove container guide.
This isn't really what guides are for, this information belongs in the
module-level docs.

Fixes #9314.
2014-09-13 15:06:00 -04:00
bors
079951ed2a auto merge of #17187 : damag/rust/ffi-guide-fixes, r=alexcrichton
Updates the callbacks section to refer to the right function name and fixes a couple of minor whitespace issues in the examples.
2014-09-13 13:50:57 +00:00
Markus Unterwaditzer
d36ac4def5 These two lines are actually three. 2014-09-13 15:16:59 +02:00
Tshepang Lekhonkhobe
46e3014ce0 doc: that felt like it needed a stronger break than what comma provides
Remove trailing whitespace while at it
2014-09-13 09:40:30 +02:00
bors
ccae356ace auto merge of #17155 : steveklabnik/rust/dherman_fixes, r=brson
Fixing more suggestions from @dherman . I made them individual commits in case we want to discuss any of them further.
2014-09-12 23:30:54 +00:00
Damien Grassart
d4b2edc3ee Use a space after colons per the Rust coding style:
https://github.com/rust-lang/rust-guidelines/blob/master/style/whitespace.md
2014-09-12 09:10:03 +02:00
Damien Grassart
0eedec560c The example code uses trigger_callback(), not do_callback(). 2014-09-12 09:03:15 +02:00
bors
4727381685 auto merge of #16657 : steveklabnik/rust/goodbye_tutorial, r=brson
The Guide isn't 100% perfect, but it's basically complete. It's
certainly better than the tutorial is. Time to start pointing more
people its way.

I also just made it consistent to call all things 'guides' rather than
tutorials.

Fixes #9874. This is the big one.

And two bugs that just go away.

Fixes #14503.
Fixes #15009.
2014-09-12 01:15:41 +00:00
Steve Klabnik
c456cca90a only deprecate the guide rather than 🔥 🔥 🔥 2014-09-11 16:21:32 -04:00
Steve Klabnik
a99ba25f2b Replace the Tutorial with the Guide.
The Guide isn't 100% perfect, but it's basically complete. It's
certainly better than the tutorial is. Time to start pointing more
people its way.

I also just made it consistent to call all things 'guides' rather than
tutorials.

Fixes #9874. This is the big one.

And two bugs that just go away.

Fixes #14503.
Fixes #15009.
2014-09-11 16:21:32 -04:00
bors
d24c82420b auto merge of #17154 : steveklabnik/rust/array_clarification, r=huonw
fixes #17148
2014-09-11 18:50:41 +00:00
bors
1dc31953e7 auto merge of #17153 : steveklabnik/rust/add_link_to_manual, r=sfackler
whoops

Fixes https://github.com/rust-lang/rust/pull/16827#issuecomment-55160273
2014-09-11 15:50:45 +00:00
bors
09abbbdafc auto merge of #16866 : P1start/rust/tuple-indexing, r=brson
This allows code to access the fields of tuples and tuple structs behind the feature gate `tuple_indexing`:

```rust
#![feature(tuple_indexing)]

let x = (1i, 2i);
assert_eq!(x.1, 2);

struct Point(int, int);
let origin = Point(0, 0);
assert_eq!(origin.0, 0);
assert_eq!(origin.1, 0);
```

Implements [RFC 53](https://github.com/rust-lang/rfcs/blob/master/active/0053-tuple-accessors.md). Closes #16950.
2014-09-11 00:05:41 +00:00
Steve Klabnik
c3943b3c89 don't say 'semantic' 2014-09-10 18:30:28 -04:00
Steve Klabnik
8f7470d864 remove rich hickey love 2014-09-10 18:29:58 -04:00
Steve Klabnik
311227003f Remove much of the modules section.
This part can get _really_ confusing, and we want to make sure that
people succeed in the guide. I plan on making a module guide in the
future to replace the information here.
2014-09-10 18:28:37 -04:00
Steve Klabnik
9c8c82b87d hello_world.rs -> main.rs 2014-09-10 18:26:17 -04:00
Steve Klabnik
b85191ae0f dave hates jokes 😉 2014-09-10 18:24:40 -04:00
Steve Klabnik
faf14ae633 Fix vector terminology in the manual.
fixes #17148
2014-09-10 17:02:37 -04:00
Steve Klabnik
60415e1032 reintroduce manual link in doc index
whoops

Fixes https://github.com/rust-lang/rust/pull/16827#issuecomment-55160273
2014-09-10 16:57:07 -04:00
bors
370f8df2ae auto merge of #17108 : steveklabnik/rust/explicitness, r=alexcrichton
I missed some annotations, and some were in a different style.
2014-09-10 07:35:41 +00:00
bors
6ceb9b4157 auto merge of #16824 : steveklabnik/rust/string_guide_improvements, r=alexcrichton
A few steps toward https://github.com/rust-lang/rust/issues/15994
2014-09-10 03:20:40 +00:00
Steve Klabnik
8ddb9c71c3 Add section about Str trait 2014-09-09 18:48:30 -04:00
Steve Klabnik
c8e5068ec9 Be explicit with rustdoc.
I missed some annotations, and some were in a different style.
2014-09-09 18:42:05 -04:00
P1start
bf274bc18b Implement tuple and tuple struct indexing
This allows code to access the fields of tuples and tuple structs:

    let x = (1i, 2i);
    assert_eq!(x.1, 2);

    struct Point(int, int);
    let origin = Point(0, 0);
    assert_eq!(origin.0, 0);
    assert_eq!(origin.1, 0);
2014-09-10 10:25:12 +12:00
Alex Crichton
456f00eb7e rollup merge of #17107 : steveklabnik/uninitialized_bindings 2014-09-09 12:07:14 -07:00
Alex Crichton
8158463122 rollup merge of #17054 : pcwalton/subslice-syntax 2014-09-09 12:07:12 -07:00
Alex Crichton
2c66c296db rollup merge of #17052 : pcwalton/feature-gate-subslices 2014-09-09 12:07:11 -07:00
bors
504ed55775 auto merge of #16827 : steveklabnik/rust/fix_doc_index, r=brson
Fixes #14972
2014-09-09 13:26:16 +00:00
bors
641b1980a4 auto merge of #16825 : steveklabnik/rust/fix_manual_array_terms, r=brson
fixes #16015
2014-09-09 04:26:18 +00:00
Patrick Walton
eb678ff87f librustc: Change the syntax of subslice matching to use postfix ..
instead of prefix `..`.

This breaks code that looked like:

    match foo {
        [ first, ..middle, last ] => { ... }
    }

Change this code to:

    match foo {
        [ first, middle.., last ] => { ... }
    }

RFC #55.

Closes #16967.

[breaking-change]
2014-09-08 16:12:13 -07:00
Steve Klabnik
18f1f5a06e guide: Remove reference to uninitialized bindings
There isn't a good way to fit this in, so let's just not
mention it.

Fixes #16792.
2014-09-08 18:50:08 -04:00
Patrick Walton
22179f49e5 librustc: Feature gate subslice matching in non-tail positions.
This breaks code that uses the `..xs` form anywhere but at the end of a
slice. For example:

    match foo {
        [ 1, ..xs, 2 ]
        [ ..xs, 1, 2 ]
    }

Add the `#![feature(advanced_slice_patterns)]` gate to reenable the
syntax.

RFC #54.

Closes #16951.

[breaking-change]
2014-09-08 11:04:14 -07:00
Steve Klabnik
a021330b1d Fix vector/array/slice terminology in manual.
Fixes #16015.
2014-09-07 05:28:59 -04:00
bors
57781c3c30 auto merge of #17019 : steveklabnik/rust/remove_compromise, r=thestinger
@dherman doesn't like it 😄
2014-09-07 07:16:27 +00:00
bors
c964cb229b auto merge of #17018 : steveklabnik/rust/fix_projects_in_guide, r=huonw
Thanks @dherman.
2014-09-07 05:31:25 +00:00
Steve Klabnik
d929d83eec don't say compromise
@dherman doesn't like it 😄
2014-09-05 06:38:53 -04:00
Steve Klabnik
12d66e6ac3 Fix formatting in the guide.
Thanks @dherman.
2014-09-05 06:37:22 -04:00
Felix Raimundo
d0f1c7dfb0 Update language item from 'share' to 'sync' #16988 2014-09-05 02:03:26 +02:00
bors
dfbd4669cd auto merge of #16925 : jbcrail/rust/doc-spelling-errors, r=alexcrichton
I fixed spelling mistakes in the documentation.
2014-09-02 10:31:04 +00:00
Joseph Crail
7241267b93 doc: Fix spelling errors. 2014-09-01 20:52:38 -04:00
Steve Klabnik
d32bfe8c2b Fix pointer types in the manual. 2014-09-01 14:03:00 -04:00
Alex Crichton
33029c5ddd rollup merge of #16881 : cmr/guide-typo 2014-08-30 23:49:01 -07:00
Alex Crichton
56a029f145 rollup merge of #16852 : steveklabnik/desugar_destructure 2014-08-30 23:48:11 -07:00
Alex Crichton
963861fa40 rollup merge of #16849 : nhowell/patch-1 2014-08-30 23:48:05 -07:00
Alex Crichton
d1a5b277a1 rollup merge of #16839 : treeman/issue-15358 2014-08-30 23:47:23 -07:00
Alex Crichton
89d1c9c48c rollup merge of #16833 : SebastianZaha/fix-guide-typo 2014-08-30 23:47:12 -07:00
Alex Crichton
c50fffaa9a rollup merge of #16832 : SebastianZaha/fix-inconsistent-version-numbering 2014-08-30 23:47:07 -07:00
Alex Crichton
fe848fcd3b rollup merge of #16828 : steveklabnik/more_pointer_guide 2014-08-30 23:46:46 -07:00
Alex Crichton
c6fd2d31ee rollup merge of #16807 : nham/guide_added_ownership_rule 2014-08-30 23:46:38 -07:00
Alex Crichton
f7f8b20961 rollup merge of #16780 : mdinger/marker_types 2014-08-30 23:46:19 -07:00
Alex Crichton
e442406dd7 rollup merge of #16726 : tshepang/consistency 2014-08-30 23:45:44 -07:00
Alex Crichton
941b06b0bd rollup merge of #16721 : tshepang/convenience 2014-08-30 23:45:41 -07:00
Alex Crichton
9fc29f1d2e rollup merge of #16716 : tshepang/temp 2014-08-30 23:45:37 -07:00
bors
c2564540de auto merge of #16393 : SimonSapin/rust/patch-9, r=steveklabnik 2014-08-30 23:51:25 +00:00
nham
ea888edf63 doc: Add another restriction to the list of ownership rules. 2014-08-30 17:22:29 -04:00
Steve Klabnik
7e4a1459e9 note about ref patterns in pointer guide
Fixes #13602
2014-08-30 16:15:46 -04:00
Corey Richardson
02d96ac612 guide: function -> closure in explanation of closures 2014-08-30 12:39:52 -04:00
Tshepang Lekhonkhobe
d89b2a5c3d doc: make docs build
Addresses this comment:
https://github.com/rust-lang/rust/pull/16721#issuecomment-53946624
2014-08-30 08:02:40 +02:00
P1start
de7abd8824 Unify non-snake-case lints and non-uppercase statics lints
This unifies the `non_snake_case_functions` and `uppercase_variables` lints
into one lint, `non_snake_case`. It also now checks for non-snake-case modules.
This also extends the non-camel-case types lint to check type parameters, and
merges the `non_uppercase_pattern_statics` lint into the
`non_uppercase_statics` lint.

Because the `uppercase_variables` lint is now part of the `non_snake_case`
lint, all non-snake-case variables that start with lowercase characters (such
as `fooBar`) will now trigger the `non_snake_case` lint.

New code should be updated to use the new `non_snake_case` lint instead of the
previous `non_snake_case_functions` and `uppercase_variables` lints. All use of
the `non_uppercase_pattern_statics` should be replaced with the
`non_uppercase_statics` lint. Any code that previously contained non-snake-case
module or variable names should be updated to use snake case names or disable
the `non_snake_case` lint. Any code with non-camel-case type parameters should
be changed to use camel case or disable the `non_camel_case_types` lint.

[breaking-change]
2014-08-30 09:10:05 +12:00
Steve Klabnik
eb28237195 desugar -> destructure
wrong de- word.
2014-08-29 15:35:51 -04:00
Nick Howell
0a84308eba Fix spelling mistakes in the guide
Also made some opinionated changes such as to prefer license over licence and judgment over judgement.
2014-08-29 11:23:21 -04:00
Jonas Hietala
5bf1b03e5c Tweak error message for use of a keyword in ident position.
Closes #15358
2014-08-29 10:36:43 +02:00
Sebastian Zaha
6138e835f6 Fix guide typo. 2014-08-28 23:14:09 +02:00
Sebastian Zaha
5f919cd7aa Cargo begins version number at 0.0.1 instead of 0.1.0. 2014-08-28 22:47:45 +02:00
Steve Klabnik
124b80a52f Revamp doc index
Fixes #14972
2014-08-28 14:52:39 -04:00
Steve Klabnik
bda3ceda03 Add note about string indexing.
Thanks @chris-morgan!
2014-08-28 13:56:55 -04:00
bors
0d3bd7720c auto merge of #16757 : steveklabnik/rust/lets_not_lie_in_the_concurrency_guide, r=alexcrichton
This cleans up blatant lies in the concurrency guide, and modernizes it
a bit. There's a lot more to do, but until I get to it, let's make it a
little bit better.
2014-08-27 21:31:13 +00:00
Steve Klabnik
263d65cb01 Fix lies in the concurrency guide.
This cleans up blatant lies in the concurrency guide, and modernizes it
a bit. There's a lot more to do, but until I get to it, let's make it a
little bit better.
2014-08-27 16:42:24 -04:00
bors
9669c6dc1a auto merge of #16752 : MatejLach/rust/more_cargorun, r=steveklabnik
Use cargo run as much as possible...
2014-08-27 11:16:12 +00:00
bors
d860a667e7 auto merge of #16724 : tshepang/rust/misleading, r=brson
We have to specify the module and the function name in the example where
the module shares a crate with the executable as well, so remove the
redundant (and potentially confusing) mention.
2014-08-27 07:46:17 +00:00
bors
5550edef46 auto merge of #16689 : wickerwaka/rust/crate-as, r=pcwalton
For review. Not sure about the link_attrs stuff. Will work on converting all the tests.

extern crate "foobar" as foo;
extern crate foobar as foo;

Implements remaining part of RFC #47.
Addresses issue #16461.

Removed link_attrs from rust.md, they don't appear to be supported by
the parser.
2014-08-27 06:01:18 +00:00
mdinger
48a2876c2c Fix sorting order. Change sync to share 2014-08-27 00:26:50 -04:00
Matej Lach
7bfcace03b Use cargo run in more places 2014-08-26 19:40:11 +01:00
bors
3ae1059632 auto merge of #16720 : tshepang/rust/trailing-prompt, r=alexcrichton
because eyesore
2014-08-26 14:11:08 +00:00
Simon Sapin
666d566eec Replace mention of ~T by Box<T> in the FFI guide. 2014-08-25 20:14:36 +01:00
bors
084325f2d9 auto merge of #16722 : tshepang/rust/trailing-spaces, r=pcwalton 2014-08-24 13:51:03 +00:00
Tshepang Lekhonkhobe
538ea3cd05 doc: slight consistency fix
Others in this list are Capitalized, so do it here too.
2014-08-24 13:51:42 +02:00
Tshepang Lekhonkhobe
4aff964463 doc: remove misleading/confusing info
We have to specify the module and the function name in the example where
the module shares a crate with the executable as well, so remove the
redundant (and potentially confusing) mention.
2014-08-24 13:10:59 +02:00
Tshepang Lekhonkhobe
3aa0a14af0 doc: remove trailing spaces from Guide 2014-08-24 12:26:45 +02:00
Tshepang Lekhonkhobe
2d723237db doc: use the more convenient 'cargo run' command
This lovely command has already been introduced, so let's take advantage
of it.
2014-08-24 12:21:41 +02:00
Tshepang Lekhonkhobe
f4fb3ad9aa doc: remove trailing shell prompts
because eyesore
2014-08-24 12:16:14 +02:00
Tshepang Lekhonkhobe
3e94401a64 doc: move misplaced comma
Also:

* Remove unseeming repetition.
* By now, the reader has already heard that Rust is safe by default, so
reduce the overlong sentence, making it easier to read.
2014-08-24 04:24:25 +02:00
Tshepang Lekhonkhobe
6d2fe2e885 doc: add missing word 2014-08-24 04:03:51 +02:00
wickerwaka
c0e003d5ad extern crate foobar as foo;
Implements remaining part of RFC #47.
Addresses issue #16461.

Removed link_attrs from rust.md, they don't appear to be supported by
the parser.

Changed all the tests to use the new extern crate syntax

Change pretty printer to use 'as' syntax
2014-08-23 12:16:04 -07:00
Daniel Hofstetter
1777047a54 Guide: Make add_three_times_four() public 2014-08-23 15:06:29 +02:00