Commit Graph

1058 Commits

Author SHA1 Message Date
Armin Ronacher
8cb1a290a8 Removed drop from the keyword list in the docs 2013-07-04 11:56:11 +02:00
Huon Wilson
eee6775642 Implement consuming iterators for ~[], remove vec::{consume, consume_reverse, map_consume}. 2013-07-04 00:46:49 +10:00
bors
55f155521d auto merge of #7523 : huonw/rust/uppercase-statics-lint, r=cmr
Adds a lint for `static some_lowercase_name: uint = 1;`. Warning by default since it causes confusion, e.g. `static a: uint = 1; ... let a = 2;` => `error: only refutable patterns allowed here`.
2013-07-03 04:31:50 -07:00
Steven Fackler
c63b3f8e28 Removing the rename warning
Now that the finalize->drop rename has happened, this hopefully
shouldn't end up changing again.
2013-07-02 09:58:24 -07:00
Steven Fackler
863e75f0a1 Fixed documentation for finalize->drop change 2013-07-02 09:58:18 -07:00
Brian Anderson
a2db7c15ce doc: Update links to 0.7 2013-07-02 09:25:44 -07:00
Steven Fackler
3e265e7842 Small documentation changes
I'm leaving the Sized kind undocumented since it isn't fully implemented
yet.
2013-07-01 23:37:11 -07:00
Huon Wilson
c437a16c5d rustc: add a lint to enforce uppercase statics. 2013-07-01 17:52:57 +10:00
Patrick Walton
a1531ed946 librustc: Remove the broken overloaded assign-ops from the language.
They evaluated the receiver twice. They should be added back with
`AddAssign`, `SubAssign`, etc., traits.
2013-06-28 10:44:16 -04:00
Patrick Walton
f9b54541ee librustc: Disallow "mut" from distributing over bindings.
This is the backwards-incompatible part of per-binding-site "mut".
2013-06-28 10:44:15 -04:00
Daniel Micay
659cd55e75 add a tutorial on containers and iterators 2013-06-28 00:24:09 -04:00
Tim Chevalier
d805859ff5 rustpkg: Update manual 2013-06-27 23:20:43 -04:00
Huon Wilson
29b0649a6a Convert vec::{push, push_all, push_all_move} to methods. 2013-06-28 00:20:42 +10:00
bors
22408d9ad5 auto merge of #7269 : luqmana/rust/drop, r=thestinger
Finally rename finalize to drop.
Closes #4332.
2013-06-25 20:29:06 -07:00
Luqman Aden
ca2966c6d0 Change finalize -> drop. 2013-06-25 21:14:39 -04:00
Daniel Micay
e67c48a591 remove each from vec, HashMap and HashSet 2013-06-25 16:28:02 -04:00
bors
3b126e4d6d auto merge of #7274 : thestinger/rust/size_hint, r=huonw
I ran into a weird lifetime bug blocking updating the `collect` method to use `FromIterator`, but everything here works fine.
2013-06-22 23:07:55 -07:00
Daniel Micay
d2e9912aea vec: remove BaseIter implementation
I removed the `static-method-test.rs` test because it was heavily based
on `BaseIter` and there are plenty of other more complex uses of static
methods anyway.
2013-06-23 02:05:20 -04:00
bors
fc83d82fec auto merge of #7204 : alexcrichton/rust/deriving-to-string, r=pcwalton
Closes #7180 and #7179.

Before, the `deriving(ToStr)` attribute was essentially `fmt!("%?")`. This changes it to recursively invoke `to_str()` on fields instead of relying on `fmt!`-style things. This seems more natural to me and what should actually be expected.
2013-06-22 17:13:51 -07:00
Daniel Micay
ef07d7c46e Merge pull request #7270 from thestinger/doc
accumulated doc pull requests from the queue
2013-06-22 12:56:37 -07:00
Alex Crichton
30d755957a Expand the deriving(ToStr) implementation 2013-06-22 09:53:17 -07:00
Daniel Micay
49c74524e2 vec: rm old_iter implementations, except BaseIter
The removed test for issue #2611 is well covered by the `std::iterator`
module itself.

This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-21 03:20:22 -04:00
Ralph Bodenner
fd24cb7eae Usable instructions for generating docs from source 2013-06-21 00:56:43 -04:00
Huon Wilson
769c2e5f99 Minor doc updates to reflect #[deriving(Zero)], and small release notes adjustments.
The `extra::fileinput` module landed just after 0.6 was released, and there are many
more derivable traits.
2013-06-21 00:55:13 -04:00
Joris Rehm
87c110506d fix text of tutorials 2013-06-21 00:53:10 -04:00
bors
98bd68343c auto merge of #7184 : smvv/rust/doc_css, r=brson
After reading issue #7077, all header elements had a border. In my opinion those borders are a bit too much distraction. I tried a different approach with increasing the padding and font size, and omitting the borders.

Comparison:
http://smvv.io/rust-doc/std/hashmap.html
http://static.rust-lang.org/doc/std/hashmap.html

Note: the highlighted code blocks are not caused by this commit.

I left the border of the code block / function signature as is. The reason behind that is that code blocks are really block elements, while headers are not. What do you guys think?
2013-06-16 20:16:01 -07:00
Niko Matsakis
bada191309 Correct docs 2013-06-16 12:48:08 -04:00
Niko Matsakis
5fdb0cbb8c Correct tutorial tests 2013-06-16 12:47:36 -04:00
Sander Mathijs van Veen
64ccc60eee Remove h[123] border and increase their padding to better readability 2013-06-16 17:40:45 +02:00
Daniel Micay
7f00ab3df1 fix benchmark and the tutorials 2013-06-16 01:19:43 -04:00
Daniel Micay
d68be89e69 rm MutableIter
replaced with mutable implementations of Iterator
2013-06-14 23:15:42 -04:00
Daniel Micay
585f5f7f79 add IteratorUtil to the prelude 2013-06-14 23:15:42 -04:00
bors
26a5c9768b auto merge of #7077 : SiegeLord/rust/new_css, r=pnkfelix
I was making documentation for my own little Rust project, and I was somewhat unhappy with how the documentation looked. While many of the issues are endemic to how rustdoc generates its output, you can get pretty far in making the documentation readable by using a better CSS style.

This commit alters the CSS style used in Rust's documentation in order to make the various sections stand out more. You can see an example of its usage in my own project's documentation: http://siegelord.github.io/RustGnuplot/#implementation-for-figureself-where-self. I showed it to some people on IRC and they suggested that I make a pull request here. I tested it on the only browser that matters, but also Chrome and Opera.
2013-06-12 15:31:39 -07:00
Huon Wilson
3ac00a9489 std: remove substr & str::count_*, methodise char_len, implement slice_chars.
The confusing mixture of byte index and character count meant that every
use of .substr was incorrect; replaced by slice_chars which only uses
character indices. The old behaviour of `.substr(start, n)` can be emulated
via `.slice_from(start).slice_chars(0, n)`.
2013-06-12 12:21:04 +10:00
SiegeLord
d641b0b575 Alter rust.css to make the documentation look more appealing 2013-06-11 20:43:26 -04:00
Huon Wilson
7e6a5940cb std: convert pow, hypot, atan2, log to take arguments by reference. 2013-06-11 11:36:03 +10:00
Huon Wilson
e8782eeb63 fix tests, remove some warnings 2013-06-11 02:34:14 +10:00
Huon Wilson
a64e886e3c std: remove str::contains in favour of the method 2013-06-10 23:02:55 +10:00
Huon Wilson
c32fb53cf9 std: remove str::{len, slice, is_empty} in favour of methods. 2013-06-10 23:02:54 +10:00
Daniel Micay
de367157b5 remove deprecated vec::{is_empty, len} functions 2013-06-08 23:19:30 -04:00
Huon Wilson
513d2292e5 std: remove foldr and alli methods in vec 2013-06-09 02:22:23 +10:00
Huon Wilson
ed299af625 std: remove fold[lr] in favour of iterators 2013-06-09 02:22:23 +10:00
bors
1cf57f7b67 auto merge of #7003 : alco/rust/tutorial-block-expr, r=bstrie
This is something that's only been briefly mentioned in the beginning of
the tutorial and all of the closure examples within this subsection
include only one expression between { and }.
2013-06-07 23:40:25 -07:00
Alexei Sholik
93b2ddfc88 A reminder that a block is a single expr in closures
This is something that's only been briefly mentioned in the beginning of
the tutorial and all of the closure examples within this subsection
include only one expression between { and }.
2013-06-08 04:10:50 +03:00
Alexei Sholik
83b68a2f69 Mention for in the section on loops
The "4.3 Loops" section only describes `while` and `loop`. We then see `for`
used in a code sample at the end of the "13. Vectors and strings" section,
but it's explained for the first time only in the next section --
"14. Closures".

It is worth mentioning it in "4.3 Loops".
2013-06-08 03:17:56 +03:00
Ramkumar Ramachandra
dd923e3831 tutorial: fix for-loop example
Although in the example function `each` works as expected with
rust-0.6 (the latest release), it fails to even compile with `incoming`
rust (see test/compile-fail/bad-for-loop-2.rs). Change the function to
return a `bool` instead of `()`: this works fine with both versions of
rust, and does not misguide potential contributors.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-06 19:43:16 +05:30
Alexei Sholik
c7b19b04cb Fix duplicate words in the docs 2013-06-06 10:43:58 +03:00
Patrick Walton
8114d0e950 librustc: Disallow multiple patterns from appearing in a "let" declaration.
You can still initialize multiple variables at once with "let (x, y) = (1, 2)".
2013-06-04 21:45:42 -07:00
Tim Chevalier
5b09dca90b docs: Mention recently-added rustpkg features in the rustpkg manual 2013-06-02 17:21:01 -07:00
Daniel Micay
ed93cc1987 fix tutorial lint warnings 2013-05-31 18:20:09 -04:00
Daniel Micay
29aba8033a mv the raw pointer {swap,replace}_ptr to std::ptr 2013-05-31 10:31:26 -04:00
Gábor Horváth
0d9ea4e2d1 Minor grammar fix. 2013-05-30 15:26:25 +02:00
Gábor Horváth
9fd18a93b7 Minor style fix. 2013-05-30 15:24:08 +02:00
Gábor Horváth
e583d5a6b6 Minor documentation addition. 2013-05-30 15:20:30 +02:00
bors
31b2804fda auto merge of #6825 : caitp/rust/issue-6824, r=Aatch
Show `int_suffix_size` to appear 0 or 1 times
Show `exponent | . dec_lit` to appear 0 or 1 times, to show why `3f;` is a valid number
2013-05-29 22:58:35 -07:00
Caitlin Potter
bfe141c4e1 Fixes #6824 - Correct scan_number() grammar
Show `int_suffix_size` to appear 0 or 1 times
Show `exponent | . dec_lit` to appear 0 or 1 times, to show why `3f;` is a valid number
2013-05-30 00:51:16 -04:00
Patrick Walton
206ab89629 librustc: Stop reexporting the standard modules from prelude. 2013-05-29 19:04:53 -07:00
Olivier Saut
dea6677251 Add a short section on ARC 2013-05-26 19:10:16 +02:00
bors
5787bf3093 auto merge of #6711 : catamorphism/rust/issue-5700, r=thestinger
r? @nikomatsakis
2013-05-24 01:04:40 -07:00
Tim Chevalier
248a669381 docs: Don't mention obsolete move operator, as per #5700 2013-05-23 20:27:56 -07:00
Erick Tryzelaar
cc4fabcb43 Fix some std/extra language in the tutorial 2013-05-23 17:58:30 -07:00
Ted Horst
34cfd2183b more testing fallout from core->std/std->extra move 2013-05-23 15:06:29 -05:00
Corey Richardson
acf920fe4b Add static_assert doc blurb 2013-05-22 13:13:29 -04:00
John Clements
b71a1ecea2 added and rewrote text for 'do' and 'for' loops 2013-05-20 11:49:21 -07:00
bors
9f671698e6 auto merge of #6106 : thestinger/rust/iter, r=bstrie
I don't have a strong opinion on the function vs. method, but there's no point in having both. I'd like to make a `repeat` adaptor like Python/Haskell for turning a value into an infinite stream of the value, so this has to at least be renamed.
2013-05-19 08:13:30 -07:00
Daniel Micay
d953a5ce43 replace old_iter::repeat with the Times trait 2013-05-18 04:57:21 -04:00
Olivier Saut
3e41639a5e Add a small section on futures to the tutorial 2013-05-17 23:11:49 +02:00
Huon Wilson
cd2eb4701f syntax: implement #[deriving(DeepClone)]. Fixes #6514. 2013-05-16 22:55:08 +10:00
bors
2fc6b0998b auto merge of #6475 : sonwow/rust/tutorials, r=brson 2013-05-14 19:08:19 -07:00
Björn Steinbrink
bdc182cc41 Use static string with fail!() and remove fail!(fmt!())
fail!() used to require owned strings but can handle static strings
now. Also, it can pass its arguments to fmt!() on its own, no need for
the caller to call fmt!() itself.
2013-05-14 16:36:23 +02:00
Youngsoo Son
0c082047bc Replace shared/unique by managed/owned in the tutorial 2013-05-14 22:25:55 +09:00
bors
3abc5b3ffb auto merge of #6417 : pcwalton/rust/exprs-in-patterns, r=pcwalton
r? @graydon
2013-05-13 13:25:42 -07:00
Huon Wilson
d43908a3a7 doc: document the #[deriving] attribute.
Closes #4916.
2013-05-13 20:04:03 +10:00
Patrick Walton
06ef889cdc libsyntax: Remove extern mod foo { ... } from the language. 2013-05-12 16:33:15 -07:00
bors
9ee8d506d9 auto merge of #6398 : osaut/rust/master, r=bstrie
I have replaced io::println by println in the tutorial as I do not think it is needed anymore since it is already included in prelude.rs.
2013-05-11 15:10:44 -07:00
Alex Crichton
60803e5fc8 Fix tests with the swap operator 2013-05-10 22:51:06 -04:00
Alex Crichton
63c7e2f991 Remove the '<->' operator from the language 2013-05-10 22:51:06 -04:00
Olivier Saut
017e7e8be1 Replace io::println by println as it is now included in prelude.rs 2013-05-10 21:12:11 +02:00
Daniel Micay
044abef0e5 fix incorrect region code based on the old 'self
also removes unnecessary casts from the RcMut implementation
2013-05-08 16:00:49 -04:00
Daniel Micay
8f2d71ac00 small fix to the tutorial-ffi destructor example
The previous example was erroneously attempting to destroy
uninitialized memory, which was often zeroed (masking the bug).
2013-05-04 21:57:10 -04:00
Daniel Micay
86efd97a10 add gitattributes and fix whitespace issues 2013-05-03 20:01:42 -04:00
Brendan Zabarauskas
ee26c7c433 Revert rename of Div to Quot 2013-05-01 15:40:05 +10:00
Jed Davis
4701716b56 Revert "doc: XFAIL mysterious failure on bots"
This reverts commit 2c6dae081b.
2013-04-30 12:07:10 -07:00
Patrick Walton
2c6dae081b doc: XFAIL mysterious failure on bots 2013-04-29 14:30:57 -07:00
Patrick Walton
670ab8ac36 librustc: Change labels to use the lifetime notation '. 2013-04-29 14:30:57 -07:00
ILYONG CHO
9d33008da1 tutorial: Fix 'self' to 'Self' 2013-04-29 17:59:25 +09:00
Daniel Micay
46f91a0fa9 make way for a new iter module 2013-04-28 22:31:39 -04:00
Daniel Micay
195911fca4 tutorial-ffi: add example of a custom destructor 2013-04-26 14:07:57 -04:00
Daniel Micay
721e1143a5 tutorial: rework the section on destructors
This removes the comparison to manual memory management examples,
because it requires too much existing knowledge. Implementing custom
destructors can be covered in the FFI tutorial, where `unsafe` is
already well explained.
2013-04-26 14:07:47 -04:00
Marvin Löbel
3759b5711d Fixed typo... And a billion other things. 2013-04-24 22:28:02 +02:00
Tim Chevalier
4508da226a rustpkg: In doc, mention other implicit RUST_PATH entries
as per Graydon's comment
2013-04-22 18:17:32 -07:00
Tim Chevalier
d834c0d59d docs: Sketch out rustpkg manual 2013-04-22 18:17:32 -07:00
Brendan Zabarauskas
01eb5e8ad3 Rename Div operator trait to Quot and Modulo operator trait to Rem 2013-04-22 01:58:53 +10:00
Dan Luu
69f6ac5d31 Fix debug! usage in tutorial 2013-04-19 19:17:34 -04:00
Brian Anderson
decd3901d5 core::comm: Modernize constructors to use new 2013-04-18 14:07:35 -07:00
Dan Luu
7373c64a4c Explain use of debug\! in tutorial 2013-04-17 11:51:43 -04:00
bors
8b74efaa7b auto merge of #5852 : thestinger/rust/ffi, r=thestinger 2013-04-12 03:37:00 -07:00
Daniel Micay
53d2228b37 tutorial-ffi: add another missing word 2013-04-12 06:34:25 -04:00
Daniel Micay
a4db39a6fe tutorial-ffi: add missing word 2013-04-12 03:15:07 -04:00
Daniel Micay
1faa3596b0 rewrite the ffi tutorial with snappy as an example
The example with OpenSSL is incorrect, because OpenSSL is using a
static variable for the return value and isn't thread-safe.

The gettimeofday example isn't great because it's not very portable.
2013-04-12 02:12:00 -04:00