Commit Graph

204 Commits

Author SHA1 Message Date
Brian Anderson
ad66f56afd doc: Add "A 30-minute Introduction to Rust"
By Steve Klabnik.
2014-04-09 17:43:26 -07:00
Alex Crichton
c3ea3e439f Register new snapshots 2014-04-08 00:03:11 -07:00
Alex Crichton
c83afb9719 doc: Document flavorful variations of paths
Closes #4293
2014-04-08 00:03:11 -07:00
bors
e4779b5050 auto merge of #13165 : sfackler/rust/io-vec, r=alexcrichton
`Reader`, `Writer`, `MemReader`, `MemWriter`, and `MultiWriter` now work with `Vec<u8>` instead of `~[u8]`. This does introduce some extra copies since `from_utf8_owned` isn't usable anymore, but I think that can't be helped until `~str`'s representation changes.
2014-04-06 23:36:38 -07:00
Steven Fackler
49a8081095 De-~[] Mem{Reader,Writer} 2014-04-06 15:40:01 -07:00
bors
d73bd64f44 auto merge of #13345 : bjz/rust/irc, r=alexcrichton
This adds links to `#rust-gamedev`, `#rust-internals`, and `#rust-osdev`.
2014-04-06 08:26:34 -07:00
bors
f1f50565a1 auto merge of #13315 : alexcrichton/rust/libc, r=alexcrichton,me
Rebasing of #12526 with a very obscure bug fixed on windows.
2014-04-06 02:56:39 -07:00
Alex Crichton
d1c584e41b syntax: Tweak parsing lifetime bounds on closures
In summary these are some example transitions this change makes:

    'a ||       => ||: 'a
    proc:Send() => proc():Send

The intended syntax for closures is to put the lifetime bound not at the front
but rather in the list of bounds. Currently there is no official support in the
AST for bounds that are not 'static, so this case is currently specially handled
in the parser to desugar to what the AST is expecting. Additionally, this moves
the bounds on procedures to the correct position, which is after the argument
list.

The current grammar for closures and procedures is:

    procedure := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')'
                        [ ':' bound-list ] [ '->' type ]
    closure := [ 'unsafe' ] ['<' lifetime-list '>' ] '|' arg-list '|'
                        [ ':' bound-list ] [ '->' type ]
    lifetime-list := lifetime | lifetime ',' lifetime-list
    arg-list := ident ':' type | ident ':' type ',' arg-list
    bound-list := bound | bound '+' bound-list
    bound := path | lifetime

This does not currently handle the << ambiguity in `Option<<'a>||>`, I am
deferring that to a later patch. Additionally, this removes the support for the
obsolete syntaxes of ~fn and &fn.

Closes #10553
Closes #10767
Closes #11209
Closes #11210
Closes #11211
2014-04-06 00:08:21 -07:00
Brendan Zabarauskas
f94453cc3d Mention more IRC channels on the documentation homepage
This adds links to `#rust-gamedev`, `#rust-internals`, and `#rust-osdev`.
2014-04-06 06:01:42 +10:00
bors
2dcdc75c6c auto merge of #13332 : mbrubeck/rust/doc-edit, r=huonw
Also add the new `proc` keyword to the documentation.
2014-04-05 07:21:36 -07:00
bors
3bfa05021d auto merge of #13329 : ckendell/rust/remmanaged_tutorial, r=brson
Fixes #13287
Completes work started in #13298

Removed all reference to and sample code using managed boxes/pointers.
2014-04-05 03:21:34 -07:00
Matt Brubeck
fbba696a46 Remove references to obsolete do keyword
Also add the new `proc` keyword to the documentation.
2014-04-04 17:33:20 -07:00
Christopher Kendell
dab5de268d Removed all instance of @ in code examples. 2014-04-04 16:26:33 -07:00
Christopher Kendell
51ea4fb17f Small change to example to make variable values more sensible. 2014-04-04 16:25:52 -07:00
Timothée Ravier
73b0186290 Fix inner attribute syntax from #[foo]; to #![foo]
From the 0.10 changelog:
 * The inner attribute syntax has changed from `#[foo];` to `#![foo]`.
2014-04-04 13:22:57 -07:00
Corey Richardson
0459ee77d0 Fix fallout from std::libc separation 2014-04-04 09:31:44 -07:00
bors
46e6194ee1 auto merge of #13298 : ckendell/rust/remove_managed_pointers_from_tutorial, r=cmr
Work on #13287 

This is not ready for a merge yet, but I wanted to get some eyes on what I have done so far.

As of right now, all references in the text to managed boxes or pointers are removed. Code associated with those specific sections of text have likewise been altered. I also removed all references to managed closures.

There is a small change I would like to add to the work done in 3137cd5, on the new lines 1495 and 1496, I would like to change those values to 10 and 20. I did the same in a later change on lines 1596 and 1508.

There are still bits of sample code that use managed pointers and the sigil @. Those are next on my list to remove, but I wanted to have the outstanding changes reviewed first. The uses of @ in the code samples are a bit more embedded, and I will need to be more careful changing them as to not change the purpose of the code examples.

I ensured that make check still passes, although I'm not sure if that actually tests the code in tutorial.md.

One issues I ran into, and tried to avoid, was that `tutorial.md` is formatted with a nice column limit. I was unsure how this was enforced, so wherever I edited a line, I did my best to keep edits on the line they previously existed on. As such, the plain text of `tutorial.md` looks a bit strange as I've left it, and I will clean that up as suggested. The rendered markdown output should not be affected.
2014-04-04 07:26:51 -07:00
Corey Richardson
b727bb7feb manual: fix a broken example 2014-04-04 04:08:13 -04:00
Corey Richardson
838a57ba9e manual: refine ECMA-335 reference for attributes 2014-04-04 02:10:22 -04:00
Corey Richardson
d2648cc23f manual: further attribute clarifications
- Sort attributes lexicographically
- Use new attribute syntax consistently
- Fix wording describing new attribute syntax
- Expand section on `repr`
2014-04-04 02:09:49 -04:00
Corey Richardson
a86d6b4cc9 manual: fix attribute ebnf 2014-04-04 02:08:53 -04:00
Corey Richardson
13ac12db1c manual: update style 2014-04-04 02:08:50 -04:00
Corey Richardson
2eccb1d0c2 manual: many fixes
Mostly around attributes and language items.
2014-04-04 00:52:41 -04:00
Corey Richardson
a410833a7f manual: update the note about reserved attributes 2014-04-04 00:52:41 -04:00
bors
2a2d0dce87 auto merge of #13296 : brson/rust/0.11-pre, r=alexcrichton
This also changes some of the download links in the documentation
to 'nightly'.
2014-04-03 19:56:45 -07:00
bors
e7fe207229 auto merge of #13290 : alexcrichton/rust/rollup, r=alexcrichton
Closes #13285 (rustc: Stop using LLVMGetSectionName)
Closes #13280 (std: override clone_from for Vec.)
Closes #13277 (serialize: add a few missing pubs to base64)
Closes #13275 (Add and remove some ignore-win32 flags)
Closes #13273 (Removed managed boxes from libarena.)
Closes #13270 (Minor copy-editing for the tutorial)
Closes #13267 (fix Option<~ZeroSizeType>)
Closes #13265 (Update emacs mode to support new `#![inner(attribute)]` syntax.)
Closes #13263 (syntax: Remove AbiSet, use one Abi)
2014-04-03 17:17:02 -07:00
Brian Anderson
0875ffcbff Bump version to 0.11-pre
This also changes some of the download links in the documentation
to 'nightly'.
2014-04-03 16:28:46 -07:00
Christopher Kendell
be07cab2cf Removed all references to managed closures. 2014-04-03 15:48:32 -07:00
Christopher Kendell
3137cd5af6 Removed references to managed boxes/pointers from the tutorial text. Code
examples in relevant sections were similarly altered.
2014-04-03 15:38:19 -07:00
bors
bb31cb8d2e auto merge of #13286 : alexcrichton/rust/release, r=brson
Merging the 0.10 release into the master branch.
2014-04-03 13:52:03 -07:00
Matt Brubeck
1ac8b34ccd Minor spelling/grammar/usage fixes.
Note: "different to" is not exactly incorrect, but "different from" is more
commonly accepted in both US and Commonwealth English, and also more
consistent with other usage within this tutorial.
2014-04-03 13:43:24 -07:00
Matt Brubeck
544516ac63 Fix reference to "these two traits."
There are actually three traits listed.
2014-04-03 13:43:24 -07:00
Matt Brubeck
c1e52c71ca extern crate and mod are not easily confused
Remove some statements that used to refer to similarities between `mod` and
`extern mod`, before the latter was renamed to `extern crate`.
2014-04-03 13:43:24 -07:00
Benjamin Herr
78af0f7636 doc: Remove dated "libgreen is default" statement. 2014-04-02 16:56:31 +02:00
bors
b06b3667af auto merge of #13235 : klutzy/rust/doc-faq-win, r=alexcrichton 2014-04-01 22:41:42 -07:00
bors
1217cfb9e7 auto merge of #13225 : thestinger/rust/num, r=cmr
The `Float` trait methods will be usable as functions via UFCS, and
we came to a consensus to remove duplicate functions like this a long
time ago.

It does still make sense to keep the duplicate functions when the trait
methods are static, unless the decision to leave out the in-scope trait
name resolution for static methods changes.
2014-04-01 13:26:49 -07:00
klutzy
e481ced80f doc: Update windows status on FAQ 2014-04-01 14:42:04 +09:00
Alex Crichton
37a3131640 doc: Update with changes in field privacy 2014-03-31 15:47:37 -07:00
Daniel Micay
8ca5caf4d9 num: rm wrapping of Float methods as functions
The `Float` trait methods will be usable as functions via UFCS, and
we came to a consensus to remove duplicate functions like this a long
time ago.

It does still make sense to keep the duplicate functions when the trait
methods are static, unless the decision to leave out the in-scope trait
name resolution for static methods changes.
2014-03-31 17:41:52 -04:00
Alex Crichton
a5681d2590 Bump version to 0.10 2014-03-31 14:40:44 -07:00
Brian Anderson
ee052198c5 Rename from_iterator to from_iter for consistency. 2014-03-30 21:45:55 -07:00
Marvin Löbel
c356e3ba6a Removed deprecated functions map and flat_map for vectors and slices. 2014-03-30 03:47:04 +02:00
bors
8610e4a7a0 auto merge of #13168 : jankobler/rust/verify-grammar-02, r=brson
This fixes some problems  with

     make verify-grammar

llnextgen still reports a lot of errors

FYI: My build directory /my-test/build is different from the source directory /my-test/rust.
cd  /my-test/build
/my-test/rust/configure --prefix=/my-test/bin
make
make install
make verify-grammar
2014-03-28 23:01:43 -07:00
Flavio Percoco
81ec1f3c18 Rename Pod into Copy
Summary:
So far, we've used the term POD "Plain Old Data" to refer to types that
can be safely copied. However, this term is not consistent with the
other built-in bounds that use verbs instead. This patch renames the Pod
kind into Copy.

RFC: 0003-opt-in-builtin-traits

Test Plan: make check

Reviewers: cmr

Differential Revision: http://phabricator.octayn.net/D3
2014-03-28 10:34:02 +01:00
Alex Crichton
8d0be731f5 doc: Update the tutorial about bounds for traits 2014-03-27 13:08:48 -07:00
Jan Kobler
fdfb9ebcf6 verify-grammar llnextgen
When calling

    make verify-grammar

a lot of errors are reported by llnextgen.

Only simple errors like:

  missing semicolons,
  missing single quotes,
  usage of parentheses instead of squared brackets or
  usage of single quote instead of double quote

are fixed by this patch.

This can only be tested, when llnextgen is installed.

Signed-off-by: Jan Kobler <eng1@koblersystems.de>
2014-03-27 11:19:06 +01:00
Jan Kobler
2b05263bc3 verify-grammar keyword crate
When calling

   make verify-grammar

or when llnextgen is not installed:

   python2.7 src/etc/extract_grammar.py <src/doc/rust.md

an error is reported by extract_grammar.py that the

keyword "crate" is not defined.

This patch adds the keyword "crate" to the grammar in rust.md.

Signed-off-by: Jan Kobler <eng1@koblersystems.de>
2014-03-27 11:18:02 +01:00
bors
de85948ac0 auto merge of #13117 : alexcrichton/rust/no-crate-map, r=brson
This can be done now that logging has been moved out and libnative is the default (not libgreen)
2014-03-26 01:41:57 -07:00
bors
e28f081cc2 auto merge of #13106 : CLUSTERfoo/rust/docs/labelled_breaks, r=brson
* Include tip given by Leo Testard in mailing list about labeled `break`
and `continue`:
https://mail.mozilla.org/pipermail/rust-dev/2014-March/009145.html
* cross-reference named lifetimes in tutorial -> lifetimes guide
* Broke named lifetimes section into two sub-sections.
* Added mention of `'static` lifetime.
2014-03-25 21:51:58 -07:00
bors
6bf3fca8ff auto merge of #12900 : alexcrichton/rust/rewrite-sync, r=brson
* Remove clone-ability from all primitives. All shared state will now come
  from the usage of the primitives being shared, not the primitives being
  inherently shareable. This allows for fewer allocations for stack-allocated
  primitives.
* Add `Mutex<T>` and `RWLock<T>` which are stack-allocated primitives for purely
  wrapping a piece of data
* Remove `RWArc<T>` in favor of `Arc<RWLock<T>>`
* Remove `MutexArc<T>` in favor of `Arc<Mutex<T>>`
* Shuffle around where things are located
  * The `arc` module now only contains `Arc`
  * A new `lock` module contains `Mutex`, `RWLock`, and `Barrier`
  * A new `raw` module contains the primitive implementations of `Semaphore`,
    `Mutex`, and `RWLock`
* The Deref/DerefMut trait was implemented where appropriate
* `CowArc` was removed, the functionality is now part of `Arc` and is tagged
  with `#[experimental]`.
* The crate now has #[deny(missing_doc)]
* `Arc` now supports weak pointers

This is not a large-scale rewrite of the functionality contained within the
`sync` crate, but rather a shuffling of who does what an a thinner hierarchy of
ownership to allow for better composability.
2014-03-24 18:11:51 -07:00