]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoFix the capture_stderr test
Alex Crichton [Wed, 10 Dec 2014 15:36:33 +0000 (07:36 -0800)]
Fix the capture_stderr test

There's always a fun time having two sets of standard libraries when testing!

9 years agoDisable capture_stderr test for now
Aaron Turon [Tue, 9 Dec 2014 01:01:34 +0000 (17:01 -0800)]
Disable capture_stderr test for now

9 years agoFallout from new thread API
Aaron Turon [Sun, 7 Dec 2014 02:34:37 +0000 (18:34 -0800)]
Fallout from new thread API

9 years agoRevise rt::unwind
Aaron Turon [Sun, 7 Dec 2014 08:32:50 +0000 (00:32 -0800)]
Revise rt::unwind

9 years agoRemove rt::{mutex, exclusive}
Aaron Turon [Mon, 1 Dec 2014 16:49:32 +0000 (08:49 -0800)]
Remove rt::{mutex, exclusive}

9 years agoAdd blocking support module for channels
Aaron Turon [Mon, 1 Dec 2014 16:14:35 +0000 (08:14 -0800)]
Add blocking support module for channels

9 years agoRemove rt::{local, local_data, thread_local_storage}
Aaron Turon [Tue, 25 Nov 2014 01:59:15 +0000 (17:59 -0800)]
Remove rt::{local, local_data, thread_local_storage}

9 years agoIntroduce std::thread
Aaron Turon [Tue, 25 Nov 2014 16:52:10 +0000 (08:52 -0800)]
Introduce std::thread

Also removes:

* `std::task`
* `std::rt::task`
* `std::rt::thread`

Notes for the new API are in a follow-up commit.

Closes #18000

9 years agoRemove rt::bookkeeping
Aaron Turon [Tue, 25 Nov 2014 01:33:37 +0000 (17:33 -0800)]
Remove rt::bookkeeping

This commit removes the runtime bookkeeping previously used to ensure
that all Rust tasks were joined before the runtime was shut down.

This functionality will be replaced by an RAII style `Thread` API, that
will also offer a detached mode.

Since this changes the semantics of shutdown, it is a:

[breaking-change]

9 years agoMake at_exit initialize lazily
Aaron Turon [Tue, 25 Nov 2014 01:22:40 +0000 (17:22 -0800)]
Make at_exit initialize lazily

9 years agoAllow args to work without rt initialization
Aaron Turon [Tue, 25 Nov 2014 00:38:06 +0000 (16:38 -0800)]
Allow args to work without rt initialization

9 years agoRefactor std::os to use sys::os
Aaron Turon [Tue, 25 Nov 2014 00:21:39 +0000 (16:21 -0800)]
Refactor std::os to use sys::os

9 years agolibs: merge librustrt into libstd
Aaron Turon [Mon, 24 Nov 2014 03:21:17 +0000 (19:21 -0800)]
libs: merge librustrt into libstd

This commit merges the `rustrt` crate into `std`, undoing part of the
facade. This merger continues the paring down of the runtime system.

Code relying on the public API of `rustrt` will break; some of this API
is now available through `std::rt`, but is likely to change and/or be
removed very soon.

[breaking-change]

9 years agoAdd privacy tests
Seo Sanghyeon [Fri, 19 Dec 2014 07:11:17 +0000 (16:11 +0900)]
Add privacy tests

9 years agoauto merge of #19899 : japaric/rust/unops-by-value, r=nikomatsakis
bors [Fri, 19 Dec 2014 06:12:01 +0000 (06:12 +0000)]
auto merge of #19899 : japaric/rust/unops-by-value, r=nikomatsakis

- The following operator traits now take their argument by value: `Neg`, `Not`. This breaks all existing implementations of these traits.

- The unary operation `OP a` now "desugars" to `OpTrait::op_method(a)` and consumes its argument.

[breaking-change]

---

r? @nikomatsakis This PR is very similar to the binops-by-value PR
cc @aturon

9 years agoclean up ptr docs
Alexis Beingessner [Tue, 9 Dec 2014 01:12:35 +0000 (20:12 -0500)]
clean up ptr docs

9 years ago[collections] Adds `drain`: a way to sneak out the elements while clearing.
Clark Gaebel [Tue, 16 Dec 2014 22:45:03 +0000 (17:45 -0500)]
[collections] Adds `drain`: a way to sneak out the elements while clearing.

It is useful to move all the elements out of some collections without
deallocating the underlying buffer. It came up in IRC, and this patch
implements it as `drain`. This has been discussed as part of RFC 509.

r? @Gankro
cc: @frankmcsherry

9 years agoauto merge of #19955 : Gankro/rust/kill-all-code, r=aturon
bors [Fri, 19 Dec 2014 02:52:01 +0000 (02:52 +0000)]
auto merge of #19955 : Gankro/rust/kill-all-code, r=aturon

EnumSet lives on in libcollections so that librustc can still use it. This adds a direct dependency on libcollections to librustc and libserialize.

Should not be merged until https://github.com/rust-lang/rfcs/pull/509 is accepted.

All of these collections have already been moved to collect-rs where they will ideally be maintained and experimented with, or will be replaced by something better: https://github.com/Gankro/collect-rs/

[breaking-change]

r? @aturon @alexcrichton

9 years agoenumset fallout
Alexis Beingessner [Wed, 17 Dec 2014 15:16:10 +0000 (10:16 -0500)]
enumset fallout

9 years agos/Tree/BTree
Alexis Beingessner [Wed, 17 Dec 2014 04:09:16 +0000 (23:09 -0500)]
s/Tree/BTree

9 years agoremove TreeMap, TreeSet, TrieMap, TrieSet, LruCache. deprecate EnumSet's std re-export
Alexis Beingessner [Wed, 17 Dec 2014 03:33:13 +0000 (22:33 -0500)]
remove TreeMap, TreeSet, TrieMap, TrieSet, LruCache. deprecate EnumSet's std re-export

9 years agoauto merge of #19896 : ktossell/rust/allow-nodoc-install, r=alexcrichton
bors [Thu, 18 Dec 2014 20:32:07 +0000 (20:32 +0000)]
auto merge of #19896 : ktossell/rust/allow-nodoc-install, r=alexcrichton

If you configure with `--disable-docs`, the `doc` directory does not get generated, so the
`cp -r doc dist/` step fails when you `make dist{,-tar-bins,-doc}` or `make install`.

9 years agoAddress Niko's comments
Jorge Aparicio [Wed, 17 Dec 2014 00:40:57 +0000 (19:40 -0500)]
Address Niko's comments

9 years agoTest unop move semantics
Jorge Aparicio [Mon, 15 Dec 2014 23:24:33 +0000 (18:24 -0500)]
Test unop move semantics

9 years agoFix run pass tests
Jorge Aparicio [Mon, 15 Dec 2014 23:24:07 +0000 (18:24 -0500)]
Fix run pass tests

9 years agolibstd: convert `Duration` unops to by value
Jorge Aparicio [Mon, 15 Dec 2014 22:06:34 +0000 (17:06 -0500)]
libstd: convert `Duration` unops to by value

9 years agolibstd: convert `BitFlags` unops to by value
Jorge Aparicio [Mon, 15 Dec 2014 22:06:10 +0000 (17:06 -0500)]
libstd: convert `BitFlags` unops to by value

9 years agolibcore: convert unop traits to by value
Jorge Aparicio [Mon, 15 Dec 2014 21:24:24 +0000 (16:24 -0500)]
libcore: convert unop traits to by value

9 years agoTell regionck that user unops are by value
Jorge Aparicio [Mon, 15 Dec 2014 21:18:17 +0000 (16:18 -0500)]
Tell regionck that user unops are by value

9 years agoTell expr_use_visitor that user unops are by value
Jorge Aparicio [Mon, 15 Dec 2014 21:16:48 +0000 (16:16 -0500)]
Tell expr_use_visitor that user unops are by value

9 years agoTell trans that user unops are by value
Jorge Aparicio [Mon, 15 Dec 2014 21:14:25 +0000 (16:14 -0500)]
Tell trans that user unops are by value

9 years agoTell typeck that user unops are by value
Jorge Aparicio [Mon, 15 Dec 2014 21:11:34 +0000 (16:11 -0500)]
Tell typeck that user unops are by value

9 years agosyntax/ast_util: add `is_by_value_unop()`
Jorge Aparicio [Mon, 15 Dec 2014 20:49:41 +0000 (15:49 -0500)]
syntax/ast_util: add `is_by_value_unop()`

9 years agoauto merge of #19984 : japaric/rust/macro-expressions, r=alexcrichton
bors [Thu, 18 Dec 2014 17:32:07 +0000 (17:32 +0000)]
auto merge of #19984 : japaric/rust/macro-expressions, r=alexcrichton

followed by a semicolon.

This allows code like `vec![1i, 2, 3].len();` to work.

This breaks code that uses macros as statements without putting
semicolons after them, such as:

    fn main() {
        ...
        assert!(a == b)
        assert!(c == d)
        println(...);
    }

It also breaks code that uses macros as items without semicolons:

    local_data_key!(foo)

    fn main() {
        println("hello world")
    }

Add semicolons to fix this code. Those two examples can be fixed as
follows:

    fn main() {
        ...
        assert!(a == b);
        assert!(c == d);
        println(...);
    }

    local_data_key!(foo);

    fn main() {
        println("hello world")
    }

RFC #378.

Closes #18635.

[breaking-change]

---

Rebased version of #18958
r? @alexcrichton
cc @pcwalton

9 years agolibrustc: Always parse `macro!()`/`macro![]` as expressions if not
Patrick Walton [Fri, 14 Nov 2014 17:18:10 +0000 (09:18 -0800)]
librustc: Always parse `macro!()`/`macro![]` as expressions if not
followed by a semicolon.

This allows code like `vec![1i, 2, 3].len();` to work.

This breaks code that uses macros as statements without putting
semicolons after them, such as:

    fn main() {
        ...
        assert!(a == b)
        assert!(c == d)
        println(...);
    }

It also breaks code that uses macros as items without semicolons:

    local_data_key!(foo)

    fn main() {
        println("hello world")
    }

Add semicolons to fix this code. Those two examples can be fixed as
follows:

    fn main() {
        ...
        assert!(a == b);
        assert!(c == d);
        println(...);
    }

    local_data_key!(foo);

    fn main() {
        println("hello world")
    }

RFC #378.

Closes #18635.

[breaking-change]

9 years agoauto merge of #19819 : vadimcn/rust/fix-demangle, r=alexcrichton
bors [Thu, 18 Dec 2014 14:42:06 +0000 (14:42 +0000)]
auto merge of #19819 : vadimcn/rust/fix-demangle, r=alexcrichton

Windows dbghelp strips leading underscores from symbols, and I could not find a way to turn this off.  So let's accept  "ZN...E" form too.
Also, print PC displacement from symbols.  This is helpful in gauging whether the PC was indeed within the function displayed in the backtrace, or whether it just happened to be the closest public symbol in the module.

9 years agoauto merge of #19780 : jakub-/rust/e-needstest, r=alexcrichton
bors [Thu, 18 Dec 2014 12:21:57 +0000 (12:21 +0000)]
auto merge of #19780 : jakub-/rust/e-needstest, r=alexcrichton

Closes #5988.
Closes #10176.
Closes #10456.
Closes #12744.
Closes #13264.
Closes #13324.
Closes #14182.
Closes #15381.
Closes #15444.
Closes #15480.
Closes #15756.
Closes #16822.
Closes #16966.
Closes #17351.
Closes #17503.
Closes #17545.
Closes #17771.
Closes #17816.
Closes #17897.
Closes #17905.
Closes #18188.
Closes #18232.
Closes #18345.
Closes #18389.
Closes #18400.
Closes #18502.
Closes #18611.
Closes #18783.
Closes #19009.
Closes #19081.
Closes #19098.
Closes #19127.
Closes #19135.

9 years agoauto merge of #19769 : nick29581/rust/coerce-if, r=nikomatsakis
bors [Thu, 18 Dec 2014 06:41:59 +0000 (06:41 +0000)]
auto merge of #19769 : nick29581/rust/coerce-if, r=nikomatsakis

r? @nikomatsakis

We discussed coercions for `if` and `match` expressions. `if` seems to work already, was there some specific behaviour which wasn't working?

9 years agoFix logic error and add unreachable after returns
James Miller [Thu, 18 Dec 2014 04:43:50 +0000 (17:43 +1300)]
Fix logic error and add unreachable after returns

9 years agoMinor fixes
James Miller [Wed, 17 Dec 2014 00:24:35 +0000 (13:24 +1300)]
Minor fixes

9 years agoFix formatting issues
James Miller [Tue, 16 Dec 2014 00:09:35 +0000 (13:09 +1300)]
Fix formatting issues

9 years agoAdd some documentation
James Miller [Mon, 15 Dec 2014 23:35:59 +0000 (12:35 +1300)]
Add some documentation

9 years agoOnly count nested returns when the outer return is reachable
James Miller [Mon, 15 Dec 2014 23:21:08 +0000 (12:21 +1300)]
Only count nested returns when the outer return is reachable

This narrows the definition of nested returns such that only when the
outer return has a chance of being executed (due to the inner return
being conditional) do we mark the function as having nested returns.

Fixes #19684

9 years agoPropagate coercions through match expressions.
Nick Cameron [Fri, 12 Dec 2014 05:48:44 +0000 (18:48 +1300)]
Propagate coercions through match expressions.

9 years agoOnly try to install the doc directory if it exists.
Ken Tossell [Mon, 15 Dec 2014 22:40:43 +0000 (17:40 -0500)]
Only try to install the doc directory if it exists.

If you configure with `--disable-docs`, the `doc` directory does not get generated, so
`cp -r doc dist/` fails when you `make dist{,-tar-bins,-doc}` or `make install`

9 years agoUse #[deriving(Copy)] for InvariantLifetime
Jake Goulding [Sun, 14 Dec 2014 14:48:56 +0000 (09:48 -0500)]
Use #[deriving(Copy)] for InvariantLifetime

9 years agoAdd tests for E-needstest issues
Jakub Bukaj [Sun, 7 Dec 2014 15:22:06 +0000 (15:22 +0000)]
Add tests for E-needstest issues

9 years agoauto merge of #19958 : alexcrichton/rust/rollup, r=alexcrichton
bors [Wed, 17 Dec 2014 21:33:15 +0000 (21:33 +0000)]
auto merge of #19958 : alexcrichton/rust/rollup, r=alexcrichton

9 years agoTest fixes and rebase conflicts
Alex Crichton [Wed, 17 Dec 2014 19:26:52 +0000 (11:26 -0800)]
Test fixes and rebase conflicts

9 years agorollup merge of #19947: csouth3/arc-borrowfrom
Alex Crichton [Wed, 17 Dec 2014 16:35:53 +0000 (08:35 -0800)]
rollup merge of #19947: csouth3/arc-borrowfrom

Closes #19937.

9 years agorollup merge of #19943: steveklabnik/doc_std_vec
Alex Crichton [Wed, 17 Dec 2014 16:35:52 +0000 (08:35 -0800)]
rollup merge of #19943: steveklabnik/doc_std_vec

Random improvements to the `std::vec` docs.

9 years agorollup merge of #19942: steveklabnik/doc_std_mem
Alex Crichton [Wed, 17 Dec 2014 16:35:50 +0000 (08:35 -0800)]
rollup merge of #19942: steveklabnik/doc_std_mem

9 years agorollup merge of #19940: phi-gamma/canonical-master
Alex Crichton [Wed, 17 Dec 2014 16:35:48 +0000 (08:35 -0800)]
rollup merge of #19940: phi-gamma/canonical-master

Signed-off-by: Philipp Gesang <phg@phi-gamma.net>
9 years agorollup merge of #19935: cgaebel/hashmap-tuple-indexing
Alex Crichton [Wed, 17 Dec 2014 16:35:47 +0000 (08:35 -0800)]
rollup merge of #19935: cgaebel/hashmap-tuple-indexing

r? @Gankro @pczarn

9 years agorollup merge of #19930: cllns/lowercase-if
Alex Crichton [Wed, 17 Dec 2014 16:35:45 +0000 (08:35 -0800)]
rollup merge of #19930: cllns/lowercase-if

On the [guide site](http://doc.rust-lang.org/guide.html#if) I was confused when I got to "5 If". It looked like "5 LF" in lowercase.

Changing the if to lowercase solves this problem. I know titles are all capitalized, but I think it makes sense in this case to keep it lowercase, since `if` is a reserved word. I'd also be open to making it ```    `if`   ``` but I'm not sure how that would look on the site.

Before:
![screen shot 2014-12-16 at 12 58 01](https://cloud.githubusercontent.com/assets/632942/5458866/cb34c006-8523-11e4-89ef-3a3964bcedfc.png)
After:
![screen shot 2014-12-16 at 12 58 14](https://cloud.githubusercontent.com/assets/632942/5458865/cb33c444-8523-11e4-8d95-d377ed583ed6.png)

9 years agorollup merge of #19923: pnkfelix/fix-make-tags.emacs
Alex Crichton [Wed, 17 Dec 2014 16:35:42 +0000 (08:35 -0800)]
rollup merge of #19923: pnkfelix/fix-make-tags.emacs

Fix `make TAGS.emacs`.

@nikomatsakis has been complaining to me about this.  (I had not noticed since I drive `ctags` with a separate script.)

(Suitable for a rollup build.)

9 years agorollup merge of #19918: pnkfelix/ast-refactor-make-place-in-exprbox-an-option
Alex Crichton [Wed, 17 Dec 2014 16:35:40 +0000 (08:35 -0800)]
rollup merge of #19918: pnkfelix/ast-refactor-make-place-in-exprbox-an-option

This is to allow us to migrate away from UnUniq in a followup commit,
and thus unify the code paths related to all forms of `box`.

9 years agorollup merge of #19912: P1start/fn-formatting
Alex Crichton [Wed, 17 Dec 2014 16:35:26 +0000 (08:35 -0800)]
rollup merge of #19912: P1start/fn-formatting

This is to encourage the use of the sugary syntax instead of the `<>` syntax, which will not be usable post-1.0. Rustdoc [still uses the `<>` syntax](https://github.com/rust-lang/rust/issues/19909), so if a rustdoc wizard is looking for something to do, it would be nice to use the parenthetical syntax there as well. (I tried to patch rustdoc as well, but failed…)

9 years agorollup merge of #19911: mdinger/tuple_tests2
Alex Crichton [Wed, 17 Dec 2014 16:35:24 +0000 (08:35 -0800)]
rollup merge of #19911: mdinger/tuple_tests2

Fixes some tuple indexing deprecation warnings. Didn't test. Don't see how it could fail unless I need to modify a makefile somewhere...

r? @alexcrichton

9 years agorollup merge of #19905: AaronFriel/patch-1
Alex Crichton [Wed, 17 Dec 2014 16:35:23 +0000 (08:35 -0800)]
rollup merge of #19905: AaronFriel/patch-1

Was testing rustup on a very minimal Debian installation and got errors during the install process (error occurred in `install.sh` of the Rust nightly.)

Noticed that Rustup was downloading the i686 nightly instead of x86-64. Installing `file` fixed the problem, and this patch adds the probe to ensure file is installed before attempting to use it.

There may still be an issue with the i686 installation, I did not investigate further.

9 years agorollup merge of #19902: alexcrichton/second-pass-mem
Alex Crichton [Wed, 17 Dec 2014 16:35:22 +0000 (08:35 -0800)]
rollup merge of #19902: alexcrichton/second-pass-mem

This commit stabilizes the `mem` and `default` modules of std.

9 years agorollup merge of #19895: jbranchaud/add-string-add-doctest
Alex Crichton [Wed, 17 Dec 2014 16:35:13 +0000 (08:35 -0800)]
rollup merge of #19895: jbranchaud/add-string-add-doctest

9 years agorollup merge of #19893: JacobEdelman/patch-1
Alex Crichton [Wed, 17 Dec 2014 16:35:11 +0000 (08:35 -0800)]
rollup merge of #19893: JacobEdelman/patch-1

FIxed the spelling of the word "specific".

9 years agorollup merge of #19892: pnkfelix/region-graphviz
Alex Crichton [Wed, 17 Dec 2014 16:35:07 +0000 (08:35 -0800)]
rollup merge of #19892: pnkfelix/region-graphviz

Added -Z print-region-graph debugging option; produces graphviz visualization of region inference constraint graph.

Optionally uses environment variables `RUST_REGION_GRAPH=<path_template>` and `RUST_REGION_GRAPH_NODE=<node-id>` to select which file to output to and which AST node to print.

9 years agorollup merge of #19889: FlaPer87/unboxed-closure
Alex Crichton [Wed, 17 Dec 2014 16:35:02 +0000 (08:35 -0800)]
rollup merge of #19889: FlaPer87/unboxed-closure

The fix just checks if the bound is `Copy` and returns an `Err` if so.

Closes: #19817
@nikomatsakis r?

9 years agorollup merge of #19887: alexcrichton/serialize-fn-mut
Alex Crichton [Wed, 17 Dec 2014 16:35:00 +0000 (08:35 -0800)]
rollup merge of #19887: alexcrichton/serialize-fn-mut

Relax some of the bounds on the decoder methods back to FnMut to help accomodate
some more flavorful variants of decoders which may need to run the closure more
than once when it, for example, attempts to find the first successful enum to
decode.

9 years agorollup merge of #19885: alexcrichton/char-escape
Alex Crichton [Wed, 17 Dec 2014 16:34:59 +0000 (08:34 -0800)]
rollup merge of #19885: alexcrichton/char-escape

This changes the `escape_unicode` method on a `char` to use the new style of
unicode escapes in the language.

Closes #19811
Closes #19879

9 years agorollup merge of #19881: larroy/master
Alex Crichton [Wed, 17 Dec 2014 16:34:57 +0000 (08:34 -0800)]
rollup merge of #19881: larroy/master

Now they trigger warnings.

9 years agorollup merge of #19880: sanxiyn/assoc-resolve-lifetime
Alex Crichton [Wed, 17 Dec 2014 16:34:56 +0000 (08:34 -0800)]
rollup merge of #19880: sanxiyn/assoc-resolve-lifetime

Fix #18790.
Fix #19862.

9 years agorollup merge of #19873: drewm1980/master
Alex Crichton [Wed, 17 Dec 2014 16:34:49 +0000 (08:34 -0800)]
rollup merge of #19873: drewm1980/master

In US english, "that" is used in restrictive clauses in place of
"which", and often affects the meaning of sentences.

In UK english and many dialects, no distinction is
made.

While Rust devs want to avoid unproductive pedanticism, it is worth at
least being uniform in documentation such as:

http://doc.rust-lang.org/std/iter/index.html

and also in cases where correct usage of US english clarifies the
sentence.

9 years agorollup merge of #19871: pczarn/ring_buf-remove
Alex Crichton [Wed, 17 Dec 2014 16:34:48 +0000 (08:34 -0800)]
rollup merge of #19871: pczarn/ring_buf-remove

Includes a fix for a small mistake in `fn insert` which is caught by test_insert for len=15, but not len=7.

Part of #18424

r? @Gankro @csherratt @huonw

9 years agorollup merge of #19869: sfackler/free-stdin
Alex Crichton [Wed, 17 Dec 2014 16:34:44 +0000 (08:34 -0800)]
rollup merge of #19869: sfackler/free-stdin

r? @aturon

9 years agorollup merge of #19868: sourcefrog/master
Alex Crichton [Wed, 17 Dec 2014 16:34:43 +0000 (08:34 -0800)]
rollup merge of #19868: sourcefrog/master

The rendered form in http://doc.rust-lang.org/nightly/std/rand/struct.OsRng.html looks wrong.

9 years agorollup merge of #19860: japaric/copy-markers
Alex Crichton [Wed, 17 Dec 2014 16:34:35 +0000 (08:34 -0800)]
rollup merge of #19860: japaric/copy-markers

Necessary to implement `Copy` on structs like this one:

``` rust
struct Slice<'a, T> {
    _contravariant: marker::ContravariantLifetime<'a>,
    _nosend: marker::NoSend,
    data: *const T,
    length: uint,
}
```

r? @alexcrichton

9 years agorollup merge of #19859: alexcrichton/flaky-test
Alex Crichton [Wed, 17 Dec 2014 16:34:34 +0000 (08:34 -0800)]
rollup merge of #19859: alexcrichton/flaky-test

This test would read with a timeout and then send a UDP message, expecting the
message to be received. The receiving port, however, was bound in the child
thread so it could be the case that the timeout and send happens before the
child thread runs. To remedy this we just bind the port before the child thread
runs, moving it into the child later on.

cc #19120

9 years agorollup merge of #19857: japaric/test-19129
Alex Crichton [Wed, 17 Dec 2014 16:34:28 +0000 (08:34 -0800)]
rollup merge of #19857: japaric/test-19129

Closes #19129

9 years agorollup merge of #19856: iKevinY/faq-fixes
Alex Crichton [Wed, 17 Dec 2014 16:34:16 +0000 (08:34 -0800)]
rollup merge of #19856: iKevinY/faq-fixes

- Change long inline code to code block
- Replace double-hyphens with en dash
- Miscellaneous rephrasings for clarity

**Edit**: Trivial `commit --amend` to change the commit message slightly.

9 years agorollup merge of #19849: alexcrichton/second-pass-option
Alex Crichton [Wed, 17 Dec 2014 16:34:14 +0000 (08:34 -0800)]
rollup merge of #19849: alexcrichton/second-pass-option

This commit takes a second pass through the `std::option` module to fully
stabilize any lingering methods inside of it.

These items were made stable as-is

* Some
* None
* as_mut
* expect
* unwrap
* unwrap_or
* unwrap_or_else
* map
* map_or
* map_or_else
* and_then
* or_else
* unwrap_or_default
* Default implementation
* FromIterator implementation
* Copy implementation

These items were made stable with modifications

* iter - now returns a struct called Iter
* iter_mut - now returns a struct called IterMut
* into_iter - now returns a struct called IntoIter, Clone is never implemented

This is a breaking change due to the modifications to the names of the iterator
types returned. Code referencing the old names should updated to referencing the
newer names instead. This is also a breaking change due to the fact that
`IntoIter` no longer implements the `Clone` trait.

These items were explicitly not stabilized

* as_slice - waiting on indexing conventions
* as_mut_slice - waiting on conventions with as_slice as well
* cloned - the API was still just recently added
* ok_or - API remains experimental
* ok_or_else - API remains experimental

[breaking-change]

9 years agorollup merge of #19846: nicholasbishop/bishops_magical_intuition
Alex Crichton [Wed, 17 Dec 2014 16:34:12 +0000 (08:34 -0800)]
rollup merge of #19846: nicholasbishop/bishops_magical_intuition

9 years agorollup merge of #19845: jbranchaud/fix-indentation-in-ownership-guide
Alex Crichton [Wed, 17 Dec 2014 16:34:11 +0000 (08:34 -0800)]
rollup merge of #19845: jbranchaud/fix-indentation-in-ownership-guide

For reference, this is what the code example looks like before the change:

![screen shot 2014-12-14 at 12 12 58 pm](https://cloud.githubusercontent.com/assets/694063/5428475/ade24176-838a-11e4-870b-c7d4f55bc8d7.png)

9 years agorollup merge of #19838: shepmaster/invariant-lifetime-copy
Alex Crichton [Wed, 17 Dec 2014 16:34:10 +0000 (08:34 -0800)]
rollup merge of #19838: shepmaster/invariant-lifetime-copy

Both ContravariantLifetime and CovariantLifetime are marked as Copy,
so it makes sense for InvariantLifetime to be as well.

9 years agorollup merge of #19832: japaric/no-nocopy
Alex Crichton [Wed, 17 Dec 2014 16:34:09 +0000 (08:34 -0800)]
rollup merge of #19832: japaric/no-nocopy

r? @aturon / @alexcrichton

9 years agorollup merge of #19831: luqmana/deriving-where
Alex Crichton [Wed, 17 Dec 2014 16:34:08 +0000 (08:34 -0800)]
rollup merge of #19831: luqmana/deriving-where

Fixes #19358.

9 years agorollup merge of #19830: mchaput/patch-1
Alex Crichton [Wed, 17 Dec 2014 16:34:07 +0000 (08:34 -0800)]
rollup merge of #19830: mchaput/patch-1

Error message has wrong spelling ("radix is to high").

9 years agorollup merge of #19827: japaric/clone-uc
Alex Crichton [Wed, 17 Dec 2014 16:34:06 +0000 (08:34 -0800)]
rollup merge of #19827: japaric/clone-uc

closes #12677 (cc @Valloric)
cc #15294

r? @aturon / @alexcrichton

(Because of #19358 I had to move the struct bounds from the `where` clause into the parameter list)

9 years agorollup merge of #19821: bkoropoff/issue-19791
Alex Crichton [Wed, 17 Dec 2014 16:34:04 +0000 (08:34 -0800)]
rollup merge of #19821: bkoropoff/issue-19791

Normalize late-bound regions in bare functions, stack closures, and traits and include them in the generated hash.

Closes #19791

r? @nikomatsakis (does my normalization make sense?)
cc @alexcrichton

9 years agorollup merge of #19820: alexcrichton/deprecate-some-more-libs
Alex Crichton [Wed, 17 Dec 2014 16:34:03 +0000 (08:34 -0800)]
rollup merge of #19820: alexcrichton/deprecate-some-more-libs

This commit deprecates a few more in-tree libs for their crates.io counterparts.
Note that this commit does not make use of the #[deprecated] tag to prevent
warnings from being generated for in-tree usage. Once #[unstable] warnings are
turned on then all external users will be warned to move.

These crates have all been duplicated in rust-lang/$crate repositories so
development can happen independently of the in-tree copies. We can explore at a
later date replacing the in-tree copies with the external copies, but at this
time the libraries have changed very little over the past few months so it's
unlikely for changes to be sent to both repos.

cc #19260

9 years agorollup merge of #19818: emk/regex_at_name_opt
Alex Crichton [Wed, 17 Dec 2014 16:34:01 +0000 (08:34 -0800)]
rollup merge of #19818: emk/regex_at_name_opt

Hello! This is my first Rust patch, and I fear that I've probably skipped at least 7 critical steps. I'd appreciate your feedback and advice about how to contribute to Rust.

This patch is based on a discussion with @BurntSushi in #14602 a while back. I'm happy to revise it as needed to fit into the modern world. :-)

As discussed in that issue, the existing `at` and `name` functions represent two different results with the empty string:

1. Matched the empty string.
2. Did not match anything.

Consider the following example.  This regex has two named matched groups, `key` and `value`. `value` is optional:

```rust
// Matches "foo", "foo;v=bar" and "foo;v=".
regex!(r"(?P<key>[a-z]+)(;v=(?P<value>[a-z]*))?");
```

We can access `value` using `caps.name("value")`, but there's no way for us to distinguish between the `"foo"` and `"foo;v="` cases.

Early this year, @BurntSushi recommended modifying the existing `at` and `name` functions to return `Option`, instead of adding new functions to the API.

This is a [breaking-change], but the fix is easy:

- `refs.at(1)` becomes `refs.at(1).unwrap_or("")`.
- `refs.name(name)` becomes `refs.name(name).unwrap_or("")`.

9 years agorollup merge of #19770: csouth3/iterator-wrapperstructs
Alex Crichton [Wed, 17 Dec 2014 16:33:58 +0000 (08:33 -0800)]
rollup merge of #19770: csouth3/iterator-wrapperstructs

Using a type alias for iterator implementations is fragile since this exposes the implementation to users of the iterator, and any changes could break existing code.

This PR changes the iterators of `BTreeMap`, `BTreeSet`, `HashMap`, and `HashSet` to use proper new types, rather than type aliases.  However, since it is fair-game to treat a type-alias as the aliased type, this is a:

[breaking-change].

9 years agorollup merge of #19766: nick29581/coerce-raw
Alex Crichton [Wed, 17 Dec 2014 16:33:57 +0000 (08:33 -0800)]
rollup merge of #19766: nick29581/coerce-raw

r?

9 years agorollup merge of #19764: lifthrasiir/that-stray-nul
Alex Crichton [Wed, 17 Dec 2014 16:33:54 +0000 (08:33 -0800)]
rollup merge of #19764: lifthrasiir/that-stray-nul

Fixes #19719.

9 years agorollup merge of #19755: alexcrichton/rust-serialize
Alex Crichton [Wed, 17 Dec 2014 16:33:53 +0000 (08:33 -0800)]
rollup merge of #19755: alexcrichton/rust-serialize

The primary focus of Rust's stability story at 1.0 is the standard library.
All other libraries distributed with the Rust compiler are planned to
be #[unstable] and therfore only accessible on the nightly channel of Rust. One
of the more widely used libraries today is libserialize, Rust's current solution
for encoding and decoding types.

The current libserialize library, however, has a number of drawbacks:

* The API is not ready to be stabilize as-is and we will likely not have enough
  resources to stabilize the API for 1.0.
* The library is not necessarily the speediest implementations with alternatives
  being developed out-of-tree (e.g. serde from erickt).
* It is not clear how the API of Encodable/Decodable can evolve over time while
  maintaining backwards compatibility.

One of the major pros to the current libserialize, however, is
`deriving(Encodable, Decodable)` as short-hands for enabling serializing and
deserializing a type. This is unambiguously useful functionality, so we cannot
simply deprecate the in-tree libserialize in favor of an external crates.io
implementation.

For these reasons, this commit starts off a stability story for libserialize by
following these steps:

1. The deriving(Encodable, Decodable) modes will be deprecated in favor of a
   renamed deriving(RustcEncodable, RustcDecodable).
2. The in-tree libserialize will be deprecated in favor of an external
   rustc-serialize crate shipped on crates.io. The contents of the crate will be
   the same for now (but they can evolve separately).
3. At 1.0 serialization will be performed through
   deriving(RustcEncodable, RustcDecodable) and the rustc-serialize crate. The
   expansions for each deriving mode will change from `::serialize::foo` to
   `::rustc_serialize::foo`.

This story will require that the compiler freezes its implementation of
`RustcEncodable` deriving for all of time, but this should be a fairly minimal
maintenance burden. Otherwise the crate in crates.io must always maintain the
exact definition of its traits, but the implementation of json, for example, can
continue to evolve in the semver-sense.

The major goal for this stabilization effort is to pave the road for a new
official serialization crate which can replace the current one, solving many of
its downsides in the process. We are not assuming that this will exist for 1.0,
hence the above measures. Some possibilities for replacing libserialize include:

* If plugins have a stable API, then any crate can provide a custom `deriving`
  mode (will require some compiler work). This means that any new serialization
  crate can provide its own `deriving` with its own backing
  implementation, entirely obsoleting the current libserialize and fully
  replacing it.

* Erick is exploring the possibility of code generation via preprocessing Rust
  source files in the near term until plugins are stable. This strategy would
  provide the same ergonomic benefit that `deriving` does today in theory.

So, in summary, the current libserialize crate is being deprecated in favor of
the crates.io-based rustc-serialize crate where the `deriving` modes are
appropriately renamed. This opens up space for a later implementation of
serialization in a more official capacity while allowing alternative
implementations to be explored in the meantime.

Concretely speaking, this change adds support for the `RustcEncodable` and
`RustcDecodable` deriving modes. After a snapshot is made warnings will be
turned on for usage of `Encodable` and `Decodable` as well as deprecating the
in-tree libserialize crate to encurage users to use rustc-serialize instead.

9 years agorollup merge of #19753: brson/rust-installer
Alex Crichton [Wed, 17 Dec 2014 16:33:52 +0000 (08:33 -0800)]
rollup merge of #19753: brson/rust-installer

This is just a refactoring of the current installer so that Rust and Cargo
use the same codebase.

cc #16456

9 years agorollup merge of #19743: steveklabnik/gh16143
Alex Crichton [Wed, 17 Dec 2014 16:33:50 +0000 (08:33 -0800)]
rollup merge of #19743: steveklabnik/gh16143

This will hopefully help people with their first steps in Rust.

Fixes #16143.

/cc @jvns

9 years agorollup merge of #19729: vhbit/ios-oibit-fix
Alex Crichton [Wed, 17 Dec 2014 16:33:46 +0000 (08:33 -0800)]
rollup merge of #19729: vhbit/ios-oibit-fix

9 years agorollup merge of #19720: csouth3/vecmap-newtypes
Alex Crichton [Wed, 17 Dec 2014 16:33:44 +0000 (08:33 -0800)]
rollup merge of #19720: csouth3/vecmap-newtypes

Using a type alias for iterator implementations is fragile since this
exposes the implementation to users of the iterator, and any changes
could break existing code.

This commit changes the iterators of `VecMap` to use
proper new types, rather than type aliases.  However, since it is
fair-game to treat a type-alias as the aliased type, this is a:

[breaking-change].

9 years agoauto merge of #19800 : sfackler/rust/core-hash, r=alexcrichton
bors [Wed, 17 Dec 2014 16:43:20 +0000 (16:43 +0000)]
auto merge of #19800 : sfackler/rust/core-hash, r=alexcrichton

r? @alexcrichton

9 years agoauto merge of #19799 : alexcrichton/rust/stop-panicking, r=huonw
bors [Wed, 17 Dec 2014 14:33:12 +0000 (14:33 +0000)]
auto merge of #19799 : alexcrichton/rust/stop-panicking, r=huonw

Fix a panic where the compiler was looking at stale or old metadata.

See #19798, #19772, #19757, #19744, #19718, #19691.

9 years agoCorrect span in privacy error
Seo Sanghyeon [Wed, 17 Dec 2014 14:23:20 +0000 (23:23 +0900)]
Correct span in privacy error

9 years agoauto merge of #19789 : nick29581/rust/assoc-ufcs2, r=nikomatsakis
bors [Wed, 17 Dec 2014 08:13:07 +0000 (08:13 +0000)]
auto merge of #19789 : nick29581/rust/assoc-ufcs2, r=nikomatsakis

Closes #18433