Commit Graph

494 Commits

Author SHA1 Message Date
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
bors
60a43f9bc5 auto merge of #14534 : alexcrichton/rust/snapshots, r=sfackler
This is part 2 of the saga of renaming the Partial/Total equality and comparison traits.
2014-05-30 21:21:39 -07:00
bors
cc4513202d auto merge of #14547 : reem/rust/remove-owned-vec-docs, r=alexcrichton
The last example in the containers and iterators guide had a superfluous owned vector in it. Everything works fine without it, so I removed it to avoid confusion.
2014-05-30 16:01:35 -07:00
Alex Crichton
748bc3ca49 std: Rename {Eq,Ord} to Partial{Eq,Ord}
This is part of the ongoing renaming of the equality traits. See #12517 for more
details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord}
or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}.

cc #12517

[breaking-change]
2014-05-30 15:52:24 -07:00
Jonathan Reem
3dace35044 Remove deprecated owned vector from iterator example. 2014-05-30 12:18:52 -07:00
Kevin Butler
030b3a2499 windows: Allow snake_case errors for now. 2014-05-30 17:59:41 +01:00
bors
25951b2242 auto merge of #14514 : Randati/rust/patch-1, r=huonw 2014-05-30 00:31:44 -07:00
bors
81c022317a auto merge of #14427 : alexcrichton/rust/librand, r=huonw
This commit shuffles around some of the `rand` code, along with some
reorganization. The new state of the world is as follows:

* The librand crate now only depends on libcore. This interface is experimental.
* The standard library has a new module, `std::rand`. This interface will
  eventually become stable.

Unfortunately, this entailed more of a breaking change than just shuffling some
names around. The following breaking changes were made to the rand library:

* Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which
  will return an infinite stream of random values. Previous behavior can be
  regained with `rng.gen_iter().take(n).collect()`

* Rng::gen_ascii_str() was removed. This has been replaced with
  Rng::gen_ascii_chars() which will return an infinite stream of random ascii
  characters. Similarly to gen_iter(), previous behavior can be emulated with
  `rng.gen_ascii_chars().take(n).collect()`

* {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all
  relied on being able to use an OSRng for seeding, but this is no longer
  available in librand (where these types are defined). To retain the same
  functionality, these types now implement the `Rand` trait so they can be
  generated with a random seed from another random number generator. This allows
  the stdlib to use an OSRng to create seeded instances of these RNGs.

* Rand implementations for `Box<T>` and `@T` were removed. These seemed to be
  pretty rare in the codebase, and it allows for libcore to not depend on
  liballoc.  Additionally, other pointer types like Rc<T> and Arc<T> were not
  supported.  If this is undesirable, librand can depend on liballoc and regain
  these implementations.

* The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`,
   but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice
   structure now has a lifetime associated with it.

cc #13851

[breaking-change]
2014-05-29 16:41:42 -07:00
Alex Crichton
925ff65118 std: Recreate a rand module
This commit shuffles around some of the `rand` code, along with some
reorganization. The new state of the world is as follows:

* The librand crate now only depends on libcore. This interface is experimental.
* The standard library has a new module, `std::rand`. This interface will
  eventually become stable.

Unfortunately, this entailed more of a breaking change than just shuffling some
names around. The following breaking changes were made to the rand library:

* Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which
  will return an infinite stream of random values. Previous behavior can be
  regained with `rng.gen_iter().take(n).collect()`

* Rng::gen_ascii_str() was removed. This has been replaced with
  Rng::gen_ascii_chars() which will return an infinite stream of random ascii
  characters. Similarly to gen_iter(), previous behavior can be emulated with
  `rng.gen_ascii_chars().take(n).collect()`

* {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all
  relied on being able to use an OSRng for seeding, but this is no longer
  available in librand (where these types are defined). To retain the same
  functionality, these types now implement the `Rand` trait so they can be
  generated with a random seed from another random number generator. This allows
  the stdlib to use an OSRng to create seeded instances of these RNGs.

* Rand implementations for `Box<T>` and `@T` were removed. These seemed to be
  pretty rare in the codebase, and it allows for librand to not depend on
  liballoc.  Additionally, other pointer types like Rc<T> and Arc<T> were not
  supported.  If this is undesirable, librand can depend on liballoc and regain
  these implementations.

* The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`,
  but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice
  structure now has a lifetime associated with it.

* The `sample` method on `Rng` has been moved to a top-level function in the
  `rand` module due to its dependence on `Vec`.

cc #13851

[breaking-change]
2014-05-29 16:18:26 -07:00
bors
c631d3d804 auto merge of #14488 : SimonSapin/rust/patch-11, r=alexcrichton
According to the corresponding section, accessing a mutable static variable requires `unsafe` too, and I believe it counts as as language level feature. Add it to the relevant list in the Unsafety section.
2014-05-29 07:51:40 -07:00
Randati
0e12934ed3 Revert erroneous fix to tutorial 2014-05-29 15:11:53 +03:00
bors
ff2bf58e9e auto merge of #14481 : alexcrichton/rust/no-format-strbuf, r=sfackler
* Removes `format_strbuf!()`
2014-05-29 03:31:39 -07:00
bors
aa151956a7 auto merge of #14465 : Ryman/rust/patch-1, r=alexcrichton 2014-05-28 16:01:36 -07:00
Alex Crichton
42aed6bde2 std: Remove format_strbuf!()
This was only ever a transitionary macro.
2014-05-28 08:35:41 -07:00
Simon Sapin
17697c78c5 Doc: static mut is unsafe too
According to the corresponding section, accessing a mutable static variable requires `unsafe` too, and I believe it counts as as language level feature. Add it to the relevant list in the Unsafety section.
2014-05-28 14:19:25 +01:00
bors
1dea8834cc auto merge of #14364 : alexcrichton/rust/libdebug, r=brson
This commit moves reflection (as well as the {:?} format modifier) to a new
libdebug crate, all of which is marked experimental.

This is a breaking change because it now requires the debug crate to be
explicitly linked if the :? format qualifier is used. This means that any code
using this feature will have to add `extern crate debug;` to the top of the
crate. Any code relying on reflection will also need to do this.

Closes #12019

[breaking-change]
2014-05-27 21:46:46 -07:00
Alex Crichton
b53454e2e4 Move std::{reflect,repr,Poly} to a libdebug crate
This commit moves reflection (as well as the {:?} format modifier) to a new
libdebug crate, all of which is marked experimental.

This is a breaking change because it now requires the debug crate to be
explicitly linked if the :? format qualifier is used. This means that any code
using this feature will have to add `extern crate debug;` to the top of the
crate. Any code relying on reflection will also need to do this.

Closes #12019

[breaking-change]
2014-05-27 21:44:51 -07:00
bors
73dac7e4e6 auto merge of #14387 : alan-andrade/rust/remove_managed_boxes_and_gc, r=brson
My main goals were:
- be clear when we talk about "references" and "pointers"
- remove Managed boxes completely and the concept of GC.

https://github.com/mozilla/rust/issues/13987
2014-05-27 19:31:46 -07:00
bors
911cc9c352 auto merge of #14414 : richo/rust/features/nerf_unused_string_fns, r=alexcrichton
This should block on #14323
2014-05-27 17:46:48 -07:00
Ryman
ada85a202b rust manual: supertraits seperator is wrong 2014-05-27 21:40:50 +01:00
Richo Healey
1f1b2e42d7 std: Rename strbuf operations to string
[breaking-change]
2014-05-27 12:59:31 -07:00
Richo Healey
4348e23b26 std: Remove String's to_owned 2014-05-27 11:11:15 -07:00
bors
a01bedc2cd auto merge of #14429 : sanrodari/rust/patch-1, r=sfackler 2014-05-27 02:16:32 -07:00
bors
ca287ebc64 auto merge of #14374 : swgillespie/rust/swgillespie-tutorial, r=alexcrichton
The current tutorial says that the only way to get master is to build from source, which isn't true anymore - nightly binaries and an installer for Mac OS X are now available at the install page: http://www.rust-lang.org/install.html . Feedback very much welcome! Addresses issue #13578.
2014-05-26 11:51:27 -07:00
Sean Gillespie
b3fb258406 Update tutorial, see issue #13578 2014-05-25 21:54:49 -07:00
Santiago Rodriguez
68455a12db Fix to tutorial 2014-05-25 19:00:03 -05:00
bors
0fca6c6a02 auto merge of #14391 : alexcrichton/rust/more-rustdoc-inline, r=huonw
As part of the libstd facade (cc #13851), rustdoc is taught to inline documentation across crate boundaries through the usage of a `pub use` statement. This is done to allow libstd to maintain the facade that it is a standalone library with a defined public interface (allowing us to shuffle around what's underneath it).

A preview is available at http://people.mozilla.org/~acrichton/doc/std/index.html
2014-05-25 13:56:21 -07:00
Alex Crichton
3100bc5b82 rustdoc: Move inlining to its own module 2014-05-25 13:26:46 -07:00
Anton Löfgren
5ca437078b guide-runtime.md: Fix a typo 2014-05-25 21:11:54 +02:00
bors
489f470886 auto merge of #14370 : cmr/rust/design-faq, r=brson
This indends to help quell frequently answered questions about the language
design in a single, authoritative place.
2014-05-25 03:01:20 -07:00
Corey Richardson
11c0f77107 doc: add a new language design faq
This indends to help quell frequently answered questions about the language
design in a single, authoritative place.
2014-05-25 02:53:53 -07:00
Alex Crichton
bd339ced36 doc: Document the new #[doc(no_inline)] attribute 2014-05-25 01:18:37 -07:00
Richo Healey
553074506e core: rename strbuf::StrBuf to string::String
[breaking-change]
2014-05-24 21:48:10 -07:00
Alan Andrade
0cae849595 fix mostly grammar per PR comments 2014-05-24 17:08:00 -07:00
Steven Fackler
864c5016ae Get "make check" to work with unused-attribute
There's a fair number of attributes that have to be whitelisted since
they're either looked for by rustdoc, in trans, or as needed. These can
be cleaned up in the future.
2014-05-24 16:49:46 -07:00
Alan Andrade
99744653d5 get over bold text madness, changes per PR, brought the "returning pointers" section back to pointers guide 2014-05-24 13:15:48 -07:00
Alan Andrade
64dad2cb03 Cleanup lifetime guide
Clean pointers guide
2014-05-23 18:52:06 -07:00
bors
33c3eddd11 auto merge of #14362 : zecozephyr/rust/docfixes, r=cmr
extra::arc -> alloc::arc
2014-05-23 00:31:27 -07:00
bors
a0960a1223 auto merge of #14348 : alexcrichton/rust/doc.rust-lang.org, r=huonw 2014-05-22 16:56:23 -07:00
Alex Crichton
711f531b65 doc: Touch up the unsafe guide
* Change ~ references to Box
* Rewrite examples so they can be compiled an run
* Mention libcore
* Update wording about compiler-required functions
2014-05-22 15:14:23 -07:00
Patrick Walton
e878721d70 libcore: Remove all uses of ~str from libcore.
[breaking-change]
2014-05-22 14:42:02 -07:00
Jonathan Bailey
12240e5b9e Fixed incorrect module path
extra::arc -> sync::arc
2014-05-22 13:46:52 -07:00
Richo Healey
e5d883101c docs: Add win64 calling convention 2014-05-22 00:05:56 -07:00
Alex Crichton
799ddba8da Change static.rust-lang.org to doc.rust-lang.org
The new documentation site has shorter urls, gzip'd content, and index.html
redirecting functionality.
2014-05-21 19:55:39 -07:00
bors
1edb0e5364 auto merge of #14324 : zecozephyr/rust/docfix, r=luqmana 2014-05-21 06:21:25 -07:00
Jonathan Bailey
e549601bc8 Updated doc with correct type. 2014-05-21 02:48:23 -07:00
bors
4afc15e30c auto merge of #14259 : alexcrichton/rust/core-mem, r=brson
Excluding the functions inherited from the cast module last week (with marked
stability levels), these functions received the following treatment.

* size_of - this method has become #[stable]
* nonzero_size_of/nonzero_size_of_val - these methods have been removed
* min_align_of - this method is now #[stable]
* pref_align_of - this method has been renamed without the
  `pref_` prefix, and it is the "default alignment" now. This decision is in line
  with what clang does (see url linked in comment on function). This function
  is now #[stable].
* init - renamed to zeroed and marked #[stable]
* uninit - marked #[stable]
* move_val_init - renamed to overwrite and marked #[stable]
* {from,to}_{be,le}{16,32,64} - all functions marked #[stable]
* swap/replace/drop - marked #[stable]
* size_of_val/min_align_of_val/align_of_val - these functions are marked
  #[unstable], but will continue to exist in some form. Concerns have been
  raised about their `_val` prefix.
2014-05-20 23:31:30 -07:00
Alex Crichton
19dc3b50bd core: Stabilize the mem module
Excluding the functions inherited from the cast module last week (with marked
stability levels), these functions received the following treatment.

* size_of - this method has become #[stable]
* nonzero_size_of/nonzero_size_of_val - these methods have been removed
* min_align_of - this method is now #[stable]
* pref_align_of - this method has been renamed without the
  `pref_` prefix, and it is the "default alignment" now. This decision is in line
  with what clang does (see url linked in comment on function). This function
  is now #[stable].
* init - renamed to zeroed and marked #[stable]
* uninit - marked #[stable]
* move_val_init - renamed to overwrite and marked #[stable]
* {from,to}_{be,le}{16,32,64} - all functions marked #[stable]
* swap/replace/drop - marked #[stable]
* size_of_val/min_align_of_val/align_of_val - these functions are marked
  #[unstable], but will continue to exist in some form. Concerns have been
  raised about their `_val` prefix.

[breaking-change]
2014-05-20 23:06:54 -07:00
bors
84320a4f4b auto merge of #14277 : pczarn/rust/manual-grammar, r=alexcrichton
The grammar for use declarations was outdated. Corrected some other mistakes.
2014-05-20 10:11:20 -07:00
Piotr Czarnecki
6674913c02 Correct EBNF grammar in the manual
The grammar for use declarations was outdated.
2014-05-20 15:50:03 +02:00
Piotr Jawniak
cea63ecfb1 Minor doc fixes in various places 2014-05-19 15:41:06 +02:00
bors
20b502b241 auto merge of #14247 : Ryman/rust/minor_ptr_nit, r=alexcrichton
Not too hot on the second change, welcome a better suggestion/wording.
2014-05-17 02:41:20 -07:00
Patrick Walton
b84c0dc2d6 doc: Remove all uses of ~str from the documentation. 2014-05-16 11:41:27 -07:00
Kevin Butler
6bfe361de2 guide-pointers: minor nits 2014-05-16 15:40:21 +01:00
bors
d92926ca3b auto merge of #14235 : Ryman/rust/simplify_arcs_doc, r=alexcrichton 2014-05-16 01:06:25 -07:00
bors
84406d438c auto merge of #14213 : kballard/rust/str_from_utf8_result, r=cmr
Change `str::from_utf8_owned()` and `StrBuf::from_utf8()` to return `Result`.

This allows the vector to be recovered when it contains invalid UTF-8.
2014-05-15 21:41:29 -07:00
Kevin Butler
5f4de7197f guide-tasks: Simplify Arc usage to match Arc docs. 2014-05-16 02:32:35 +01:00
Alex Crichton
a7bee7b05d Add a crate for missing stubs from libcore
The core library in theory has 0 dependencies, but in practice it has some in
order for it to be efficient. These dependencies are in the form of the basic
memory operations provided by libc traditionally, such as memset, memcmp, etc.
These functions are trivial to implement and themselves have 0 dependencies.

This commit adds a new crate, librlibc, which will serve the purpose of
providing these dependencies. The crate is never linked to by default, but is
available to be linked to by downstream consumers. Normally these functions are
provided by the system libc, but in other freestanding contexts a libc may not
be available. In these cases, librlibc will suffice for enabling execution with
libcore.

cc #10116
2014-05-15 13:50:37 -07:00
Huon Wilson
19f9181654 test: allow the test filter to be a regex.
This is fully backwards compatible, since test names are Rust
identifiers + `:`, and hence not special regex characters.

Fixes #2866.
2014-05-15 23:04:09 +10:00
Kevin Ballard
d0f3cb05df Change str::from_utf8_owned() to return Result
This allows the original vector to be recovered in the event that it is
not valid UTF-8.

[breaking-change]
2014-05-14 17:35:55 -07:00
Zooko Wilcox-O'Hearn
0004953c3a add a line to the example to clarify semantics
This is to clarify that match construct doesn't define a new variable, since I
observed a person reading the Rust tutorial who seemed to incorrectly think
that it did. Fixes https://github.com/mozilla/rust/issues/13571 .
2014-05-13 17:24:08 -07:00
Richo Healey
ef23fa17c3 docs: Add a not found page 2014-05-13 17:24:07 -07:00
Adolfo Ochagavía
a390b5dd03 Replaced ~T by Box<T> in manual 2014-05-13 17:24:07 -07:00
Derek Chiang (Enchi Jiang)
5518071019 Remove reference to MutexArc 2014-05-12 19:52:29 -07:00
Alex Crichton
e798b97ce9 doc: Update the linkage documentation
After allowing mixing rlibs and dylibs in #13892, the documentation was not
updated accordingly to reflect this new capability.
2014-05-12 19:52:29 -07:00
Piotr Jawniak
06ea9893d5 doc: updates rust manual (loop to continue)
Keyword for continue expressions was changed from loop to continue, but the
manual was not updated.
2014-05-12 19:52:29 -07:00
Brian Anderson
c1da4f875f Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
bors
f483aa3a91 auto merge of #14102 : moonglum/rust/slice-clarification-in-readme, r=kballard
There are no arrays in Rust, they are slices. Especially in the tutorial beginners should not be confused with wrong terminology. It helps to know the right names for things when you want to find something in the documentation.

@erickt explained that today to me and it helped me a lot when getting started 😉 Maybe we should also explain what a slice and what a vector is in the tutorial. If you like that, I will try to do that and attach that to the pull request 😉
2014-05-11 14:51:46 -07:00
bors
032510bae2 auto merge of #14103 : alan-andrade/rust/manual-smallfix, r=alexcrichton
Hi,

I believe the word "managed" doesn't make sense here anymore. It's just a box.
2014-05-11 08:01:43 -07:00
Alex Crichton
f94d671bfa core: Remove the cast module
This commit revisits the `cast` module in libcore and libstd, and scrutinizes
all functions inside of it. The result was to remove the `cast` module entirely,
folding all functionality into the `mem` module. Specifically, this is the fate
of each function in the `cast` module.

* transmute - This function was moved to `mem`, but it is now marked as
              #[unstable]. This is due to planned changes to the `transmute`
              function and how it can be invoked (see the #[unstable] comment).
              For more information, see RFC 5 and #12898

* transmute_copy - This function was moved to `mem`, with clarification that is
                   is not an error to invoke it with T/U that are different
                   sizes, but rather that it is strongly discouraged. This
                   function is now #[stable]

* forget - This function was moved to `mem` and marked #[stable]

* bump_box_refcount - This function was removed due to the deprecation of
                      managed boxes as well as its questionable utility.

* transmute_mut - This function was previously deprecated, and removed as part
                  of this commit.

* transmute_mut_unsafe - This function doesn't serve much of a purpose when it
                         can be achieved with an `as` in safe code, so it was
                         removed.

* transmute_lifetime - This function was removed because it is likely a strong
                       indication that code is incorrect in the first place.

* transmute_mut_lifetime - This function was removed for the same reasons as
                           `transmute_lifetime`

* copy_lifetime - This function was moved to `mem`, but it is marked
                  `#[unstable]` now due to the likelihood of being removed in
                  the future if it is found to not be very useful.

* copy_mut_lifetime - This function was also moved to `mem`, but had the same
                      treatment as `copy_lifetime`.

* copy_lifetime_vec - This function was removed because it is not used today,
                      and its existence is not necessary with DST
                      (copy_lifetime will suffice).

In summary, the cast module was stripped down to these functions, and then the
functions were moved to the `mem` module.

    transmute - #[unstable]
    transmute_copy - #[stable]
    forget - #[stable]
    copy_lifetime - #[unstable]
    copy_mut_lifetime - #[unstable]

[breaking-change]
2014-05-11 01:13:02 -07:00
moonglum
1895ad269c Clarification of Slice, Vector and Array
Especially in the tutorial beginners should not be confused with
wrong terminology. It helps to know the right names for things
when you want to find something in the documentation.
2014-05-10 18:02:02 -07:00
Alan Andrade
4e1f239721 remove the word managed from the trait explanation 2014-05-10 17:30:59 -07:00
bors
e850316408 auto merge of #14068 : alexcrichton/rust/rustdoc-xcrate-links, r=brson
This should improve the libcore experience quite a bit when looking at the
libstd documentation.
2014-05-10 03:36:30 -07:00
Alex Crichton
620b4352f2 doc: Fix some broken links 2014-05-09 14:42:12 -07:00
bors
65205652b8 auto merge of #14043 : sanxiyn/rust/attr-reference, r=alexcrichton
Attribute grammar in reference manual allowed `#[foo, bar]`, which does not match parser behavior.

Also rename nonterminals to match parser code.

Fix #13825.
2014-05-09 04:36:33 -07:00
Kevin Ballard
9fb8741b2e Handle breakage after libcore split
API Changes:

- &[T] and ~[T] no longer support the addition operator (+)
2014-05-08 12:08:01 -07:00
Kevin Ballard
eab6bb2ece Handle fallout in documentation
Tweak the tutorial's section on vectors and strings, to slightly clarify
the difference between fixed-size vectors, vectors, and slices.
2014-05-08 12:06:22 -07:00
Seo Sanghyeon
a4b7b8df40 Correct attribute grammar in reference manual 2014-05-09 01:45:44 +09:00
bors
574cbe5b07 auto merge of #13986 : alexcrichton/rust/box-keyword, r=thestinger
This keyword is about to be used much more often than it was a few weeks ago,
it's time to tell editors about the new keyword.
2014-05-08 03:06:37 -07:00
Alex Crichton
07caa22450 Test fixes and rebase conflicts 2014-05-07 11:03:12 -07:00
bors
ef6daf9935 auto merge of #13958 : pcwalton/rust/detilde, r=pcwalton
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

r? @brson or @alexcrichton or whoever
2014-05-07 05:16:48 -07:00
bors
4a5d39001b auto merge of #13914 : alexcrichton/rust/pile-o-rustdoc-fixes, r=brson
Lots of assorted things here and there, all the details are in the commits.

Closes #11712
2014-05-07 03:21:47 -07:00
Patrick Walton
090040bf40 librustc: Remove ~EXPR, ~TYPE, and ~PAT from the language, except
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

How to update your code:

* Instead of `~EXPR`, you should write `box EXPR`.

* Instead of `~TYPE`, you should write `Box<Type>`.

* Instead of `~PATTERN`, you should write `box PATTERN`.

[breaking-change]
2014-05-06 23:12:54 -07:00
bors
df621acf5f auto merge of #13960 : brandonw/rust/master, r=alexcrichton
Update the example to make the usage of `pub mod foo;` much more
apparent, as well as using an example where setting the visibility of
the module is actually necessary.
2014-05-06 15:06:52 -07:00
Alex Crichton
948526134b etc: Add box as a keyword to editor configs
This keyword is about to be used much more often than it was a few weeks ago,
it's time to tell editors about the new keyword.
2014-05-06 10:49:35 -07:00
Brandon Waskiewicz
949143e17a Update multiple file use statement example
Update the example to make the usage of `pub mod foo;` much more
apparent, as well as using an example where setting the visibility of
the module is actually necessary.
2014-05-06 11:11:52 -04:00
bors
5c16cf975d auto merge of #13939 : richo/rust/docs/composability, r=thestinger
While there are various references to the work compositionality on the web, I can't find any reference to it being an actual word. My understanding is that composability is what's actually meant here anyway.
2014-05-05 22:46:35 -07:00
bors
a1ca57237b auto merge of #13946 : pnkfelix/rust/fsk-cleanup-proc-comment-in-guide-tasks, r=alexcrichton
Followup to some recent feedback in PR #13676.
2014-05-05 19:56:33 -07:00
Mike Boutin
055cbdeee0 doc: Corrected example in 17.8 Deriving implementations for traits
Corrected example to to use Rand trait referenced in preceding
description and included an example using the Show trait to print ABC.
2014-05-05 11:25:16 -04:00
Mike Boutin
e65aea522c doc: Minor example formatting in 11 References 2014-05-05 11:24:00 -04:00
Mike Boutin
81bc32d975 doc: Clarified 4.2 Pattern matching
Combined redundant paragraphs about the match expression and removed a
redundant example.
2014-05-05 11:24:00 -04:00
Felix S. Klock II
0fb1f3fd38 Cleanup proc comment in guide-tasks.md. 2014-05-05 13:24:54 +02:00
bors
8895f25241 auto merge of #13942 : JamesLaverack/rust/master, r=luqmana
Version changed due to a newer requirement in LLVM.
2014-05-05 03:06:37 -07:00
bors
3179cd50ae auto merge of #13924 : gmjosack/rust/master, r=alexcrichton
Most of the links I've removed are for types that don't exist anymore with the exception of `SendReceiver` though I'm not sure how useful it is to link to that without the accompanying `Receiver` and `Sender` and I don't know how useful those links are when they're discussed below and `channel`/`sync_channel` is on the `std::comm` page already linked.
2014-05-04 20:51:43 -07:00
James Laverack
72f478f0e8 Update minimum g++ version in documentation
Version changed due to a newer requirement in LLVM.
2014-05-05 03:03:00 +01:00
bors
028159ead4 auto merge of #13676 : mdinger/rust/tutorial_doc, r=pnkfelix
Improve tutorial discussion of closures, e.g. with respect to type inference and variable capture.

Fix #13621 

---- original description follows

I'd like this pulled to master if possible but if not I'd appreciate comments on what I need to change.  I found the closures difficult to understand as they were so I tried to explain it so I would've had an easier time understanding it.  I think it's better at least, somewhat.

I don't know that everyone liked the `-> ()` I included but I thought explicit is best to aid understanding.  I thought it was much harder to understand than it should have been.

[EDIT] - Clicked too early.
This doesn't `make check` without errors on my Xubuntu on Virtualbox machine.  Not sure why.  I don't think I changed anything problematic.  I'll try `make check` on master tomorrow.

Opened https://github.com/mozilla/rust/issues/13621 regarding this.
2014-05-04 14:21:52 -07:00
Richo Healey
6201d6d0d9 docs: change compositionality to composability 2014-05-04 14:17:47 -07:00
Gary M. Josack
9246682b06 Remove/Update dead links on Tasks guide. 2014-05-03 18:39:52 -07:00
Alex Crichton
4d2877c189 doc: Remove latex math documentation
This hasn't worked since pandoc stopped being used. We can get by well enough
with the superscript extension for these equations.

Closes #12989
2014-05-03 17:36:20 -07:00
Alex Crichton
15856139e4 rustdoc: Enable the footnote markdown extension
This enables hoedown's footnote extension, and fixes all footnotes in the
reference manual to use the new syntax.
2014-05-03 17:36:20 -07:00
Alex Crichton
9306e840f5 rustdoc: Migrate from sundown to hoedown
This primary fix brought on by this upgrade is the proper matching of the ```
and ~~~ doc blocks. This also moves hoedown to a git submodule rather than a
bundled repository.

Additionally, hoedown is stricter about code blocks, so this ended up fixing a
lot of invalid code blocks (ending with " ```" instead of "```", or ending with
"~~~~" instead of "~~~").

Closes #12776
2014-05-03 17:36:20 -07:00
Kevin Butler
74392246ff Remove comment about semicolons for inner attributes from docs and adjust comments. 2014-05-03 21:24:06 +01:00
Alex Crichton
9ac9245564 rustdoc: Have no_run imply no_trans
This allows writing code examples which pass all analysis of the compiler, but
don't actually link. A good example is examples that use extern {} blocks.

Closes #12903
2014-05-03 02:09:30 -07:00
Alex Crichton
1547caf748 rustdoc: Fix inclusion of the new fonts
These fonts were moved into place by rust's makefiles, but rustdoc is widely
used outside of rustc itself. This moves the fonts into the rustdoc binary,
similarly to the other static assets, and writes them to the output location
whenever rustdoc generates documentation.

Closes #13593
Closes #13787
2014-05-03 02:09:29 -07:00
Jorge Aparicio
e4bf643b99 Fix a/an typos 2014-05-01 20:02:11 -05:00
bors
fb72d7cfea auto merge of #13881 : aochagavia/rust/pr, r=alexcrichton 2014-05-01 13:31:59 -07:00
Adolfo Ochagavía
b537028116 Fixed outdated note in the tutorial 2014-05-01 17:52:17 +02:00
Justin Noah
000667158b rustdoc tutorial: grammar change in list comments 2014-05-01 01:16:30 -07:00
bors
9f484e616e auto merge of #13648 : gereeter/rust/removed-rev, r=alexcrichton
In the process, `Splits` got changed to be more like `CharSplits` in `str` to present the DEI interface.

Note that `treemap` still has a `rev_iter` function because it seems like it would be a significant interface change to expose a DEI - the iterator would have to gain an extra pointer, the completion checks would be more complicated, and it isn't easy to check that such an implementation is correct due to the use of unsafety to subvert the aliasing properties of `&mut`.

This fixes #9391.
2014-04-30 15:46:47 -07:00
Felix S. Klock II
636f7d2364 Suggested revisions to PR 13676.
Most important: distinguish function decl sugar for omitting `-> ()`
from type inference on closures.  I also tried to add a couple more
examples to further emphasize this distinction.  Note that this sugar
(of omitting `-> ()`) is actually already briefly mentioned in an
earlier section, so it is a little tricky deciding whether to put more
material here, or to move it up to the previous section.

Other drive-by fixes:

 * Fix the line length of the code blocks to fit in the width provided
   in the rendered HTML

 * Some minor revisions to wording (e.g. try to clarify in some cases
   where a type mismatch is arising).
2014-04-30 18:34:43 +02:00
mdinger
f79571f513 Remove extra semicolons 2014-04-30 09:29:53 -04:00
mdinger
af0dd16b1b Fix typo 2014-04-30 09:10:15 -04:00
bors
cbf113182c auto merge of #13776 : adrientetar/rust/rustdoc-fix, r=brson
- Closes #13591. Relevant example: http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm
(Had to use `!important` to override CSS selector precedence, namely matching over parent class.)
- Implement changes from #13780 feedback, namely:
  * Changed font-size from 18px to 15px
  * Reintroduced gray background for code samples
  * Tightened up the margins
- Fix point 1 and point 4 of #13804.

Samples:

- [enum.FileType](http://adrientetar.legtux.org/cached/rust-docs/enum.FileType.htm)
- [struct.CChars](http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm)
- [std](http://adrientetar.legtux.org/cached/rust-docs/std.htm)
- [std::io](http://adrientetar.legtux.org/cached/rust-docs/io.htm).

r? @brson
2014-04-29 18:26:44 -07:00
Jonathan S
03609e5a5e Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is provided (everywhere but treemap)
This commit deprecates rev_iter, mut_rev_iter, move_rev_iter everywhere (except treemap) and also
deprecates related functions like rsplit, rev_components, and rev_str_components. In every case,
these functions can be replaced with the non-reversed form followed by a call to .rev(). To make this
more concrete, a translation table for all functional changes necessary follows:

* container.rev_iter() -> container.iter().rev()
* container.mut_rev_iter() -> container.mut_iter().rev()
* container.move_rev_iter() -> container.move_iter().rev()
* sliceorstr.rsplit(sep) -> sliceorstr.split(sep).rev()
* path.rev_components() -> path.components().rev()
* path.rev_str_components() -> path.str_components().rev()

In terms of the type system, this change also deprecates any specialized reversed iterator types (except
in treemap), opting instead to use Rev directly if any type annotations are needed. However, since
methods directly returning reversed iterators are now discouraged, the need for such annotations should
be small. However, in those cases, the general pattern for conversion is to take whatever follows Rev in
the original reversed name and surround it with Rev<>:

* RevComponents<'a> -> Rev<Components<'a>>
* RevStrComponents<'a> -> Rev<StrComponents<'a>>
* RevItems<'a, T> -> Rev<Items<'a, T>>
* etc.

The reasoning behind this change is that it makes the standard API much simpler without reducing readability,
performance, or power. The presence of functions such as rev_iter adds more boilerplate code to libraries
(all of which simply call .iter().rev()), clutters up the documentation, and only helps code by saving two
characters. Additionally, the numerous type synonyms that were used to make the type signatures look nice
like RevItems add even more boilerplate and clutter up the docs even more. With this change, all that cruft
goes away.

[breaking-change]
2014-04-28 16:45:36 -05:00
Michael Pratt
bc330063d8 doc: Remove out-of-place debug! note
As of cc6ec8df, the Owned closures example uses println! instead of
debug!, making a note about seeing debug seem out-of-place in this
section.

Since debug! is not used elsewhere in the tutorial, remove the note
entirely.
2014-04-27 18:27:40 -04:00
Emanuel Rylke
107da87996 Fix link to hashmap.rs and json.rs in sample code FAQ 2014-04-27 14:17:06 +02:00
Adrien Tétar
b7dba3300e doc: perform some 80-chars wrappings 2014-04-27 11:56:29 +09:00
bors
a5d203579b auto merge of #13758 : sodaplayer/rust/patch-1, r=alexcrichton
Rustdoc doesn't seem like it's converting the old format to a table as we can see here:
http://static.rust-lang.org/doc/master/complement-cheatsheet.html#ffi-(foreign-function-interface)
This new format should fix that and it's also rendered by Github's markdown preview.
2014-04-25 23:31:25 -07:00
bors
35f3f7a74b auto merge of #13748 : hjr3/rust/guide-container-update, r=alexcrichton 2014-04-25 20:06:32 -07:00
bors
395d8857d6 auto merge of #13744 : adrientetar/rust/derp, r=brson
- Serve webfonts locally
- Style changes around `blockquote` and `code`
- Minor adjustments from previous changes

Bringing back updated examples: [modified tutorial](http://adrientetar.legtux.org/cached/rust-docs/tutorial.htm) and [modified manual](http://adrientetar.legtux.org/cached/rust-docs/manual.htm).
And for rustdoc, [modified `enum.FileType`](http://adrientetar.legtux.org/cached/rust-docs/enum.FileType.htm), [modified `std`](http://adrientetar.legtux.org/cached/rust-docs/std.htm) and [modified `std::io`](http://adrientetar.legtux.org/cached/rust-docs/io.htm).
2014-04-25 18:26:33 -07:00
John Fresco
e7ca1d1c67 Update FFI signature table to use pipe format
Rustdoc doesn't seem like it's converting the old format to a table as we can see here:
http://static.rust-lang.org/doc/master/complement-cheatsheet.html#ffi-(foreign-function-interface)
This new format should fix that and it's also rendered by Github's markdown preview.
2014-04-25 13:07:30 -06:00
Herman J. Radtke III
87f2e21e18 doc: Update modules for containers 2014-04-25 08:17:18 -07:00
Michael Fairley
3124057101 Fix variable name in prose to match code it's describing 2014-04-25 10:15:47 -05:00
Adrien Tétar
b3577a10f3 rustdoc: bring it inline 2014-04-25 18:04:59 +09:00
Adrien Tétar
c9d995d384 doc,rustdoc: store webfonts locally
- Avoids cross-domain requests restrictions
- Better availability of content
- No HTML queries needed for an offline build
2014-04-25 17:05:56 +09:00
Adrien Tétar
14654835fc doc: slight design refresh 2014-04-25 16:59:04 +09:00
Adrien Tétar
22160014a4 rustdoc: fixes 2014-04-25 16:56:39 +09:00
Andrew Gallant
b8b7484703 Add a regex crate to the Rust distribution.
Also adds a regex_macros crate, which provides natively compiled
regular expressions with a syntax extension.

Closes #3591.

RFC: 0007-regexps
2014-04-25 00:27:24 -04:00