Commit Graph

821 Commits

Author SHA1 Message Date
bors
8888d7c8e9 auto merge of #16206 : steveklabnik/rust/guide_lambdas, r=brson 2014-08-07 23:36:17 +00:00
Steve Klabnik
dac73ad3c1 Guide: Traits 2014-08-07 18:12:36 -04:00
Steve Klabnik
e0fa999891 Guide: strings 2014-08-07 16:37:39 -04:00
Steve Klabnik
b1435ed593 Guide: tasks 2014-08-07 15:21:57 -04:00
Steve Klabnik
aa8602e20a Guide: closures 2014-08-07 14:11:14 -04:00
Alex Crichton
1f760d5d1a Rename Share to Sync
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use`
statement, but the `NoShare` struct is no longer part of `std::kinds::marker`
due to #12660 (the build cannot bootstrap otherwise).

All code referencing the `Share` trait should now reference the `Sync` trait,
and all code referencing the `NoShare` type should now reference the `NoSync`
type. The functionality and meaning of this trait have not changed, only the
naming.

Closes #16281
[breaking-change]
2014-08-07 08:54:38 -07:00
Adrien Brault
c186b4be6b Fix typo in the tutorial 2014-08-06 23:09:08 -07:00
Daniel Hofstetter
c6c3f47f7c Guide: Fix imports (times_four instead of add_four) 2014-08-06 09:51:02 +02:00
bors
f5ac41185a auto merge of #16247 : TimDumol/rust/patch-1, r=alexcrichton
The 30-minute intro had a comment mentioning that `+=` will be included in the future. It's already included, and this fixes it to use `+=`.
2014-08-05 19:06:23 +00:00
Steve Klabnik
057c9ae30a Guide: generics 2014-08-05 13:47:32 -04:00
bors
ce83301f8c auto merge of #16246 : ruud-v-a/rust/patch-1, r=brson 2014-08-05 15:36:23 +00:00
bors
cbdae97689 auto merge of #16234 : cakebaker/rust/rename_guessing_game_rs_to_main_rs, r=steveklabnik
Follow-up to #16215
2014-08-05 11:31:22 +00:00
bors
157459be59 auto merge of #16216 : omasanori/rust/nfkc, r=brson
The reference manual said that code is interpreted as UTF-8 text and a implementation will normalize it to NFKC. However, rustc doesn't do any normalization now.

We may want to do any normalization for symbols, but normalizing whole text seems harmful because doing so loses some sort of information even if we choose a non-K variant of normalization.

I'd suggest removing "normalized to Unicode normalization form NFKC" phrase for the present so that the manual represents the current state properly. When we address the problem (with a RFC?), then the manual should be updated.

Closes #12388.

Reference: https://github.com/rust-lang/rust/issues/2253
2014-08-05 08:06:25 +00:00
Tim Joseph Dumol
a9979ada47 doc: Fix the 30-minute intro to use += operator.
The 30-minute intro had a comment mentioning that `+=` will be included in the future. It's already included, and this fixes it to use `+=`.
2014-08-05 02:02:41 +08:00
Ruud van Asseldonk
662f58f5a3 docs: Fix typo in tutorial. 2014-08-04 18:01:54 +02:00
Daniel Hofstetter
d0bd10b891 Rename guessing_game.rs to main.rs in guide 2014-08-04 16:41:37 +02:00
Daniel Hofstetter
c586bf21aa Rename modules.rs to main.rs in guide 2014-08-04 16:23:46 +02:00
OGINO Masanori
bf2d98e190 Remove the "NFKC clause" in the reference manual.
The reference manual said that code is interpreted as UTF-8 text and a
implementation will normalize it to NFKC. However, rustc doesn't do
any normalization now.

We may want to do any normalization for symbols, but normalizing whole
text seems harmful because doing so loses some sort of information even
if we choose a non-K variant of normalization.

I'd suggest removing "normalized to Unicode normalization form NFKC"
phrase for the present so that the manual represents the current state
properly. When we address the problem (with a RFC?), then the manual
should be updated.

Closes #12388.

Reference: https://github.com/rust-lang/rust/issues/2253

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-08-03 23:41:05 +09:00
Daniel Hofstetter
7ba9c44b94 Remove "bin" section from Cargo.toml 2014-08-03 14:19:05 +02:00
bors
ed264286dd auto merge of #16198 : cakebaker/rust/remove_unused_tuple_struct, r=steveklabnik 2014-08-03 08:11:10 +00:00
bors
12306da80c auto merge of #16189 : steveklabnik/rust/gh15494, r=alexcrichton
Fixes #15494.
2014-08-03 01:21:08 +00:00
bors
4d4eb10230 auto merge of #16186 : steveklabnik/rust/guide_cargo_new, r=alexcrichton
Two commits here: one to add `cargo new` to the guide, and a second to mention the lockfile that Cargo now generates.
2014-08-02 23:36:09 +00:00
bors
432042ac14 auto merge of #16183 : brson/rust/doctitles, r=alexcrichton 2014-08-02 17:21:09 +00:00
Daniel Hofstetter
867d8e6356 Remove unused tuple struct 2014-08-02 17:28:42 +02:00
bors
5bad333fec auto merge of #16175 : EduardoBautista/rust/fix-guessing-game-appearing-early, r=steveklabnik
Solves: https://github.com/rust-lang/rust/issues/16162
2014-08-02 12:06:09 +00:00
bors
1b44c5b0eb auto merge of #16165 : tinaun/rust/newcss, r=alexcrichton
remove unneeded `pre.rust a' selector

move transform into `.test-arrow`

fixes #16138
2014-08-02 10:21:11 +00:00
bors
71a42807ad auto merge of #16160 : EduardoBautista/rust/use-bang-at-end-of-hello-world, r=alexcrichton
Further into the guide "Hello, world!" is used instead of "Hello, world".
2014-08-02 05:06:11 +00:00
Steve Klabnik
cf279105d5 Fix manual regarding attribute placement.
Fixes #15494.
2014-08-01 23:12:14 -04:00
Steve Klabnik
2b9c5d2f74 Add note about Cargo.lock 2014-08-01 22:58:16 -04:00
Steve Klabnik
1a80dcbd56 Use cargo new.
Now that this feature exists, we should use it.

Fixes #16078
2014-08-01 22:58:01 -04:00
bors
06727d4720 auto merge of #16128 : steveklabnik/rust/speed_faq, r=brson
Fixes #11174.

I'm open to revising this text, but I figured it gets across the basics.
2014-08-02 02:16:02 +00:00
Brian Anderson
fe13a9fb59 doc: Make sure all doc titles say 'Rust'. #12466 2014-08-01 17:32:24 -07:00
bors
d7cfc34a22 auto merge of #16119 : steveklabnik/rust/guide_pointers, r=brson
This is the next section of the guide, and it's on pointers. It's not done yet, as I need to write the section on ownership and borrowing, but I figured I'd share the rest now, to get feedback on the rest of it while I take some time to get that right.
2014-08-02 00:31:03 +00:00
bors
55b24051be auto merge of #15992 : steveklabnik/rust/guide_testing, r=brson
The start of a testing guide. This PR relies on the crates and modules one because I shuffled some stuff around, so sorry about that.

I got stuck with how to import this name with cargo. @wycats and @alexcrichton , any ideas?
2014-08-01 20:21:01 +00:00
Eduardo Bautista
69267b1e1d Move caret under the 'x' variabe 2014-08-01 14:34:18 -05:00
Eduardo Bautista
ea92a5e90a Use hello_world instead of the guessing_game 2014-08-01 14:30:52 -05:00
Patrick Walton
5b85c8cbe7 librustc: Forbid pattern bindings after @s, for memory safety.
This is an alternative to upgrading the way rvalues are handled in the
borrow check. Making rvalues handled more like lvalues in the borrow
check caused numerous problems related to double mutable borrows and
rvalue scopes. Rather than come up with more borrow check rules to try
to solve these problems, I decided to just forbid pattern bindings after
`@`. This affected fewer than 10 lines of code in the compiler and
libraries.

This breaks code like:

    match x {
        y @ z => { ... }
    }

    match a {
        b @ Some(c) => { ... }
    }

Change this code to use nested `match` or `let` expressions. For
example:

    match x {
        y => {
            let z = y;
            ...
        }
    }

    match a {
        Some(c) => {
            let b = Some(c);
            ...
        }
    }

Closes #14587.

[breaking-change]
2014-08-01 08:45:22 -07:00
tinaun
42b2dc06b6 Fix API docs css reversing elements that it shouldn't
remove unneeded `pre.rust a' selector

move transform into `.test-arrow`

fixes #16138
2014-08-01 04:01:29 -04:00
Eduardo Bautista
c0048dec4a Be more consistent with "Hello, world!" 2014-07-31 23:02:22 -05:00
bors
b495933a7f auto merge of #16141 : alexcrichton/rust/rollup, r=alexcrichton 2014-08-01 01:56:32 +00:00
Steve Klabnik
fd08d5fb2e Add note about production deployments.
Fixes #11511.
2014-07-31 11:50:24 -07:00
Steve Klabnik
daaa20e565 Remove incorrect example
This now works because of elision.

Fixes #16117
2014-07-31 11:50:24 -07:00
Steve Klabnik
a74197e3f1 Guide: pointers
Not the pointer guide, but the guide section on pointers.

Adding a section about patterns for after this, as well.
2014-07-31 14:39:16 -04:00
bors
9826e801be auto merge of #16073 : mneumann/rust/dragonfly2, r=alexcrichton
Not included are two required patches:

* LLVM: segmented stack support for DragonFly [1]

* jemalloc: simple configure patches

[1]: http://reviews.llvm.org/D4705
2014-07-31 14:41:34 +00:00
Steve Klabnik
20658f7ec5 Fix heading levels in pointer guide 2014-07-31 07:30:52 -07:00
Steve Klabnik
ea1b637654 fix formatting in pointer guide table 2014-07-31 07:30:48 -07:00
DJUrsus
571f6cf29a fix variable name in tutorial 2014-07-31 07:30:14 -07:00
Steve Klabnik
d4c3500ec6 Add comment about speed in FAQ.
Fixes #11174.
2014-07-30 19:14:06 -04:00
Steve Klabnik
6121d82d47 Guide: testing 2014-07-30 09:36:32 -04:00
bors
1b0dc6a3fc auto merge of #16092 : alexcrichton/rust/rollup, r=alexcrichton 2014-07-30 05:06:41 +00:00
Alexis Beingessner
56f957f463 adding discuss.rust-lang to community 2014-07-29 15:44:08 -07:00
Corey Richardson
2a3c0d91cf manual: update list of feature gates, add phase attribute 2014-07-29 15:43:57 -07:00
Hugo Jobling
26ca10d2d7 Update disclaimer to improve clarity and intent 2014-07-29 15:43:02 -07:00
Steve Klabnik
456c4494b8 New Guide: crates and modules 2014-07-29 12:50:25 -04:00
Michael Neumann
2e2f53fad2 Port Rust to DragonFlyBSD
Not included are two required patches:

* LLVM: segmented stack support for DragonFly [1]

* jemalloc: simple configure patches

[1]: http://reviews.llvm.org/D4705
2014-07-29 16:44:39 +02:00
Ruud van Asseldonk
d7993153a4 docs: Fix typo in container guide. 2014-07-27 10:14:44 +02:00
Michael Matuzak
ca18c12243 fix small typo in guide-lifetimes 2014-07-25 21:13:39 -07:00
bors
cf1381c1d0 auto merge of #15789 : steveklabnik/rust/guide_pointers, r=cmr
This is super, super WIP, but I'm going to go get lunch for a while, and figured I'd toss my work up here in case anyone wants to see my work as I do it.

This contains a new introductory section explaining the basics of pointers, and some pitfalls that Rust attempts to solve. I'd be interested in hearing how my explanation is, as well as if this belongs here. Pointers are such a crucial concept, I don't mind having a beginners' section on them in the main docs, even though our main audience is supposed to understand them already. Reasonable people may disagree, however.
2014-07-26 00:46:16 +00:00
bors
4e388859a2 auto merge of #15959 : omasanori/rust/cleanup-ja, r=alexcrichton
The translation is based on an early version of tutorial.md, thus most
of entries have been marked as fuzzy and actually they are incorrect.
Now tutorial.md is planed to be replaced with guide.md, so I'd suggest
removing translation files for a while.

/cc @gifnksm
2014-07-25 06:01:13 +00:00
OGINO Masanori
1e2456b988 Remove obsolete Japanese translation for a while.
The translation is based on an early version of tutorial.md, thus most
of entries have been marked as fuzzy and actually they are incorrect.
Now tutorial.md is planed to be replaced with guide.md, so I'd suggest
removing translation files for a while.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-07-25 06:51:32 +09:00
Patrick Walton
bb165eb5c2 libsyntax: Remove ~self and mut ~self from the language.
This eliminates the last vestige of the `~` syntax.

Instead of `~self`, write `self: Box<TypeOfSelf>`; instead of `mut
~self`, write `mut self: Box<TypeOfSelf>`, replacing `TypeOfSelf` with
the self-type parameter as specified in the implementation.

Closes #13885.

[breaking-change]
2014-07-24 07:26:03 -07:00
bors
02464196ea auto merge of #15909 : colemickens/rust/patch-3, r=alexcrichton
Tested this on the playground, the range specifies range(0u, 3), so it should be okay to remove this cast.
2014-07-24 07:51:18 +00:00
bors
83a8a56473 auto merge of #15899 : aochagavia/rust/guide, r=kballard
The removed code caused confusion because it is not clear that the type of `y` is actually `()`
2014-07-23 06:31:11 +00:00
Cole Mickens
6bb22a9d6d Remove unnecessary cast from intro 2014-07-22 23:10:18 -07:00
Adolfo Ochagavía
2d1b87ce33 Remove misleading code example from The Guide
The removed code caused confusion because it is not clear that the type of `y` is actually `()`
2014-07-22 20:58:25 +02:00
Steve Klabnik
1e9f86b1dc Guide: fix headings 2014-07-21 19:39:16 -04:00
Steve Klabnik
377b2508f2 Guide Redux: Pointers 2014-07-21 19:34:55 -04:00
Steve Klabnik
e8c9d21130 Guessing game explanation
We now build the game at the end of the first section.

I wanted to do it as we went along, but it's too hard with these fundamentals
not in place. The rest will do the 'as we go' approach, but I think this is
better.
2014-07-21 09:54:03 -07:00
Steve Klabnik
fca79e4726 Guide: improve error handling 2014-07-21 09:53:58 -07:00
bors
8859df7fb5 auto merge of #15803 : omp/rust/master, r=alexcrichton
Fix small typo in guide.
2014-07-20 14:21:32 +00:00
bors
320dbc18d8 auto merge of #15745 : treeman/rust/tutorial-fixup, r=steveklabnik
Simplify example in 5.2 to remove hidden `#[deriving(Show)]`. Traits haven't been introduced yet and now it's easier to just type in the code and expect it to work. Add in some examples for constructing the enum types. Explicitly expose `#![feature(struct_variant)]` in the code to make it more transparent, this bit me when I worked through the tutorial.

Add references in chapter 8 to later chapters describing `Rc`, `Gc` and `Send`. This is a simple fix for #15293.

Simplify vector indexing example in chapter 13 and removed hidden, unnecessary, code. Gave an example usage of the derived `Rand` trait in chapter 17.

Removed references to removed 'extra' crate.
2014-07-20 06:11:32 +00:00
David Vazgenovich Shakaryan
69127f2f4e Fix typo. 2014-07-18 23:11:25 -07:00
Steve Klabnik
0c30e1faad Include Strings guide with the others.
Three small changes:

1. Re-organize headers in the Strings guide so they show up correctly.
2. build the strings guide with the other docs
3. include the strings guide in the list of guides
2014-07-18 10:48:24 -04:00
Steve Klabnik
226b7d1b72 Guide: strings 2014-07-17 20:50:14 -04:00
Patrick Walton
de70d76373 librustc: Remove cross-borrowing of Box<T> to &T from the language,
except where trait objects are involved.

Part of issue #15349, though I'm leaving it open for trait objects.
Cross borrowing for trait objects remains because it is needed until we
have DST.

This will break code like:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(a);

Change this code to:

    fn foo(x: &int) { ... }

    let a = box 3i;
    foo(&*a);

[breaking-change]
2014-07-17 14:05:36 -07:00
bors
c4b1077dfb auto merge of #15706 : phi-gamma/rust/master, r=huonw
I kept changes to each file in a separate commit. Please let me know if you prefer them
squashed!
2014-07-17 17:16:23 +00:00
Jonas Hietala
89e28d3df9 Small fixes for tutorial.
5.2 Simplify example to remove hidden #[deriving(Show)].
    Add example for constructing the enums.

8   Reference later sections describing rc, gc and send.
    Fix for #15293.

13  Simplify BananaMania example to remove hidden code.

17  Gave an example using the derived Rand trait.

Removed references to removed 'extra' crate.
2014-07-17 16:21:33 +02:00
Nick Cameron
aa760a849e deprecate Vec::get 2014-07-17 12:08:31 +12:00
Philipp Gesang
a1def0856e
complement-lang-faq.md: fix typos 2014-07-16 08:01:59 +02:00
Steve Klabnik
167533972f Fix cargo install instructions
Cargo now comes with Rust
2014-07-15 16:26:22 -04:00
bors
1704ebb798 auto merge of #15421 : catharsis/rust/doc-ffi-minor-fixes, r=alexcrichton
Signed-off-by: Anton Lofgren <alofgren@op5.com>
2014-07-15 14:26:11 +00:00
bors
b74562b0ae auto merge of #15534 : steveklabnik/rust/guide_stdin, r=brson 2014-07-15 07:36:17 +00:00
bors
5cef16e9b3 auto merge of #15531 : steveklabnik/rust/guide_looping, r=brson 2014-07-15 05:56:19 +00:00
bors
b1ae09e52a auto merge of #15434 : steveklabnik/rust/guide_match, r=brson 2014-07-15 01:21:22 +00:00
Yazhong Liu
7a199ba9f1 doc: missing quote in keyword Send 2014-07-15 01:26:41 +08:00
Brian Anderson
a9cf3233f7 Bump version to 0.12.0-pre 2014-07-11 11:26:58 -07:00
Steve Klabnik
6d9334d570 Remove car analogy.
This was super silly anyway.

Fixes #15539.
2014-07-09 13:04:52 -04:00
bors
b53f3e7ddb auto merge of #15530 : adrientetar/rust/proper-fonts, r=alexcrichton
- Treat WOFF as binary files so that git does not perform newline normalization.
- Replace corrupt Heuristica files with Source Serif Pro &mdash; italics are [almost in production](https://github.com/adobe/source-serif-pro/issues/2) so I left Heuristica Italic which makes a good pair with SSP. Overall, Source Serif Pro is I think a better fit for rustdoc (cc @TheHydroImpulse). This ought to fix #15527.
- Store Source Code Pro locally in order to make offline docs freestanding. Fixes #14778.

Preview: http://adrientetar.legtux.org/cached/rust-docs/core.html

r? @alexcrichton
2014-07-09 10:36:31 +00:00
bors
ec3efa8055 auto merge of #15422 : steveklabnik/rust/guide_compound_data_types, r=brson
I'm not happy about the hand-waving around `cmp`, but I'm not sure how to get around it.
2014-07-09 02:21:37 +00:00
bors
1c711db551 auto merge of #15374 : steveklabnik/rust/comments, r=brson
I'm leaving off `rustdoc` usage because it won't work unless this is a `pub fn`, and I want to talk about public/private in the context of modules. I'm also not mentioning `//!` because it is exclusively used to provide the overview of a module.
2014-07-09 00:36:40 +00:00
Steve Klabnik
17bb4af8fe Guide: Standard input 2014-07-08 17:49:19 -04:00
Richo Healey
12c334a77b std: Rename the ToStr trait to ToString, and to_str to to_string.
[breaking-change]
2014-07-08 13:01:43 -07:00
Steve Klabnik
636aff144a Guide: looping 2014-07-08 15:25:27 -04:00
Adrien Tétar
3b0b7b6b91 webfonts: serve Source Code Pro locally
So that we have freestanding docs.
2014-07-08 20:31:26 +02:00
Adrien Tétar
4d5f4ff5e9 webfonts: proper fix 2014-07-08 20:29:36 +02:00
Steve Klabnik
daea9f4ad9 Guide: match 2014-07-08 12:16:58 -04:00
Steve Klabnik
654a19b091 Guide: comments 2014-07-08 12:07:11 -04:00
Steve Klabnik
11c64f162f Guide: complex data types 2014-07-08 12:00:47 -04:00
Ruud van Asseldonk
90b79b7686 manual: Fix typo.
Also removes redundant newline in code block.
2014-07-07 07:51:34 +02:00
bors
51a7488532 auto merge of #15467 : brson/rust/guideversion, r=alexcrichton 2014-07-06 18:51:34 +00:00
bors
00a32f2f18 auto merge of #15456 : aochagavia/rust/guide, r=alexcrichton
Fixes https://github.com/rust-lang/rust/issues/15452
2014-07-06 13:26:35 +00:00
Brian Anderson
7b7d3c2458 doc: --version no longer displays the host triple 2014-07-05 17:54:24 -07:00
bors
c8b2a3167b auto merge of #15431 : iliekturtles/rust/13279-error-msg-order, r=pcwalton
Moved note after error to reduce confusion when the pair appears in the
middle of other errors. Closes #13279.
2014-07-05 18:11:43 +00:00
Adolfo Ochagavía
d6f8271602 Improved example in the Guide
Fixes https://github.com/rust-lang/rust/issues/15452
2014-07-05 18:19:08 +02:00
Mike Boutin
f37e202b53 rustc: Reorder error and note message to reduce confusion.
Moved note after error to reduce confusion when the pair appears in the
middle of other errors. Closes #13279.
2014-07-04 17:28:04 -04:00
Anton Lofgren
e737440bc6 doc/guide-ffi: A few minor typo/language fixes
Signed-off-by: Anton Lofgren <alofgren@op5.com>
2014-07-04 20:09:28 +02:00
dgoon
4c9cca41a8 add a missing closing parens 2014-07-04 23:43:16 +09:00
bors
36d7d746c8 auto merge of #15387 : huonw/rust/toc-space, r=alexcrichton
A margin for the top level list was leaking into nested ones.

before; after:

![screenshot from 2014-07-04 08 18 32](https://cloud.githubusercontent.com/assets/1203825/3476459/0b7f8ea8-0300-11e4-8b67-0c47b7931d56.png)
2014-07-04 10:16:21 +00:00
bors
5012b858ed auto merge of #15378 : mdinger/rust/Issue_15333, r=alexcrichton
Here's the issue: https://github.com/rust-lang/rust/issues/15333

Tested it. It works. FYI, in case anyone doesn't know: keyboard shortcut `'` restricts text search to only links on Firefox allowing this to be checked easily.
2014-07-04 08:31:20 +00:00
bors
5b11610ced auto merge of #15343 : alexcrichton/rust/0.11.0-release, r=brson 2014-07-04 01:21:19 +00:00
Huon Wilson
fb258f22de doc: reduce spacing of table of contents.
A margin for the top level list was leaking into nested ones.
2014-07-04 08:17:20 +10:00
Nathan Froyd
704f11d3d8 correct a few spelling mistakes in the tutorial 2014-07-03 12:54:51 -07:00
Steve Klabnik
9868b65b15 Guide: add mutable binding section
Fixes #15334.
2014-07-03 12:54:51 -07:00
Steve Klabnik
faf5d926ec Guide: functions
Just a few words about functions and defining them.
2014-07-03 10:55:19 -07:00
Steve Klabnik
748b9477f8 Guide: if 2014-07-03 10:55:10 -07:00
bors
524f469943 auto merge of #15331 : Derecho/rust/master, r=alexcrichton
One of the examples in the docs on adding documentation to rust code has an error that will cause the function to run endlessly rather than return the desired result, should someone actually implement this for some reason. While the error does not hinder the explanation of documenting code, it does look better if it is corrected.
2014-07-03 12:36:36 +00:00
Jakub Wieczorek
6b6edf4702 Improve code reuse between trans/_match.rs and check_match.rs
The specialization logic for patterns is really the same in both
exhaustiveness/reachability checking and codegen.
2014-07-03 09:17:47 +02:00
mdinger
4afe31030e Fix broken link by adding comma 2014-07-02 17:48:10 -04:00
Alex Crichton
ff1dd44b40 Merge remote-tracking branch 'origin/master' into 0.11.0-release
Conflicts:
	src/libstd/lib.rs
2014-07-02 11:08:21 -07:00
bors
ca2778ede7 auto merge of #15286 : alexcrichton/rust/channel-stability, r=cmr
* channel() - #[unstable]. This will likely remain forever

* sync_channel(n: int) - #[unstable with comment]. Concerns have ben raised
  about the usage of the term "synchronous channel" because that generally only
  applies to the case where n == 0. If n > 0 then these channels are often
  referred to as buffered channels.

* Sender::send(), SyncSender::send(), Receiver::recv() - #[experimental]. These
  functions directly violate the general guideline of not providing a failing
  and non-failing variant. These functions were explicitly selected for being
  excused from this guideline, but recent discussions have cast doubt on that
  decision. These functions are #[experimental] for now until a decision is made
  as they are candidates for removal.

* Sender::send_opt(), SyncSender::send_opt(), Receiver::recv_opt() - #[unstable
  with a comment]. If the above no-`_opt` functions are removed, these functions
  will be renamed to the non-`_opt` variants.

* SyncSender::try_send(), Receiver::try_recv() - #[unstable with a comment].
  These return types of these functions to not follow general conventions. They
  are consistent with the rest of the api, but not with the rest of the
  libraries. Until their return types are nailed down, these functions are
  #[unstable].

* Receiver::iter() - #[unstable]. This will likely remain forever.

* std::com::select - #[experimental]. The functionality is likely to remain in
  some form forever, but it is highly unlikely to remain in its current form. It
  is unknown how much breakage this will cause if and when the api is
  redesigned, so the entire module and its components are all experimental.

* DuplexStream - #[deprecated]. This type is not composable with other channels
  in terms of selection or other expected locations. It can also not be used
  with ChanWriter and ChanReader, for example. Due to it being only lightly
  used, and easily replaced with two channels, this type is being deprecated and
  slated for removal.

* Clone for {,Sync}Sender - #[unstable]. This will likely remain forever.
2014-07-02 13:52:00 +00:00
Alex Crichton
58133ae360 Apply stability attributes to std::comm
* channel() - #[unstable]. This will likely remain forever

* sync_channel(n: int) - #[unstable with comment]. Concerns have ben raised
  about the usage of the term "synchronous channel" because that generally only
  applies to the case where n == 0. If n > 0 then these channels are often
  referred to as buffered channels.

* Sender::send(), SyncSender::send(), Receiver::recv() - #[experimental]. These
  functions directly violate the general guideline of not providing a failing
  and non-failing variant. These functions were explicitly selected for being
  excused from this guideline, but recent discussions have cast doubt on that
  decision. These functions are #[experimental] for now until a decision is made
  as they are candidates for removal.

* Sender::send_opt(), SyncSender::send_opt(), Receiver::recv_opt() - #[unstable
  with a comment]. If the above no-`_opt` functions are removed, these functions
  will be renamed to the non-`_opt` variants.

* SyncSender::try_send(), Receiver::try_recv() - #[unstable with a comment].
  These return types of these functions to not follow general conventions. They
  are consistent with the rest of the api, but not with the rest of the
  libraries. Until their return types are nailed down, these functions are
  #[unstable].

* Receiver::iter() - #[unstable]. This will likely remain forever.

* std::com::select - #[experimental]. The functionality is likely to remain in
  some form forever, but it is highly unlikely to remain in its current form. It
  is unknown how much breakage this will cause if and when the api is
  redesigned, so the entire module and its components are all experimental.

* DuplexStream - #[deprecated]. This type is not composable with other channels
  in terms of selection or other expected locations. It can also not be used
  with ChanWriter and ChanReader, for example. Due to it being only lightly
  used, and easily replaced with two channels, this type is being deprecated and
  slated for removal.

* Clone for {,Sync}Sender - #[unstable]. This will likely remain forever.
2014-07-02 05:59:25 -07:00
Derecho
c85d42a305 Fix example in docs on documentation 2014-07-02 10:53:30 +02:00
bors
e76369e9a0 auto merge of #15229 : steveklabnik/rust/if, r=cmr
Whew. So much here! Feedback very welcome.

This is the first part where we actually start learning things. I'd like to think I struck a good balance of explaining enough details, without getting too bogged down, and without being confusing... but of course I'd think that. 😉 

As I mention in the commit comment, We probably want to move the guessing game to the rust-lang org, rather than just having it on my GitHub. Or, I could put the code inline. I think it'd be neat to have it as a project, so people can pull it down with Cargo. Until we make that decision, I'll just leave this here.
2014-07-02 02:11:31 +00:00
Steve Klabnik
a55c508db6 Guide: variable bindings.
Whew! Who knew there was so much to say about variables.

We probably want to move the guessing game to the rust-lang org, rather than
just having it on my GitHub. Or, I could put the code inline. I think it'd be
neat to have it as a project, so people can pull it down with Cargo. Until we
make that decision, I'll just leave this here.
2014-07-01 20:27:37 -04:00
Brian Anderson
d89577b5a2 doc: Clarify that an error is a compiler error
This was asked on HN, and it's easy to clarify.
2014-07-01 10:46:31 -07:00
Steve Klabnik
c90950ea60 Re-arrange TOC.
I'm going to move testing to be right AFTER the guessing game. I wanted it
to be borderline TDD, but I think that, since the first example is just one
file, it might be a bit overkill.

I'm doing this in its own commit to hopefully avoid merge conflicts.
2014-07-01 12:53:15 -04:00
bors
db29e1b960 auto merge of #15247 : smenardpw/rust/patch-1, r=alexcrichton
./hello_world is not recognized on Windows.
We can type either hello_world or hello_world.exe to run the executable. I chose "hello_world.exe", which seems more conventional on Windows.
2014-06-30 23:06:35 +00:00
bors
566b57f3de auto merge of #15259 : steveklabnik/rust/patch-3, r=alexcrichton
It wasn't clear if we needed to install Hello World or Cargo.
2014-06-30 12:16:30 +00:00
bors
2735c7bb10 auto merge of #15237 : zzmp/rust/feat/markdown-in-crate-documentation, r=huonw
This makes the `in-header`, `markdown-before-content`, and `markdown-after-content` options available to `rustdoc` when generating documentation for any crate.

Before, these options were only available when creating documentation *from* markdown. Now, they are available when generating documentation from source.

This also updates the `rustdoc -h` output to reflect these changes. It does not update the `man rustdoc` page, nor does it update the documentation in [the `rustdoc` manual](http://doc.rust-lang.org/rustdoc.html).
2014-06-30 07:31:29 +00:00
zzmp
63afc08262 Allow external html in rustdoc for crates.
Updated documentation to reflect md->html.
Modularized external file loading.
2014-06-30 00:03:34 -07:00
smenardpw
f6f1cf13d0 Little typo fix
- ./hello_world which is not recognized on Windows fixed.
- .exe extension added.
- Little rewriting.
2014-06-30 07:43:15 +02:00
Steve Klabnik
572234ceac it -> Cargo
It wasn't clear if we needed to install Hello World or Cargo.
2014-06-29 21:51:41 -04:00
Patrick Walton
a5bb0a3a45 librustc: Remove the fallback to int for integers and f64 for
floating point numbers for real.

This will break code that looks like:

    let mut x = 0;
    while ... {
        x += 1;
    }
    println!("{}", x);

Change that code to:

    let mut x = 0i;
    while ... {
        x += 1;
    }
    println!("{}", x);

Closes #15201.

[breaking-change]
2014-06-29 11:47:58 -07:00
bors
fe8bc17801 auto merge of #15208 : alexcrichton/rust/snapshots, r=pcwalton
This change registers new snapshots, allowing `*T` to be removed from the language. This is a large breaking change, and it is recommended that if compiler errors are seen that any FFI calls are audited to determine whether they should be actually taking `*mut T`.
2014-06-28 20:11:34 +00:00
Alex Crichton
0dfc90ab15 Rename all raw pointers as necessary 2014-06-28 11:53:58 -07:00
bors
0ddf6f4b7c auto merge of #15233 : jbclements/rust/match-var-hygiene-etc, r=cmr
This PR includes two big things and a bunch of little ones.

1) It enables hygiene for variables bound by 'match' expressions.
2) It fixes a bug discovered indirectly (#15221), wherein fold traversal failed to visit nonterminal nodes.
3) It fixes a small bug in the macro tutorial.

It also adds tests for the first two, and makes a bunch of small comment improvements and cleanup.
2014-06-28 05:21:34 +00:00
John Clements
2f73b7874e looks like a cut-n-paste error in unused code 2014-06-27 22:11:11 -07:00
Alex Crichton
aa1163b92d Update to 0.11.0 2014-06-27 12:50:16 -07:00
bors
b66c59ee5a auto merge of #15211 : steveklabnik/rust/guide_skeleton, r=huonw
This diff will look better once bors takes care of https://github.com/rust-lang/rust/pull/15183

@brson and I talked about it, and, if I commit this skeleton, I can submit PRs for each portion, without doing this silly "builds on previous PRs" stuff, and it shouldn't cause conflicts.

This lays out what I think the guide should cover, and in what order.  I haven't picked a cohesive project yet that shows all this off, but I think this progression of concepts is appropriate.
2014-06-27 11:26:25 +00:00
bors
17021944be auto merge of #15166 : zookoatleastauthoritycom/rust/13570-add-see-below-to-a-reference-to-a-new-concept-2, r=huonw
This is the same patch as submitted to https://github.com/rust-lang/rust/issues/13570 and https://github.com/rust-lang/rust/pull/14124, but with @pnkfelix's comment (https://github.com/rust-lang/rust/pull/14124#issuecomment-42797536) addressed, and with reflow as a separate commit. I'm submitting it in case @steveklabnik hasn't yet merged a rewrite of the tutorial (https://github.com/rust-lang/rust/issues/13570#issuecomment-46864789), in which case this patch might as well be merged into the old tutorial.
2014-06-27 09:41:27 +00:00
Steve Klabnik
afdb19b3b5 Skeleton outline of the guide. 2014-06-27 05:28:44 -04:00
Steve Klabnik
6bfbc35491 Add one more ignore.
Thanks @huonw
2014-06-26 21:57:46 -04:00
Steve Klabnik
aee263c6b0 Fix windows run instructions
Thank you, @stormbrew!
2014-06-26 20:49:27 -04:00
Steve Klabnik
e4b87077fb C macros, not C++ templates.
@cmr rightfully points out that C macros are worse, and share the
same name.
2014-06-26 16:58:20 -04:00
Steve Klabnik
15bcb2f9c6 Fix missing word and some grammar
Thanks @chris-morgan and @P1start! ❤️
2014-06-26 15:46:36 -04:00
Steve Klabnik
546b202e0e Note that macros != templates
Good call, @chris-morgan and @cmr!
2014-06-26 15:44:29 -04:00
Steve Klabnik
8cd906811a Clarify which curly is being referred to
Thanks @chris-morgan
2014-06-26 15:41:46 -04:00
Steve Klabnik
efc2d4a476 TIL PATHEXT
Thanks @chris-morgan ❤️
2014-06-26 15:40:52 -04:00
Steve Klabnik
c73f17486a Move note about $ up
Thanks @chris-morgan ❤️
2014-06-26 15:39:30 -04:00
Steve Klabnik
af4a6c30aa Fixing link to subreddit.
Thanks @chris-morgan ❤️
2014-06-26 15:37:57 -04:00
Steve Klabnik
49a9959d8c StackOverflow -> Stack Overflow
Thanks @chris-morgan
2014-06-26 15:36:57 -04:00
Steve Klabnik
08f533481d Fix IRC linkage.
Death to `here`!

Thanks @chris-morgan ❤️
2014-06-26 15:35:56 -04:00
Steve Klabnik
00ae648496 staticly -> statically
What's funny about this one is that spellcheck caught it, but for
some reason didn't give me the right suggestion, so I assumed that it
wasn't in my dictionary. Oh well.

Thanks @P1start! ❤️
2014-06-26 15:34:15 -04:00
Steve Klabnik
8fd69c4009 all/some
How could I forsake `rustdoc`? 😅

Thanks @huonw.
2014-06-26 15:32:35 -04:00
Steve Klabnik
98fd2abe0a tha -> than
Thanks @huonw ❤️
2014-06-26 15:31:41 -04:00
Steve Klabnik
fb594484e6 Fix capitalization of Issue.
@chris-morgan and @huonw pointed out that even though the feature
is a proper noun, we're using it in a more generic sense here.
2014-06-26 15:30:44 -04:00
Steve Klabnik
39549bebf0 Add a note that this requires git. 2014-06-26 15:30:06 -04:00
Steve Klabnik
a548e8185a Guide: Hello, cargo 2014-06-26 15:23:05 -04:00
bors
b20f968ed2 auto merge of #15197 : omasanori/rust/doc-fix, r=alexcrichton 2014-06-26 17:16:26 +00:00
OGINO Masanori
c3c195bd48 Fix a typo and a small syntactic error.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-26 21:43:47 +09:00
bors
389fae2ca8 auto merge of #15181 : steveklabnik/rust/hello_world, r=brson
This is built on top of https://github.com/rust-lang/rust/pull/15162 . cccae83d92 is the only new commit, you may want to look at that rather than the whole diff.

Writing our first Rust program together. This is the most crucial step, so I go to a fairly deep level of detail. Future sections will move more quickly.
2014-06-26 07:11:23 +00:00
bors
99519cc8e6 auto merge of #15162 : steveklabnik/rust/install_instructions, r=brson
This has my voice *very strongly*. I'm not sure if it's too much. I'd find it okay if I had to tone it back, and I don't want it to be _too strong_, but clinical docs are boring.
2014-06-26 04:21:27 +00:00
Steve Klabnik
a8ddab4f25 Add extra ignore directives. 2014-06-25 16:12:40 -04:00
Steve Klabnik
cccae83d92 Guide: Hello, world!
Let's write our first Rust program!
2014-06-25 14:26:14 -04:00
bors
7be7a8fb3a auto merge of #15121 : steveklabnik/rust/matching_docs, r=alexcrichton
Fixes #11113.
2014-06-25 15:21:26 +00:00
Steve Klabnik
1d574c1731 thanks @sfackler 2014-06-25 11:01:17 -04:00
Steve Klabnik
845ee09dfe fix feedback from @huonw 2014-06-25 11:00:34 -04:00
Steve Klabnik
338a84d45f Guide: install instructions 2014-06-25 11:00:33 -04:00
Steve Klabnik
53627dd1f2 Make an example more clear with sample code.
Fixes #11113.
2014-06-25 10:38:03 -04:00
bors
9e103acaba auto merge of #15165 : zookoatleastauthoritycom/rust/14148-Optimize-out-exhortations-about-being-careful-2, r=huonw
Yes, it is important to be careful, but repeated emphasis about it is probably
not helpful — it starts to sound like you came for a tutorial but found a
finger-wagging lecture.

Even after I removed a few of these comments, there are still several left in
the text. That's probably fine! A couple of mentions of how this is dangerous
and you ought to be careful may be a good reminder to the reader.

After making the edits, I reflowed the paragraphs that I had touched, using
emacs's "M-x fill-paragraph", with fill-column equal to 70.
2014-06-25 06:21:20 +00:00
Zooko Wilcox-O'Hearn
668bad6d4c reflow with emacs fill-paragraph (fill-column 71) 2014-06-25 01:35:50 +00:00
Zooko Wilcox-O'Hearn
d6ea8627ba add "(see below)" to a reference to a new concept
This is because I observed someone reading the tutorial who thought they'd
missed something when they got to the mention of variable bindings.

This patch doesn't reflow the paragraphs so that you can see the semantic
change that I made, and a subsequent patch will reflow this paragraph.

Fixes https://github.com/rust-lang/rust/issues/13570.
2014-06-25 01:34:24 +00:00
Zooko Wilcox-O'Hearn
e3050ffa52 Optimize out exhortations about being careful.
Yes, it is important to be careful, but repeated emphasis about it is probably
not helpful — it starts to sound like you came for a tutorial but found a
finger-wagging lecture.

Even after I removed a few of these comments, there are still several left in
the text. That's probably fine! A couple of mentions of how this is dangerous
and you ought to be careful may be a good reminder to the reader.

After making the edits, I reflowed the paragraphs that I had touched, using
emacs's "M-x fill-paragraph", with fill-column equal to 70.
2014-06-25 01:25:10 +00:00
Michael Zhou
58078005cf Fix grammar in tutorial
"as this document" should be "than this document"
2014-06-24 17:23:12 -07:00
Steve Klabnik
3ed78f5b6b Add the Guide, add warning to tutorial.
In line with what @brson, @cmr, @nikomatsakis and I discussed this morning, my
redux of the tutorial will be implemented as the Guide. This way, I can work in
small iterations, rather than dropping a huge PR, which is hard to review.  In
addition, the community can observe my work as I'm doing it.

This adds a note in line with [this comment][reddit] that clarifies the state
of the tutorial, and the community's involvement with it.

[reddit]: http://www.reddit.com/r/rust/comments/28bew8/rusts_documentation_is_about_to_drastically/ci9c98k
2014-06-24 17:22:50 -07:00
Steve Klabnik
85effb9f3e Improve ambiguous pronoun.
Fixes #14806
2014-06-24 17:22:45 -07:00
Steve Klabnik
e16a87513a Remove the cheat sheet.
Rust by Example is far better.

Fixes #14380.
2014-06-24 17:22:39 -07:00
Niko Matsakis
9e3d0b002a librustc: Remove the fallback to int from typechecking.
This breaks a fair amount of code. The typical patterns are:

* `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`;

* `println!("{}", 3)`: change to `println!("{}", 3i)`;

* `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`.

RFC #30. Closes #6023.

[breaking-change]
2014-06-24 17:18:48 -07:00
bors
58bf8b2155 auto merge of #15107 : ipetkov/rust/tutorial-update, r=alexcrichton 2014-06-24 10:16:49 +00:00
Patrick Walton
5466d13d43 librustc: Feature gate lang items and intrinsics.
If you define lang items in your crate, add `#[feature(lang_items)]`.

If you define intrinsics (`extern "rust-intrinsic"`), add
`#[feature(intrinsics)]`.

Closes #12858.

[breaking-change]
2014-06-23 23:28:28 -07:00
bors
7689213713 auto merge of #14952 : alexcrichton/rust/const-unsafe-pointers, r=brson
This does not yet change the compiler and libraries from `*T` to `*const T` as
it will require a snapshot to do so.

cc #7362

---

Note that the corresponding RFC, https://github.com/rust-lang/rfcs/pull/68, has not yet been accepted. It was [discussed at the last meeting](https://github.com/rust-lang/rust/wiki/Meeting-weekly-2014-06-10#rfc-pr-68-unsafe-pointers-rename-t-to-const-t) and decided to be accepted, however. I figured I'd get started on the preliminary work for the RFC that will be required regardless.
2014-06-24 04:16:53 +00:00
Patrick Walton
654d6444fe libsyntax: Disallow struct literals after if, while, match, and
`for...in`.

Closes #14803.

If you used a structure literal after one of these keywords, surround it
in parentheses.

[breaking-change]
2014-06-23 15:39:29 -07:00
Ivan Petkov
39efe3c82b Docs: tutorial: Remove a couple references to ~T 2014-06-23 14:51:03 -07:00
Piotr Jawniak
0b9e4fcaff Update few files after comparison traits renaming
There were still Total{Ord,Eq} in docs and src/etc
2014-06-22 09:31:39 +02:00
bors
0ae4b97c09 auto merge of #15029 : aturon/rust/stability-index, r=brson
This commit makes several changes to the stability index infrastructure:

* Stability levels are now inherited lexically, i.e., each item's
  stability level becomes the default for any nested items.

* The computed stability level for an item is stored as part of the
  metadata. When using an item from an external crate, this data is
  looked up and cached.

* The stability lint works from the computed stability level, rather
  than manual stability attribute annotations. However, the lint still
  checks only a limited set of item uses (e.g., it does not check every
  component of a path on import). This will be addressed in a later PR,
  as part of issue #8962.

* The stability lint only applies to items originating from external
  crates, since the stability index is intended as a promise to
  downstream crates.

* The "experimental" lint is now _allow_ by default. This is because
  almost all existing crates have been marked "experimental", pending
  library stabilization. With inheritance in place, this would generate
  a massive explosion of warnings for every Rust program.

  The lint should be changed back to deny-by-default after library
  stabilization is complete.

* The "deprecated" lint still warns by default.

The net result: we can begin tracking stability index for the standard
libraries as we stabilize, without impacting most clients.

Closes #13540.
2014-06-21 04:01:25 +00:00
Patrick Walton
dcbf4ec2a1 librustc: Put #[unsafe_destructor] behind a feature gate.
Closes #8142.

This is not the semantics we want long-term. You can continue to use
`#[unsafe_destructor]`, but you'll need to add
`#![feature(unsafe_destructor)]` to the crate attributes.

[breaking-change]
2014-06-20 14:24:31 -07:00
bors
311890ccfe auto merge of #15048 : brson/rust/toc-margin, r=alexcrichton
There is no space between the TOC and the succeeding para.

See http://doc.rust-lang.org/guide-pointers.html for example.
2014-06-20 11:01:33 +00:00
bors
a7a18dee72 auto merge of #15041 : brson/rust/docindex, r=alexcrichton
Splits 'extern resources' into 'external documentation and 'community',
adds rustforrubyists.com, rustbyexample.com, stackoverflow.com.
2014-06-20 03:16:26 +00:00
bors
282705c784 auto merge of #15039 : huonw/rust/rustdoc-testharnesss, r=alexcrichton
```test_harness
    #[test]
    fn foo() {}
    ```

will now compile and run the tests, rather than just ignoring & stripping them (i.e. it is as if `--test` was passed).

Also, the specific example in https://github.com/rust-lang/rust/issues/12242 was fixed (but that issue is broader than that example).
2014-06-20 01:31:28 +00:00
Brian Anderson
e698a397a8 doc: Fix margins around tables of contents
There is no space between the TOC and the succeeding para.
2014-06-19 16:14:49 -07:00
Huon Wilson
cb6219f396 testing guide: update to use test_harness & fix problems.
rustdoc now supports compiling things with `--test` so the examples in
this guide can be compiled & tested properly (revealing a few issues &
out-dated behaviours).

Also, reword an example to be clearer, cc #12242.
2014-06-20 07:59:27 +10:00
Brian Anderson
792d5b742c doc: Add disclaimers about versions of external docs 2014-06-19 11:45:16 -07:00
Brian Anderson
05641413a7 Update the external links in the doc index
Splits 'extern resources' into 'external documentation and 'community',
adds rustforrubyists.com and rustbyexample.com, stackoverflow.com.
2014-06-19 10:52:02 -07:00
Huon Wilson
11bdeea767 rustdoc: add the ability to run tests with --test.
This adds the `test_harness` directive that runs a code block using the
test runner, to allow for `#[test]` items to be demonstrated and still
tested (currently they are just stripped and not even compiled, let
alone run).
2014-06-19 23:11:18 +10:00
Aaron Turon
6008f2c982 Add stability inheritance
This commit makes several changes to the stability index infrastructure:

* Stability levels are now inherited lexically, i.e., each item's
  stability level becomes the default for any nested items.

* The computed stability level for an item is stored as part of the
  metadata. When using an item from an external crate, this data is
  looked up and cached.

* The stability lint works from the computed stability level, rather
  than manual stability attribute annotations. However, the lint still
  checks only a limited set of item uses (e.g., it does not check every
  component of a path on import). This will be addressed in a later PR,
  as part of issue #8962.

* The stability lint only applies to items originating from external
  crates, since the stability index is intended as a promise to
  downstream crates.

* The "experimental" lint is now _allow_ by default. This is because
  almost all existing crates have been marked "experimental", pending
  library stabilization. With inheritance in place, this would generate
  a massive explosion of warnings for every Rust program.

  The lint should be changed back to deny-by-default after library
  stabilization is complete.

* The "deprecated" lint still warns by default.

The net result: we can begin tracking stability index for the standard
libraries as we stabilize, without impacting most clients.

Closes #13540.
2014-06-18 22:22:26 -07:00
Simon Sapin
108b8b6dc7 Deprecate the bytes!() macro.
Replace its usage with byte string literals, except in `bytes!()` tests.
Also add a new snapshot, to be able to use the new b"foo" syntax.

The src/etc/2014-06-rewrite-bytes-macros.py script automatically
rewrites `bytes!()` invocations into byte string literals.
Pass it filenames as arguments to generate a diff that you can inspect,
or `--apply` followed by filenames to apply the changes in place.
Diffs can be piped into `tip` or `pygmentize -l diff` for coloring.
2014-06-18 17:02:22 -07:00
bors
d6736a1440 auto merge of #14880 : SimonSapin/rust/byte-literals, r=alexcrichton
See #14646 (tracking issue) and rust-lang/rfcs#69.

This does not close the tracking issue, as the `bytes!()` macro still needs to be removed. It will be later, after a snapshot is made with the changes in this PR, so that the new syntax can be used when bootstrapping the compiler.
2014-06-18 02:06:37 +00:00
Simon Sapin
3a52a8a8b8 Document the byte, byte string, and raw byte string literals. 2014-06-17 23:43:18 +02:00
Patrick Walton
cad760b770 librustc: Make addresses of immutable statics insignificant unless
`#[inline(never)]` is used.

Closes #8958.

This can break some code that relied on the addresses of statics
being distinct; add `#[inline(never)]` to the affected statics.

[breaking-change]
2014-06-17 11:44:00 -07:00
Niklas Koep
7fec86b5e2 tutorial.md: tiny correction for --crate-type=lib
Compiling a crate with `rustc --crate-type=lib` produces an rlib file, not a shared object. The latter is only produced for `--crate-type=dylib`.
2014-06-17 15:28:59 +02:00
Christopher Bergqvist
56d7bbe263 Update Sublime Rust github link
Package switched maintainer from dbp to jhasse as stated in the README.md at the old link.
2014-06-16 18:16:42 -07:00
Brian Anderson
f4ae8a83f9 Update repo location 2014-06-16 18:16:36 -07:00
Alex Crichton
ebac770abb doc: Fix a link in the FAQ
Closes #14914
2014-06-16 18:16:29 -07:00
Alex Crichton
3324257833 rustc: Start accepting *const T
This does not yet change the compiler and libraries from `*T` to `*const T` as
it will require a snapshot to do so.

cc #7362
2014-06-16 16:58:17 -07:00
Alex Crichton
89b0e6e12b Register new snapshots 2014-06-15 23:30:24 -07:00
bors
8b87c3a2a8 auto merge of #14809 : zzmp/rust/patch-2, r=alexcrichton
Previously, the type system's restrictions on borrowing were summarized as

> The previous example showed that the type system forbids any borrowing of owned boxes found in aliasable, mutable memory.

This did not jive with the example, which allowed mutations so long as the borrowed reference had been returned. Also, the language has changed to no longer allow aliasable mutable locations. This changes the summary to read

> The previous example showed that the type system forbids mutations of owned boxed values while they are being borrowed. In general, the type system also forbids borrowing a value as mutable if it is already being borrowed - either as a mutable reference or an immutable one.

This adds more general information for the experienced reader as well, to offer a more complete understanding.
2014-06-12 16:02:05 +00:00
bors
c0a6f72e8b auto merge of #14805 : zzmp/rust/patch-1, r=alexcrichton
The guide previously stated:

> The compiler will automatically convert a box box point to a reference like &amp;point.

This fixes the doubled word `box`, so the statement reads

> The compiler will automatically convert a box point to a reference like &amp;point.

The code it is referring to is `compute_distance(&on_the_stack, on_the_heap);`, so a single `box` is appropriate.
2014-06-12 14:17:13 +00:00
bors
614e448b02 auto merge of #14800 : reem/rust/patch-1, r=alexcrichton
According to #14767 and the grammar right above this documentation, nested comments are supported.
2014-06-12 10:47:03 +00:00
bors
fce98e5262 auto merge of #14799 : mcreinhard/rust/tilde-fix, r=alexcrichton
Replaced `~Drawable` with `Box<Drawable>` in tutorial
2014-06-11 22:02:00 -07:00
bors
f9260d41d6 auto merge of #14746 : alexcrichton/rust/libsync, r=brson
This commit is the final step in the libstd facade, #13851. The purpose of this
commit is to move libsync underneath the standard library, behind the facade.
This will allow core primitives like channels, queues, and atomics to all live
in the same location.

There were a few notable changes and a few breaking changes as part of this
movement:

* The `Vec` and `String` types are reexported at the top level of libcollections
* The `unreachable!()` macro was copied to libcore
* The `std::rt::thread` module was moved to librustrt, but it is still
  reexported at the same location.
* The `std::comm` module was moved to libsync
* The `sync::comm` module was moved under `sync::comm`, and renamed to `duplex`.
  It is now a private module with types/functions being reexported under
  `sync::comm`. This is a breaking change for any existing users of duplex
  streams.
* All concurrent queues/deques were moved directly under libsync. They are also
  all marked with #![experimental] for now if they are public.
* The `task_pool` and `future` modules no longer live in libsync, but rather
  live under `std::sync`. They will forever live at this location, but they may
  move to libsync if the `std::task` module moves as well.

[breaking-change]
2014-06-11 11:47:04 -07:00
Alex Crichton
b1c9ce9c6f sync: Move underneath libstd
This commit is the final step in the libstd facade, #13851. The purpose of this
commit is to move libsync underneath the standard library, behind the facade.
This will allow core primitives like channels, queues, and atomics to all live
in the same location.

There were a few notable changes and a few breaking changes as part of this
movement:

* The `Vec` and `String` types are reexported at the top level of libcollections
* The `unreachable!()` macro was copied to libcore
* The `std::rt::thread` module was moved to librustrt, but it is still
  reexported at the same location.
* The `std::comm` module was moved to libsync
* The `sync::comm` module was moved under `sync::comm`, and renamed to `duplex`.
  It is now a private module with types/functions being reexported under
  `sync::comm`. This is a breaking change for any existing users of duplex
  streams.
* All concurrent queues/deques were moved directly under libsync. They are also
  all marked with #![experimental] for now if they are public.
* The `task_pool` and `future` modules no longer live in libsync, but rather
  live under `std::sync`. They will forever live at this location, but they may
  move to libsync if the `std::task` module moves as well.

[breaking-change]
2014-06-11 10:00:43 -07:00
Alex Crichton
54c2a1e1ce rustc: Move the AST from @T to Gc<T> 2014-06-11 09:51:37 -07:00
Zach Pomerantz
4f90025b68 Update description to reflect language changes
Previously, the type system's restrictions on borrowing were summarized as

> The previous example showed that the type system forbids any borrowing of owned boxes found in aliasable, mutable memory

This did not jive with the example, which allowed mutations so long as the borrowed reference had been returned. Also, the language has changed to no longer allow aliasable mutable locations. This changes the summary to read

> The previous example showed that the type system forbids mutations of owned boxed values while they are being borrowed. In general, the type system also forbids borrowing a value as mutable if it is already being borrowed - either as a mutable reference or an immutable one.

This adds more general information for the experienced reader as well, to offer a more complete understanding.
2014-06-10 17:36:02 -07:00
Zach Pomerantz
782c52a924 Removed doubled wording.
The guide previously stated:

> The compiler will automatically convert a box box point to a reference like &amp;point.

This fixes the doubled word `box`, so the statement reads

> The compiler will automatically convert a box point to a reference like &amp;point.

The code it is referring to is `compute_distance(&on_the_stack, on_the_heap);`, so a single `box` is appropriate.
2014-06-10 16:53:04 -07:00
Jonathan Reem
e5ebdb4c07 Remove outdated info about nested block comments. Fixes #14767 2014-06-10 15:58:54 -07:00
Michael Reinhard
a0eca23786 Fix deprecated use of ~ 2014-06-10 14:44:27 -07:00
Keegan McAllister
aca0bac29f Convert libraries to use #[plugin_registrar] 2014-06-09 14:29:30 -07:00
Keegan McAllister
84243ed6e1 Use phase(plugin) in other crates 2014-06-09 14:29:30 -07:00
Alex Crichton
e5bbbca33e rustdoc: Submit examples to play.rust-lang.org
This grows a new option inside of rustdoc to add the ability to submit examples
to an external website. If the `--markdown-playground-url` command line option
or crate doc attribute `html_playground_url` is present, then examples will have
a button on hover to submit the code to the playground specified.

This commit enables submission of example code to play.rust-lang.org. The code
submitted is that which is tested by rustdoc, not necessarily the exact code
shown in the example.

Closes #14654
2014-06-06 20:00:16 -07:00
Alex Crichton
cc63d4c61b doc: Turn off special features for rustdoc tests
These were only used for the markdown tests, and there's no reason they should
be distinct from the other tests.
2014-06-06 20:00:07 -07:00
bors
8a414858ac auto merge of #14680 : Kimundi/rust/master, r=brson
Also updated/corrected a few other details in the tuple and struct sections.
2014-06-06 15:21:59 -07:00
bors
732e057815 auto merge of #14667 : aochagavia/rust/pr2, r=huonw 2014-06-06 01:21:54 -07:00
Adolfo Ochagavía
501b904bb7 Change to_str().to_string() to just to_str() 2014-06-06 09:56:59 +02:00
bors
ae9577052d auto merge of #14664 : reem/rust/lifetimes-guide-grammar, r=brson
Removed strange fragment-like thing in the intro.
2014-06-05 20:16:53 -07:00
Alex Crichton
760b93adc0 Fallout from the libcollections movement 2014-06-05 13:55:11 -07:00
Marvin Löbel
792fae35f7 Purged "record" from the manual.
Also updated/corrected a few other details in the tuple and struct sections.
2014-06-05 21:31:57 +02:00
Jonathan Reem
7e0cc34d62 Fixed weird grammar in lifetimes guide. 2014-06-04 22:27:21 -07:00
bors
073c8f10fc auto merge of #14592 : alexcrichton/rust/rustdoc-links, r=huonw
These are a few assorted fixes for some issues I found this morning (details in the commits).
2014-06-04 22:21:43 -07:00
Brian Anderson
9b228f8424 core: Apply stability attributes to ptr mod
* null and mut_null are unstable. Their names may change if the unsafe
  pointer types change.
* copy_memory and copy_overlapping_memory are unstable. We think they
  aren't going to change.
* set_memory and zero_memory are experimental. Both the names and
  the semantics are under question.
* swap and replace are unstable and probably won't change.
* read is unstable, probably won't change
* read_and_zero is experimental. It's necessity is in doubt.
* mem::overwrite is now called ptr::write to match read and is
  unstable. mem::overwrite is now deprecated
* array_each, array_each_with_len, buf_len, and position are
  all deprecated because they use old style iteration and their
  utility is generally under question.
2014-06-04 18:21:21 -07:00
bors
7fa5baa7ca auto merge of #14622 : reillywatson/rust/master, r=alexcrichton 2014-06-03 10:01:40 -07:00
Reilly Watson
5b80172f10 Doc: grammar fix in intro.md 2014-06-03 10:24:54 -04:00
bors
63e9b8f105 auto merge of #14601 : skade/rust/remove-notrust-tags, r=alexcrichton
Now that rustdoc understands proper language tags
as the code not being Rust, we can tag everything
properly. `norust` as a negative statement is a bad
tag.

This change tags examples in other languages by
their language. Plain notations are marked as `text`.
Console examples are marked as `console`.

Also fix markdown.rs to not highlight non-rust code.

Amends the documentation to reflect the new
behaviour.
2014-06-02 17:16:31 -07:00
klutzy
e38fde71b1 doc: Remove use of pub use globs 2014-06-02 23:21:35 +09:00
Florian Gilcher
20fb7c62d4 docs: Stop using notrust
Now that rustdoc understands proper language tags
as the code not being Rust, we can tag everything
properly.

This change tags examples in other languages by
their language. Plain notations are marked as `text`.
Console examples are marked as `console`.

Also fix markdown.rs to not highlight non-rust code.
2014-06-02 12:37:54 +02:00
Alex Crichton
0dbfa5f611 rustdoc: Fix some more broken links 2014-06-01 21:53:43 -07:00
bors
dfaea70963 auto merge of #14578 : huonw/rust/as_slice-cheatsheet, r=sfackler
doc: add an `.as_slice` example to the cheatsheet.

A lot of questions about this on IRC and stackoverflow.
2014-06-01 02:36:39 -07:00
Alex Crichton
7ec6df5f45 rustdoc: Fix cross-crate links to reexported items
Cross crate links can target items which are not rendered in the documentation.
If the item is reexported at a higher level, the destination of the link (a
concatenation of the fully qualified name) may actually lead to nowhere. This
fixes this problem by altering rustdoc to emit pages which redirect to the local
copy of the reexported structure.

cc #14515
Closes #14137
2014-05-31 21:59:50 -07:00
Alex Crichton
c5830a954e doc: Fix a number of broken links
cc #14515
2014-05-31 21:59:50 -07:00
Huon Wilson
aec7f46902 doc: add an .as_slice example to the cheatsheet.
A lot of questions about this on IRC and stackoverflow.
2014-06-01 14:13:10 +10:00
bors
ee97698f85 auto merge of #14567 : cburgdorf/rust/patch-2, r=brson
This rewrites the example to also be more aligned with
the same example given in the main tutorial.
2014-05-31 20:01:45 -07:00
Christoph Burgdorf
ade5a9d2fe Fix example in lifetime guide
This rewrites the example to also be more aligned with
the same example given in the main tutorial.
2014-05-31 23:41:50 +02:00
Christoph Burgdorf
b657af8946 Rename variable in tutorial
Renamed `owned_box` to `on_the_heap` to use a consistent
naming across the tutorial and the life time guide.
Also it makes the example easier to grasp.
2014-05-31 23:33:03 +02:00
bors
2652ba1505 auto merge of #14555 : tomjakubowski/rust/fix-snappy-link, r=alexcrichton
Google have migrated snappy to GitHub.
2014-05-31 02:46:38 -07:00
bors
faa7ba75a7 auto merge of #14553 : reem/rust/nuke-owned-vectors, r=alexcrichton
I removed all remaining deprecated owned vectors from the docs. All example tests pass.
2014-05-31 01:06:40 -07:00
Jonathan Reem
1959925e51 Remove deprecated owned vector from tutorial. 2014-05-30 21:30:21 -07:00
Jonathan Reem
66ee71a517 Remove deprecated owned vector from rust.md 2014-05-30 21:30:21 -07:00
Jonathan Reem
f740e8dde1 Remove deprecated owned vector from macro guide. 2014-05-30 21:30:20 -07:00
Jonathan Reem
c3825cbb9d Remove deprecated owned vector from intro. 2014-05-30 21:30:20 -07:00
Jonathan Reem
0033a8b269 Remove deprecated owned vector from complement cheatsheet. 2014-05-30 21:30:18 -07:00
Tom Jakubowski
7cd4879126 Fix outgoing link to snappy in the FFI guide
Google have migrated snappy to GitHub.
2014-05-30 21:27:47 -07:00