]> git.lizzy.rs Git - rust.git/log
rust.git
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 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

9 years agoauto merge of #19761 : nick29581/rust/coerce-double, r=nikomatsakis
bors [Wed, 17 Dec 2014 02:42:57 +0000 (02:42 +0000)]
auto merge of #19761 : nick29581/rust/coerce-double, r=nikomatsakis

Part of #18469

[breaking-change]

A receiver will only ever get a single auto-reference. Previously arrays and strings would get two, e.g., [T] would be auto-ref'ed to &&[T]. This is usually apparent when a trait is implemented for `&[T]` and has a method takes self by reference. The usual solution is to implement the trait for `[T]` (the DST form).

r? @nikomatsakis (or anyone else, really)

9 years agoMinor changes to Rust Language FAQ
Kevin Yap [Mon, 15 Dec 2014 02:10:34 +0000 (18:10 -0800)]
Minor changes to Rust Language FAQ

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

9 years agoImplement remove for RingBuf
Piotr Czarnecki [Tue, 16 Dec 2014 23:37:55 +0000 (00:37 +0100)]
Implement remove for RingBuf

9 years agoDocument std::mem
Steve Klabnik [Tue, 16 Dec 2014 23:23:55 +0000 (18:23 -0500)]
Document std::mem

9 years agoguide-ownership.md, guide-testing.md: fix typos
Philipp Gesang [Sun, 7 Dec 2014 21:02:17 +0000 (22:02 +0100)]
guide-ownership.md, guide-testing.md: fix typos

Signed-off-by: Philipp Gesang <phg@phi-gamma.net>
9 years agoSmall cleanups in HashMap based off of new rust features.
Clark Gaebel [Tue, 16 Dec 2014 21:00:37 +0000 (16:00 -0500)]
Small cleanups in HashMap based off of new rust features.

9 years agoUse the sugary syntax to print the `Fn` traits in error messages
P1start [Tue, 16 Dec 2014 00:38:34 +0000 (13:38 +1300)]
Use the sugary syntax to print the `Fn` traits in error messages

9 years agoChange 'if' to lowercase, so it displays better on the site
Sean Collins [Tue, 16 Dec 2014 17:57:51 +0000 (12:57 -0500)]
Change 'if' to lowercase, so it displays better on the site

9 years agoauto merge of #19921 : FlaPer87/rust/snapshot, r=nikomatsakis
bors [Tue, 16 Dec 2014 17:51:23 +0000 (17:51 +0000)]
auto merge of #19921 : FlaPer87/rust/snapshot, r=nikomatsakis

r? @nikomatsakis

9 years agostd: Change escape_unicode to use new escapes
Alex Crichton [Mon, 15 Dec 2014 16:49:01 +0000 (08:49 -0800)]
std: Change escape_unicode to use new escapes

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 agoFix `make TAGS.emacs`.
Felix S. Klock II [Tue, 16 Dec 2014 16:08:49 +0000 (17:08 +0100)]
Fix `make TAGS.emacs`.

9 years agoFollowup fixes that I missed during an earlier rebase.
Felix S. Klock II [Tue, 16 Dec 2014 16:07:26 +0000 (17:07 +0100)]
Followup fixes that I missed during an earlier rebase.

9 years agoFixed iOS build after oibit
Valerii Hiora [Thu, 11 Dec 2014 09:51:25 +0000 (11:51 +0200)]
Fixed iOS build after oibit

9 years agoauto merge of #19647 : nielsegberts/rust/master, r=pnkfelix
bors [Tue, 16 Dec 2014 14:50:58 +0000 (14:50 +0000)]
auto merge of #19647 : nielsegberts/rust/master, r=pnkfelix

The names expected and actual are not used anymore in the output. It also
removes the confusion that the argument order is the opposite of junit.

Bug #7330 is relevant.

9 years agoCreate a snapshot on top of 1b97cd3
Flavio Percoco [Tue, 16 Dec 2014 13:39:00 +0000 (14:39 +0100)]
Create a snapshot on top of 1b97cd3

9 years agoAST refactor: make the place in ExprBox an option.
Felix S. Klock II [Tue, 16 Dec 2014 13:30:30 +0000 (14:30 +0100)]
AST refactor: make the 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 agoauto merge of #19782 : gereeter/rust/cleanup-btree-node, r=Gankro
bors [Tue, 16 Dec 2014 11:02:56 +0000 (11:02 +0000)]
auto merge of #19782 : gereeter/rust/cleanup-btree-node, r=Gankro

Before:
```
test btree::map::bench::find_rand_100                      ... bench:        12 ns/iter (+/- 0)
test btree::map::bench::find_rand_10_000                   ... bench:        13 ns/iter (+/- 1)
test btree::map::bench::find_seq_100                       ... bench:        11 ns/iter (+/- 0)
test btree::map::bench::find_seq_10_000                    ... bench:        11 ns/iter (+/- 1)
test btree::map::bench::insert_rand_100                    ... bench:       106 ns/iter (+/- 1)
test btree::map::bench::insert_rand_10_000                 ... bench:       326 ns/iter (+/- 8)
test btree::map::bench::insert_seq_100                     ... bench:       198 ns/iter (+/- 1)
test btree::map::bench::insert_seq_10_000                  ... bench:       312 ns/iter (+/- 3)
test btree::map::bench::iter_1000                          ... bench:     16563 ns/iter (+/- 173)
test btree::map::bench::iter_100000                        ... bench:   1686508 ns/iter (+/- 108592)
test btree::map::bench::iter_20                            ... bench:       365 ns/iter (+/- 25)
```

After:
```
test btree::map::bench::find_rand_100                      ... bench:        12 ns/iter (+/- 0)
test btree::map::bench::find_rand_10_000                   ... bench:        12 ns/iter (+/- 0)
test btree::map::bench::find_seq_100                       ... bench:        11 ns/iter (+/- 0)
test btree::map::bench::find_seq_10_000                    ... bench:        11 ns/iter (+/- 0)
test btree::map::bench::insert_rand_100                    ... bench:        89 ns/iter (+/- 1)
test btree::map::bench::insert_rand_10_000                 ... bench:       121 ns/iter (+/- 3)
test btree::map::bench::insert_seq_100                     ... bench:       149 ns/iter (+/- 0)
test btree::map::bench::insert_seq_10_000                  ... bench:       228 ns/iter (+/- 1)
test btree::map::bench::iter_1000                          ... bench:     16965 ns/iter (+/- 220)
test btree::map::bench::iter_100000                        ... bench:   1687836 ns/iter (+/- 18746)
test btree::map::bench::iter_20                            ... bench:       366 ns/iter (+/- 21)
```

9 years agoDon't make unboxed closures implicitly copiable
Flavio Percoco [Mon, 15 Dec 2014 20:49:49 +0000 (21:49 +0100)]
Don't make unboxed closures implicitly copiable

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

Closes: #19817
9 years agoauto merge of #19777 : nikomatsakis/rust/warn-on-shadowing, r=acrichto
bors [Tue, 16 Dec 2014 08:42:40 +0000 (08:42 +0000)]
auto merge of #19777 : nikomatsakis/rust/warn-on-shadowing, r=acrichto

per rfc 459
cc https://github.com/rust-lang/rust/issues/19390

One question is: should we start by warning, and only switch to hard error later? I think we discussed something like this in the meeting.

r? @alexcrichton

9 years agoTuple test no longer needed. Is already in run-pass tests
mdinger [Tue, 16 Dec 2014 07:42:25 +0000 (02:42 -0500)]
Tuple test no longer needed. Is already in run-pass tests

9 years agoMove hash module from collections to core
Steven Fackler [Sat, 13 Dec 2014 02:43:07 +0000 (18:43 -0800)]
Move hash module from collections to core

9 years agoauto merge of #19478 : nick29581/rust/assoc-ice-test, r=nikomatsakis
bors [Tue, 16 Dec 2014 06:22:40 +0000 (06:22 +0000)]
auto merge of #19478 : nick29581/rust/assoc-ice-test, r=nikomatsakis

closes #19121

r?

This won't actually pass until https://github.com/rust-lang/rust/pull/19391 lands

9 years agoAdd probe and var for file
Aaron Friel [Tue, 16 Dec 2014 04:45:12 +0000 (22:45 -0600)]
Add probe and var for file

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 agoTest for associated types ICE
Nick Cameron [Tue, 2 Dec 2014 23:06:39 +0000 (15:06 -0800)]
Test for associated types ICE

closes #19121

9 years agoRemove the double auto-ref on arrays/strings as receivers
Nick Cameron [Fri, 12 Dec 2014 00:23:21 +0000 (13:23 +1300)]
Remove the double auto-ref on arrays/strings as receivers

Part of #18469

[breaking-change]

A receiver will only ever get a single auto-reference. Previously arrays and strings would get two, e.g., [T] would be auto-ref'ed to &&[T]. This is usually apparent when a trait is implemented for `&[T]` and has a method takes self by reference. The usual solution is to implement the trait for `[T]` (the DST form).

9 years agostd: Second pass stabilization of `default`
Alex Crichton [Tue, 16 Dec 2014 04:04:52 +0000 (20:04 -0800)]
std: Second pass stabilization of `default`

This commit performs a second pass stabilization of the `std::default` module.
The module was already marked `#[stable]`, and the inheritance of `#[stable]`
was removed since this attribute was applied. This commit adds the `#[stable]`
attribute to the trait definition and one method name, along with all
implementations found in the standard distribution.

9 years agostd: Second-pass stabilization of `mem`
Alex Crichton [Tue, 16 Dec 2014 03:40:25 +0000 (19:40 -0800)]
std: Second-pass stabilization of `mem`

This commit takes a second pass through the `std::mem` module for stabilization.
The only remaining non-stable items in this module were `forget`, `transmute`,
`copy_lifetime`, and `copy_lifetime_mut`.

The `forget` and `transmute` intrinsics themselves were marked `#[stable]` to
propgate into the `core::mem` module so they would be marked stable.

The `copy_lifetime` functions were left `unstable`, but `Sized?` annotations
were added to the parameters to allow more general use with DSTs.

The `size_of_val`, `min_align_of_val`, and `align_of_val` functions would like
to grow `Sized?` bounds, but this is a backwards compatible change that
currently ICEs the compiler, so this change was not made at this time.

Finally, the module itself was declared `#![stable]` in this pass.

9 years agoFix pretty printing of HRTB syntax
Brian Koropoff [Sun, 14 Dec 2014 03:11:04 +0000 (19:11 -0800)]
Fix pretty printing of HRTB syntax

9 years agoAdd regression test for #19791
Brian Koropoff [Sat, 13 Dec 2014 22:42:38 +0000 (14:42 -0800)]
Add regression test for #19791

9 years agoHandle higher-rank lifetimes when generating type IDs
Brian Koropoff [Sat, 13 Dec 2014 22:40:38 +0000 (14:40 -0800)]
Handle higher-rank lifetimes when generating type IDs

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

Closes #19791

9 years agoauto merge of #19747 : alexcrichton/rust/slice-one-trait, r=brson
bors [Tue, 16 Dec 2014 01:32:33 +0000 (01:32 +0000)]
auto merge of #19747 : alexcrichton/rust/slice-one-trait, r=brson

This commit collapses the various prelude traits for slices into just one trait:

* SlicePrelude/SliceAllocPrelude => SliceExt
* CloneSlicePrelude/CloneSliceAllocPrelude => CloneSliceExt
* OrdSlicePrelude/OrdSliceAllocPrelude => OrdSliceExt
* PartialEqSlicePrelude => PartialEqSliceExt

9 years agoUse wrapper structs for `HashSet`'s iterators.
Chase Southwood [Sat, 13 Dec 2014 18:36:05 +0000 (12:36 -0600)]
Use wrapper structs for `HashSet`'s iterators.

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 `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 agoUse wrapper structs for `HashMap`'s iterators.
Chase Southwood [Fri, 12 Dec 2014 07:02:19 +0000 (01:02 -0600)]
Use wrapper structs for `HashMap`'s iterators.

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 keys and values iterators of `HashMap` 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 agoUse wrapper structs for `BTreeSet`'s iterators.
Chase Southwood [Sat, 13 Dec 2014 05:14:57 +0000 (23:14 -0600)]
Use wrapper structs for `BTreeSet`'s iterators.

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 `BTreeSet` 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 agoUse wrapper structs for `BTreeMap`'s iterators.
Chase Southwood [Fri, 12 Dec 2014 06:04:47 +0000 (00:04 -0600)]
Use wrapper structs for `BTreeMap`'s iterators.

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 keys and values iterators of `BTreeMap` 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 agoReview changes
Nick Cameron [Tue, 16 Dec 2014 00:48:18 +0000 (13:48 +1300)]
Review changes

9 years agoPath types to associated types with form `T::A`
Nick Cameron [Thu, 4 Dec 2014 19:58:52 +0000 (11:58 -0800)]
Path types to associated types with form `T::A`

Closes #18433

9 years agoAdd a doctest for the string Add function.
jbranchaud [Mon, 15 Dec 2014 22:40:27 +0000 (16:40 -0600)]
Add a doctest for the string Add function.

9 years agoauto merge of #19448 : japaric/rust/binops-by-value, r=nikomatsakis
bors [Mon, 15 Dec 2014 22:11:44 +0000 (22:11 +0000)]
auto merge of #19448 : japaric/rust/binops-by-value, r=nikomatsakis

- The following operator traits now take their arguments by value: `Add`, `Sub`, `Mul`, `Div`, `Rem`, `BitAnd`, `BitOr`, `BitXor`, `Shl`, `Shr`. This breaks all existing implementations of these traits.

- The binary operation `a OP b` now "desugars" to `OpTrait::op_method(a, b)` and consumes both arguments.

- `String` and `Vec` addition have been changed to reuse the LHS owned value, and to avoid internal cloning. Only the following asymmetric operations are available: `String + &str` and `Vec<T> + &[T]`, which are now a short-hand for the "append" operation.

[breaking-change]

---

This passes `make check` locally. I haven't touch the unary operators in this PR, but converting them to by value should be very similar to this PR. I can work on them after this gets the thumbs up.

@nikomatsakis r? the compiler changes
@aturon r? the library changes. I think the only controversial bit is the semantic change of the `Vec`/`String` `Add` implementation.
cc #19148

9 years agoFixed a small spelling mistake
Jacob Edelman [Mon, 15 Dec 2014 22:07:49 +0000 (17:07 -0500)]
Fixed a small spelling mistake

9 years agoAdded `-Z print-region-graph` debugging option; produces graphviz
Felix S. Klock II [Mon, 15 Dec 2014 16:17:52 +0000 (17:17 +0100)]
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.

Note that in some cases of method AST's, the identification of AST
node is based on the id for the *body* of the method; this is largely
due to having the body node-id already available at the relevant point
in the control-flow of rustc in its current incarnation. Ideally we
would handle identifying AST's by name in addition to node-id,
e.g. the same way that the pretty-printer supports path suffixes as
well as node-ids for identifying subtrees to print.

9 years agolibgraphviz: extend API with flags to indicate options like "do not include labels".
Felix S. Klock II [Mon, 15 Dec 2014 11:37:42 +0000 (12:37 +0100)]
libgraphviz: extend API with flags to indicate options like "do not include labels".

9 years agolibgraphviz: add `label` and `escaped` ctors taking any `str::IntoMaybeOwned`.
Felix S. Klock II [Mon, 15 Dec 2014 11:32:54 +0000 (12:32 +0100)]
libgraphviz: add `label` and `escaped` ctors taking any `str::IntoMaybeOwned`.

9 years agolibstd: add a dummy field to `OsRng` to avoid out of module construction
Jorge Aparicio [Mon, 15 Dec 2014 20:35:34 +0000 (15:35 -0500)]
libstd: add a dummy field to `OsRng` to avoid out of module construction

9 years agoRemove internal uses of `marker::NoCopy`
Jorge Aparicio [Sun, 14 Dec 2014 04:06:44 +0000 (23:06 -0500)]
Remove internal uses of `marker::NoCopy`

9 years agoserialize: Change some FnOnce bounds to FnMut
Alex Crichton [Mon, 15 Dec 2014 17:06:06 +0000 (09:06 -0800)]
serialize: Change some FnOnce bounds to FnMut

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.

This a breaking change due to the bounds for the trait switching, and clients
will need to update from `FnOnce` to `FnMut` as well as likely making the local
function binding mutable in order to call the function.

[breaking-change]

9 years agoauto merge of #19882 : steveklabnik/rust/fix_download, r=nikomatsakis
bors [Mon, 15 Dec 2014 19:12:44 +0000 (19:12 +0000)]
auto merge of #19882 : steveklabnik/rust/fix_download, r=nikomatsakis

Thank you, @Ap0ph1s.

9 years agoauto merge of #19785 : brson/rust/rollup, r=brson
bors [Mon, 15 Dec 2014 15:33:11 +0000 (15:33 +0000)]
auto merge of #19785 : brson/rust/rollup, r=brson

9 years agoRemove all shadowed lifetimes.
Niko Matsakis [Fri, 12 Dec 2014 16:09:32 +0000 (11:09 -0500)]
Remove all shadowed lifetimes.

9 years agoEmit warning when lifetime names are shadowed.
Niko Matsakis [Fri, 12 Dec 2014 16:09:24 +0000 (11:09 -0500)]
Emit warning when lifetime names are shadowed.

This is not technically a [breaking-change], but it will be soon, so
you should update your code. Typically, shadowing is accidental, and
the shadowing lifetime can simply be removed. This frequently occurs
in constructor patterns:

```rust
// Old:
impl<'a> SomeStruct<'a> { fn new<'a>(..) -> SomeStruct<'a> { ... } }

// Should be:
impl<'a> SomeStruct<'a> { fn new(..) -> SomeStruct<'a> { ... } }
```

Otherwise, you should rename the inner lifetime to something
else. Note though that lifetime elision frequently applies:

```rust
// Old
impl<'a> SomeStruct<'a> {
    fn get<'a>(x: &'a self) -> &'a T { &self.field }
}

// Should be:
impl<'a> SomeStruct<'a> {
    fn get(x: &self) -> &T { &self.field }
}
``

9 years agoFix windows download links
Steve Klabnik [Mon, 15 Dec 2014 14:55:56 +0000 (09:55 -0500)]
Fix windows download links

Thank you, @Ap0ph1s.

9 years agorollup merge of #19814: jbranchaud/fix-a-typo-in-ownership-guide
Brian Anderson [Sun, 14 Dec 2014 02:24:45 +0000 (18:24 -0800)]
rollup merge of #19814: jbranchaud/fix-a-typo-in-ownership-guide