]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoauto merge of #20610 : alexcrichton/rust/rollup, r=alexcrichton
bors [Tue, 6 Jan 2015 08:25:32 +0000 (08:25 +0000)]
auto merge of #20610 : alexcrichton/rust/rollup, r=alexcrichton

9 years agoMore test fixes!
Alex Crichton [Tue, 6 Jan 2015 03:13:38 +0000 (19:13 -0800)]
More test fixes!

9 years agoRevert "Remove i suffix in docs"
Alex Crichton [Tue, 6 Jan 2015 03:08:37 +0000 (19:08 -0800)]
Revert "Remove i suffix in docs"

This reverts commit f031671c6ea79391eeb3e1ad8f06fe0e436103fb.

Conflicts:
src/libcollections/slice.rs
src/libcore/iter.rs
src/libstd/sync/mpsc/mod.rs
src/libstd/sync/rwlock.rs

9 years agoTest fixes
Alex Crichton [Tue, 6 Jan 2015 03:07:07 +0000 (19:07 -0800)]
Test fixes

9 years agorollup merge of #20482: kmcallister/macro-reform
Alex Crichton [Tue, 6 Jan 2015 03:01:17 +0000 (19:01 -0800)]
rollup merge of #20482: kmcallister/macro-reform

Conflicts:
src/libflate/lib.rs
src/libstd/lib.rs
src/libstd/macros.rs
src/libsyntax/feature_gate.rs
src/libsyntax/parse/parser.rs
src/libsyntax/show_span.rs
src/test/auxiliary/macro_crate_test.rs
src/test/compile-fail/lint-stability.rs
src/test/run-pass/intrinsics-math.rs
src/test/run-pass/tcp-connect-timeouts.rs

9 years agorollup merge of #20608: nikomatsakis/assoc-types-method-dispatch
Alex Crichton [Tue, 6 Jan 2015 02:56:45 +0000 (18:56 -0800)]
rollup merge of #20608: nikomatsakis/assoc-types-method-dispatch

9 years agoMerge remote-tracking branch 'nrc/sized-2' into rollup
Alex Crichton [Tue, 6 Jan 2015 02:55:41 +0000 (18:55 -0800)]
Merge remote-tracking branch 'nrc/sized-2' into rollup

Conflicts:
src/liballoc/boxed.rs
src/libcollections/btree/map.rs
src/libcollections/slice.rs
src/libcore/borrow.rs
src/libcore/cmp.rs
src/libcore/ops.rs
src/libstd/c_str.rs
src/libstd/collections/hash/map.rs
src/libsyntax/parse/obsolete.rs
src/test/compile-fail/unboxed-closure-sugar-default.rs
src/test/compile-fail/unboxed-closure-sugar-equiv.rs
src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs
src/test/compile-fail/unboxed-closure-sugar-region.rs
src/test/compile-fail/unsized3.rs
src/test/run-pass/associated-types-conditional-dispatch.rs

9 years agoNormalize predicates during method winnowing.
Niko Matsakis [Tue, 6 Jan 2015 02:17:59 +0000 (21:17 -0500)]
Normalize predicates during method winnowing.

Fixes #20604.
Fixes #20378.

9 years agoPermit method calls based on where clauses.
Niko Matsakis [Mon, 5 Jan 2015 21:01:04 +0000 (16:01 -0500)]
Permit method calls based on where clauses.

9 years agorollup merge of #20556: japaric/no-for-sized
Alex Crichton [Tue, 6 Jan 2015 02:47:45 +0000 (18:47 -0800)]
rollup merge of #20556: japaric/no-for-sized

Conflicts:
src/libcollections/slice.rs
src/libcollections/str.rs
src/libcore/borrow.rs
src/libcore/cmp.rs
src/libcore/ops.rs
src/libstd/c_str.rs
src/test/compile-fail/issue-19009.rs

9 years agorollup merge of #20594: nikomatsakis/orphan-ordered
Alex Crichton [Tue, 6 Jan 2015 02:42:34 +0000 (18:42 -0800)]
rollup merge of #20594: nikomatsakis/orphan-ordered

Conflicts:
src/libsyntax/feature_gate.rs

9 years agorollup merge of #20584: brson/versioning
Alex Crichton [Tue, 6 Jan 2015 02:42:08 +0000 (18:42 -0800)]
rollup merge of #20584: brson/versioning

Also, change the version number to 1.0.0.

9 years agorollup merge of #20583: csouth3/vim-syntax
Alex Crichton [Tue, 6 Jan 2015 02:42:06 +0000 (18:42 -0800)]
rollup merge of #20583: csouth3/vim-syntax

The prelude has changed quite a bit since the list that Vim is aware of has been updated.  This pull request brings it up to date with `std::prelude`.

9 years agorollup merge of #20581: apasel422/extend
Alex Crichton [Tue, 6 Jan 2015 02:42:04 +0000 (18:42 -0800)]
rollup merge of #20581: apasel422/extend

9 years agorollup merge of #20568: huonw/ungate-AT-globs
Alex Crichton [Tue, 6 Jan 2015 02:42:00 +0000 (18:42 -0800)]
rollup merge of #20568: huonw/ungate-AT-globs

These aren't in their final form, but are all aiming to be part of 1.0, so at the very least encouraging usage now to find the bugs is nice.

Also, the widespread roll-out of associated types in the standard library indicates they're getting good, and it's lame to have to activate a feature in essentially every crate ever.

9 years agorollup merge of #20566: zsiciarz/fix-stdext-docs
Alex Crichton [Tue, 6 Jan 2015 02:41:59 +0000 (18:41 -0800)]
rollup merge of #20566: zsiciarz/fix-stdext-docs

9 years agorollup merge of #20565: alexcrichton/missing-stability
Alex Crichton [Tue, 6 Jan 2015 02:41:55 +0000 (18:41 -0800)]
rollup merge of #20565: alexcrichton/missing-stability

Conflicts:
src/libstd/sync/mpsc/mod.rs

9 years agorollup merge of #20564: bombless/patch-3
Alex Crichton [Tue, 6 Jan 2015 02:41:23 +0000 (18:41 -0800)]
rollup merge of #20564: bombless/patch-3

Update keyword list according to https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/token.rs

9 years agorollup merge of #20560: aturon/stab-2-iter-ops-slice
Alex Crichton [Tue, 6 Jan 2015 02:41:20 +0000 (18:41 -0800)]
rollup merge of #20560: aturon/stab-2-iter-ops-slice

Conflicts:
src/libcollections/slice.rs
src/libcore/iter.rs
src/libstd/sync/mpsc/mod.rs
src/libstd/sync/rwlock.rs

9 years agorollup merge of #20554: huonw/mut-pattern
Alex Crichton [Tue, 6 Jan 2015 02:38:51 +0000 (18:38 -0800)]
rollup merge of #20554: huonw/mut-pattern

Conflicts:
src/librustc_typeck/check/_match.rs

9 years agorollup merge of #20548: tshepang/fix-ping-pong-benchmark
Alex Crichton [Tue, 6 Jan 2015 02:38:02 +0000 (18:38 -0800)]
rollup merge of #20548: tshepang/fix-ping-pong-benchmark

Looks like no one has checked this benchmark in a long time: its main thread quit too early, taking down the worker threads before they were done.

9 years agorollup merge of #20538: EchoAce/issue-20529
Alex Crichton [Tue, 6 Jan 2015 02:38:01 +0000 (18:38 -0800)]
rollup merge of #20538: EchoAce/issue-20529

Docs in ```tuple.rs``` edited.

Edit: for some reason commits from something else found their way into here.

9 years agorollup merge of #20519: ville-h/rwlock-rename
Alex Crichton [Tue, 6 Jan 2015 02:37:58 +0000 (18:37 -0800)]
rollup merge of #20519: ville-h/rwlock-rename

Conflicts:
src/libstd/sync/rwlock.rs

9 years agorollup merge of #20518: nagisa/weighted-bool
Alex Crichton [Tue, 6 Jan 2015 02:37:25 +0000 (18:37 -0800)]
rollup merge of #20518: nagisa/weighted-bool

1 in 1 chance to return true always results in true.

9 years agorollup merge of #20517: nikomatsakis/safety-issue-19997
Alex Crichton [Tue, 6 Jan 2015 02:37:24 +0000 (18:37 -0800)]
rollup merge of #20517: nikomatsakis/safety-issue-19997

Fixes various safety issues.

r? @aturon

9 years agorollup merge of #20511: csouth3/derive-lint
Alex Crichton [Tue, 6 Jan 2015 02:37:23 +0000 (18:37 -0800)]
rollup merge of #20511: csouth3/derive-lint

`#[deriving]` has been changed to `#[derive]`, so we should update this lint accordingly so that it remains consistent with the language.

Also register the rename with the LintStore.

I've changed the one reference to `raw_pointer_deriving` that occurs in the tests (as well as renamed the file appropriately), but the rest of the `raw_pointer_deriving`s in the Rust codebase will need to wait for a snapshot to be changed because stage0 doesn't know about the new lint name.  I'll take care of the remaining renaming after the next snapshot.

Closes #20498.

9 years agorollup merge of #20507: alexcrichton/issue-20444
Alex Crichton [Tue, 6 Jan 2015 02:37:22 +0000 (18:37 -0800)]
rollup merge of #20507: alexcrichton/issue-20444

This commit is an implementation of [RFC 494][rfc] which removes the entire
`std::c_vec` module and redesigns the `std::c_str` module as `std::ffi`.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0494-c_str-and-c_vec-stability.md

The interface of the new `CString` is outlined in the linked RFC, the primary
changes being:

* The `ToCStr` trait is gone, meaning the `with_c_str` and `to_c_str` methods
  are now gone. These two methods are replaced with a `CString::from_slice`
  method.
* The `CString` type is now just a wrapper around `Vec<u8>` with a static
  guarantee that there is a trailing nul byte with no internal nul bytes. This
  means that `CString` now implements `Deref<Target = [c_char]>`, which is where
  it gains most of its methods from. A few helper methods are added to acquire a
  slice of `u8` instead of `c_char`, as well as including a slice with the
  trailing nul byte if necessary.
* All usage of non-owned `CString` values is now done via two functions inside
  of `std::ffi`, called `c_str_to_bytes` and `c_str_to_bytes_with_nul`. These
  functions are now the one method used to convert a `*const c_char` to a Rust
  slice of `u8`.

Many more details, including newly deprecated methods, can be found linked in
the RFC. This is a:

[breaking-change]
Closes #20444

9 years agorollup merge of #20488: ltratt/nondeterministic_tempdir
Alex Crichton [Tue, 6 Jan 2015 02:37:20 +0000 (18:37 -0800)]
rollup merge of #20488: ltratt/nondeterministic_tempdir

The previous scheme made it possible for another user/attacker to cause the
temporary directory creation scheme to panic. All you needed to know was the pid
of the process you wanted to target ('other_pid') and the suffix it was using
(let's pretend it's 'sfx') and then code such as this would, in essence, DOS it:

    for i in range(0u, 1001) {
        let tp = &Path::new(format!("/tmp/rs-{}-{}-sfx", other_pid, i));
        match fs::mkdir(tp, io::USER_RWX) { _ => () }
    }

Since the scheme only 1000 times to create a temporary directory before dying,
the next time the attacked process called TempDir::new("sfx") after that would
typically cause a panic. Of course, you don't necessarily need an attacker to
cause such a DOS: creating 1000 temporary directories without closing any of the
previous would be enough to DOS yourself.

This patch broadly follows the OpenBSD implementation of mkstemp. It uses the
operating system's random number generator to produce random directory names
that are impractical to guess (and, just in case someone manages to do that, it
retries creating the directory for a long time before giving up; OpenBSD
retries INT_MAX times, although 1<<31 seems enough to thwart even the most
patient attacker).

As a small additional change while the file name is changing, this patch also
makes the argument that TempDir::new takes a prefix rather than a suffix.
This is because 1) it more closely matches what mkstemp and friends do 2)
if you're going to have a deterministic part of a filename, you really want it at
the beginning so that shell completion is useful.

9 years agorollup merge of #20483: nagisa/rng-copy
Alex Crichton [Tue, 6 Jan 2015 02:37:18 +0000 (18:37 -0800)]
rollup merge of #20483: nagisa/rng-copy

* Implement (derive) `Clone` for `ChaChaRng`, `Isaac*Rng`, `StdRng` and `ThreadRng`;
* Derive `XorShiftRng` `Clone` implementation instead of implementing it explicitly.

`OsRng` is the only Rng which does not implement `Clone` or `Copy` after this patch because of its dependence on `Reader`.

r? @huonw I guess?

9 years agorollup merge of #20478: SeanTAllen/master
Alex Crichton [Tue, 6 Jan 2015 02:36:38 +0000 (18:36 -0800)]
rollup merge of #20478: SeanTAllen/master

Number of rustc calls would depending on various circumstances. Two is misleading.

9 years agorollup merge of #20472: mneumann/llvm-dragonfly
Alex Crichton [Tue, 6 Jan 2015 02:36:37 +0000 (18:36 -0800)]
rollup merge of #20472: mneumann/llvm-dragonfly

9 years agorollup merge of #20465: nikomatsakis/assoc-types-regions-20303
Alex Crichton [Tue, 6 Jan 2015 02:36:34 +0000 (18:36 -0800)]
rollup merge of #20465: nikomatsakis/assoc-types-regions-20303

Treat associated types the same as type parameters when it comes to region bounding. Fixes #20303.

Strictly speaking, this is a [breaking-change] (if you are using
associated types). You are no longer free to wantonly violate the type
system rules by closing associated types into objects without any form
of region bound. Instead you should add region bounds like `T::X :
'a`, just as you would with a normal type parameter.

r? @aturon

9 years agorollup merge of #20434: steveklabnik/five_eye
Alex Crichton [Tue, 6 Jan 2015 02:36:32 +0000 (18:36 -0800)]
rollup merge of #20434: steveklabnik/five_eye

This takes advantage of integer fallback to stop recomending `i` so much.

9 years agorollup merge of #20424: jroesch/tuple-struct-where-clause-fix
Alex Crichton [Tue, 6 Jan 2015 02:36:30 +0000 (18:36 -0800)]
rollup merge of #20424: jroesch/tuple-struct-where-clause-fix

Fixes #17904. All the cases that I believe we should support are detailed in the test case, let me know if there is there is any more desired behavior. cc @japaric.

r? @nikomatsakis or whoever is appropriate.

9 years agorollup merge of #20258: sanxiyn/show-span-2
Alex Crichton [Tue, 6 Jan 2015 02:36:28 +0000 (18:36 -0800)]
rollup merge of #20258: sanxiyn/show-span-2

9 years agorollup merge of #20197: pczarn/ring_buf-collections-reform
Alex Crichton [Tue, 6 Jan 2015 02:36:27 +0000 (18:36 -0800)]
rollup merge of #20197: pczarn/ring_buf-collections-reform

Part of collections reform part 1 and 2, #18424 and #19986

* shrink_to_fit
* swap_back_remove
* swap_front_remove
* truncate
* resize

9 years agorollup merge of #20099: P1start/parse-more-macro-ops
Alex Crichton [Tue, 6 Jan 2015 02:36:25 +0000 (18:36 -0800)]
rollup merge of #20099: P1start/parse-more-macro-ops

Closes #20093.

9 years agorollup merge of #20092: barosl/rustdoc-line-number-clickable
Alex Crichton [Tue, 6 Jan 2015 02:36:21 +0000 (18:36 -0800)]
rollup merge of #20092: barosl/rustdoc-line-number-clickable

While talking on IRC, someone wanted to post a link to the Rust source code, but while the lines of the rendered source code do have anchors (`<span id="[line number]">`), there is no convenient way to make links as they are not clickable. This PR makes them clickable.

Also, a minor fix of the FAQ is included.

9 years agorollup merge of #19998: th0114nd/unicode-bottom
Alex Crichton [Tue, 6 Jan 2015 02:36:20 +0000 (18:36 -0800)]
rollup merge of #19998: th0114nd/unicode-bottom

In the HTML version of the documentation, it isn't rendered so might as well use the unicode representation.

9 years agorollup merge of #19888: steveklabnik/gh19861
Alex Crichton [Tue, 6 Jan 2015 02:36:18 +0000 (18:36 -0800)]
rollup merge of #19888: steveklabnik/gh19861

Fixes #19861

/cc @huonw

9 years agorollup merge of #19736: steveklabnik/gh19662
Alex Crichton [Tue, 6 Jan 2015 02:36:17 +0000 (18:36 -0800)]
rollup merge of #19736: steveklabnik/gh19662

Fixes #19662.

9 years agorollup merge of #19235: bjz/reference
Alex Crichton [Tue, 6 Jan 2015 02:36:16 +0000 (18:36 -0800)]
rollup merge of #19235: bjz/reference

cc. @steveklabnik

9 years agoUpdate docs
Keegan McAllister [Sat, 3 Jan 2015 04:05:30 +0000 (20:05 -0800)]
Update docs

9 years agoAdd a test case for accidental macro re-export
Keegan McAllister [Sat, 3 Jan 2015 19:04:46 +0000 (11:04 -0800)]
Add a test case for accidental macro re-export

9 years agoForbid '#[macro_use] extern crate' outside the crate root
Keegan McAllister [Sat, 3 Jan 2015 06:21:28 +0000 (22:21 -0800)]
Forbid '#[macro_use] extern crate' outside the crate root

9 years agoUn-gate macro_rules
Keegan McAllister [Sat, 3 Jan 2015 03:41:40 +0000 (19:41 -0800)]
Un-gate macro_rules

9 years agoPass the #[plugin(...)] meta item to the registrar
Keegan McAllister [Sat, 3 Jan 2015 02:26:00 +0000 (18:26 -0800)]
Pass the #[plugin(...)] meta item to the registrar

9 years agoModernize macro_rules! invocations
Keegan McAllister [Fri, 2 Jan 2015 22:44:21 +0000 (14:44 -0800)]
Modernize macro_rules! invocations

macro_rules! is like an item that defines a macro.  Other items don't have a
trailing semicolon, or use a paren-delimited body.

If there's an argument for matching the invocation syntax, e.g. parentheses for
an expr macro, then I think that applies more strongly to the *inner*
delimiters on the LHS, wrapping the individual argument patterns.

9 years agoReserve the keyword 'macro'
Keegan McAllister [Fri, 2 Jan 2015 21:39:05 +0000 (13:39 -0800)]
Reserve the keyword 'macro'

9 years agoAllow selective macro import
Keegan McAllister [Fri, 2 Jan 2015 20:50:45 +0000 (12:50 -0800)]
Allow selective macro import

9 years agoMove #[macro_reexport] to extern crate
Keegan McAllister [Fri, 2 Jan 2015 00:37:47 +0000 (16:37 -0800)]
Move #[macro_reexport] to extern crate

9 years agoReplace #[phase] with #[plugin] / #[macro_use] / #[no_link]
Keegan McAllister [Thu, 1 Jan 2015 04:43:46 +0000 (20:43 -0800)]
Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]

9 years agocreader: Load parts of plugin metadata on demand
Keegan McAllister [Thu, 1 Jan 2015 03:48:39 +0000 (19:48 -0800)]
creader: Load parts of plugin metadata on demand

9 years agoFix the obsolete message
Nick Cameron [Tue, 6 Jan 2015 01:25:06 +0000 (14:25 +1300)]
Fix the obsolete message

9 years agoFallout
Nick Cameron [Mon, 5 Jan 2015 21:16:49 +0000 (10:16 +1300)]
Fallout

9 years agoObsolete `Sized? T`
Nick Cameron [Mon, 5 Jan 2015 20:44:33 +0000 (09:44 +1300)]
Obsolete `Sized? T`

[breaking-change]

Use `T: ?Sized`

9 years agoRemove the prefix in ObsoleteSyntax variants
Nick Cameron [Mon, 5 Jan 2015 20:38:56 +0000 (09:38 +1300)]
Remove the prefix in ObsoleteSyntax variants

9 years agoauto merge of #20578 : japaric/rust/no-more-bc, r=nmatsakis
bors [Mon, 5 Jan 2015 23:51:00 +0000 (23:51 +0000)]
auto merge of #20578 : japaric/rust/no-more-bc, r=nmatsakis

This PR removes boxed closures from the language, the closure type syntax (`let f: |int| -> bool = /* ... */`) has been obsoleted. Move all your uses of closures to the new unboxed closure system (i.e. `Fn*` traits).

[breaking-change] patterns

- `lef f = || {}`

This binding used to type check to a boxed closure. Now that boxed closures are gone, you need to annotate the "kind" of the unboxed closure, i.e. you need pick one of these: `|&:| {}`, `|&mut:| {}` or `|:| {}`.

In the (near) future we'll have closure "kind" inference, so the compiler will infer which `Fn*` trait to use based on how the closure is used. Once this inference machinery is in place, we'll be able to remove the kind annotation from most closures.

- `type Alias<'a> = |int|:'a -> bool`

Use a trait object: `type Alias<'a> = Box<FnMut(int) -> bool + 'a>`. Use the `Fn*` trait that makes sense for your use case.

- `fn foo(&self, f: |uint| -> bool)`

In this case you can use either a trait object or an unboxed closure:

``` rust
fn foo(&self, f: F) where F: FnMut(uint) -> bool;
// or
fn foo(&self, f: Box<FnMut(uint) -> bool>);
```

- `struct Struct<'a> { f: |uint|:'a -> bool }`

Again, you can use either a trait object or an unboxed closure:

``` rust
struct Struct<F> where F: FnMut(uint) -> bool { f: F }
// or
struct Struct<'a> { f: Box<FnMut(uint) -> bool + 'a> }
```

- Using `|x, y| f(x, y)` for closure "borrows"

This comes up in recursive functions, consider the following (contrived) example:

``` rust
fn foo(x: uint, f: |uint| -> bool) -> bool {
    //foo(x / 2, f) && f(x)  // can't use this because `f` gets moved away in the `foo` call
    foo(x / 2, |x| f(x)) && f(x)  // instead "borrow" `f` in the `foo` call
}
```

If you attempt to do the same with unboxed closures you'll hit ""error: reached the recursion limit during monomorphization" (see #19596):

``` rust
fn foo<F>(x: uint, mut f: F) -> bool where F: FnMut(uint) -> bool {
    foo(x / 2, |x| f(x)) && f(x)
    //~^ error: reached the recursion limit during monomorphization
}
```

Instead you *should* be able to write this:

``` rust
fn foo<F>(x: uint, mut f: F) -> bool where F: FnMut(uint) -> bool {
    foo(x / 2, &mut f) && f(x)
    //~^ error: the trait `FnMut` is not implemented for the type `&mut F`
}
```

But as you see above `&mut F` doesn't implement the `FnMut` trait. `&mut F` *should* implement the `FnMut` and the above code *should* work, but due to a bug (see #18835) it doesn't (for now).

You can work around the issue by rewriting the function to take `&mut F` instead of `F`:

``` rust
fn foo<F>(x: uint, f: &mut F) -> bool where F: FnMut(uint) -> bool {
    foo(x / 2, f) && (*f)(x)
}
```

This finally works! However writing `foo(0, &mut |x| x == 0)` is unergonomic. So you can use a private helper function to avoid this:

``` rust
// public API function
pub fn foo<F>(x: uint, mut f: F) -> bool where F: FnMut(uint) -> bool {
    foo_(x, &mut f)
}

// private helper function
fn foo_<F>(x: uint, f: &mut F) -> bool where F: FnMut(uint) -> bool {
    foo_(x / 2, f) && (*f)(x)
}
```

Closes #14798

---

There is more cleanup to do: like renaming functions/types from `unboxed_closure` to just `closure`, removing more dead code, simplify functions which now have unused arguments, update the documentation, etc. But that can be done in another PR.

r? @nikomatsakis @aturon (You probably want to focus on the deleted/modified tests.)
cc @eddyb

9 years agoRemove i suffix in docs
Steve Klabnik [Fri, 2 Jan 2015 17:21:00 +0000 (12:21 -0500)]
Remove i suffix in docs

9 years agoStabilization of impls and fallout from stabilization
Aaron Turon [Mon, 5 Jan 2015 00:16:55 +0000 (16:16 -0800)]
Stabilization of impls and fallout from stabilization

9 years agoremove more stage0 stuff
Jorge Aparicio [Mon, 5 Jan 2015 21:19:15 +0000 (16:19 -0500)]
remove more stage0 stuff

9 years agounignore and fix doctests in guide and reference
Jorge Aparicio [Mon, 5 Jan 2015 21:02:28 +0000 (16:02 -0500)]
unignore and fix doctests in guide and reference

9 years agofix tests
Jorge Aparicio [Mon, 5 Jan 2015 21:02:07 +0000 (16:02 -0500)]
fix tests

9 years agoreplace `f.call_mut(a, b, ..)` with `f(a, b, ..)`
Jorge Aparicio [Mon, 5 Jan 2015 19:07:10 +0000 (14:07 -0500)]
replace `f.call_mut(a, b, ..)` with `f(a, b, ..)`

9 years agoCorrectly "detuple" arguments when creating trait object shims for a trait method...
Niko Matsakis [Mon, 5 Jan 2015 18:53:39 +0000 (13:53 -0500)]
Correctly "detuple" arguments when creating trait object shims for a trait method with rust-call ABI.

9 years agoFix ICE caused by forgotten bcx
Niko Matsakis [Mon, 5 Jan 2015 16:06:20 +0000 (11:06 -0500)]
Fix ICE caused by forgotten bcx

9 years agoaddress Niko's comments
Jorge Aparicio [Mon, 5 Jan 2015 17:07:49 +0000 (12:07 -0500)]
address Niko's comments

9 years agoignore boxed closure doctests in the guide/reference
Jorge Aparicio [Mon, 5 Jan 2015 13:25:55 +0000 (08:25 -0500)]
ignore boxed closure doctests in the guide/reference

9 years agofix benchmarks
Jorge Aparicio [Mon, 5 Jan 2015 13:23:55 +0000 (08:23 -0500)]
fix benchmarks

9 years agofix debuginfo tests
Jorge Aparicio [Mon, 5 Jan 2015 13:23:17 +0000 (08:23 -0500)]
fix debuginfo tests

9 years agofix pretty tests
Jorge Aparicio [Mon, 5 Jan 2015 13:22:04 +0000 (08:22 -0500)]
fix pretty tests

9 years agofix run-make test
Jorge Aparicio [Mon, 5 Jan 2015 04:33:35 +0000 (23:33 -0500)]
fix run-make test

9 years agofix cfail tests
Jorge Aparicio [Sat, 3 Jan 2015 15:45:00 +0000 (10:45 -0500)]
fix cfail tests

9 years agofix rpass tests
Jorge Aparicio [Fri, 2 Jan 2015 22:32:54 +0000 (17:32 -0500)]
fix rpass tests

9 years agotypeck: remove dead code
Jorge Aparicio [Sun, 4 Jan 2015 15:53:03 +0000 (10:53 -0500)]
typeck: remove dead code

9 years agotrans: remove dead code
Jorge Aparicio [Sun, 4 Jan 2015 15:50:24 +0000 (10:50 -0500)]
trans: remove dead code

9 years agorustc: remove dead code
Jorge Aparicio [Sun, 4 Jan 2015 15:42:51 +0000 (10:42 -0500)]
rustc: remove dead code

9 years agosyntax: remove dead code
Jorge Aparicio [Sun, 4 Jan 2015 15:42:11 +0000 (10:42 -0500)]
syntax: remove dead code

9 years agotypeck: there are only unboxed closures now
Jorge Aparicio [Sun, 4 Jan 2015 15:39:03 +0000 (10:39 -0500)]
typeck: there are only unboxed closures now

9 years agosyntax: make the closure type `f: |uint| -> bool` syntax obsolete
Jorge Aparicio [Thu, 1 Jan 2015 22:21:25 +0000 (17:21 -0500)]
syntax: make the closure type `f: |uint| -> bool` syntax obsolete

9 years agotrans: remove Closure
Jorge Aparicio [Mon, 5 Jan 2015 00:27:20 +0000 (19:27 -0500)]
trans: remove Closure

9 years agoremove mk_closure
Jorge Aparicio [Sun, 4 Jan 2015 14:55:16 +0000 (09:55 -0500)]
remove mk_closure

9 years agoremove AdjustAddEnv
Jorge Aparicio [Sun, 4 Jan 2015 14:53:08 +0000 (09:53 -0500)]
remove AdjustAddEnv

9 years agoremove TyClosure
Jorge Aparicio [Sun, 4 Jan 2015 14:51:37 +0000 (09:51 -0500)]
remove TyClosure

9 years agoremove ty_closure
Jorge Aparicio [Sun, 4 Jan 2015 14:50:17 +0000 (09:50 -0500)]
remove ty_closure

9 years agocoretest: remove/ignore tests
Jorge Aparicio [Mon, 5 Jan 2015 04:34:23 +0000 (23:34 -0500)]
coretest: remove/ignore tests

9 years agocompiletest: remove boxed closures
Jorge Aparicio [Mon, 5 Jan 2015 03:05:29 +0000 (22:05 -0500)]
compiletest: remove boxed closures

9 years agodriver: remove unboxed closures
Jorge Aparicio [Mon, 5 Jan 2015 01:36:57 +0000 (20:36 -0500)]
driver: remove unboxed closures

9 years agotrans: remove remaining boxed closures
Jorge Aparicio [Sun, 4 Jan 2015 22:23:01 +0000 (17:23 -0500)]
trans: remove remaining boxed closures

9 years agotypeck: remove remaining boxed closures
Jorge Aparicio [Sun, 4 Jan 2015 22:22:50 +0000 (17:22 -0500)]
typeck: remove remaining boxed closures

9 years agorustc: remove remaining boxed closures
Jorge Aparicio [Sun, 4 Jan 2015 21:10:27 +0000 (16:10 -0500)]
rustc: remove remaining boxed closures

9 years agoEncodeInlinedItem: convert to "unboxed" closures
Jorge Aparicio [Sun, 4 Jan 2015 14:13:48 +0000 (09:13 -0500)]
EncodeInlinedItem: convert to "unboxed" closures

9 years agoDecodeInlinedItem: convert to "unboxed" closures
Jorge Aparicio [Sun, 4 Jan 2015 14:07:13 +0000 (09:07 -0500)]
DecodeInlinedItem: convert to "unboxed" closures

9 years agoconv_did: convert to "unboxed" closure
Jorge Aparicio [Sat, 3 Jan 2015 22:28:38 +0000 (17:28 -0500)]
conv_did: convert to "unboxed" closure

9 years agosyntax: remove remaining boxed closures
Jorge Aparicio [Thu, 1 Jan 2015 23:32:49 +0000 (18:32 -0500)]
syntax: remove remaining boxed closures

9 years agostd: remove remaining boxed closures
Jorge Aparicio [Thu, 1 Jan 2015 23:07:31 +0000 (18:07 -0500)]
std: remove remaining boxed closures

9 years agoregister snapshot
Jorge Aparicio [Mon, 5 Jan 2015 13:34:44 +0000 (08:34 -0500)]
register snapshot

9 years agoImplement new orphan rule that requires that impls of remote traits meet the followin...
Niko Matsakis [Mon, 5 Jan 2015 01:35:06 +0000 (20:35 -0500)]
Implement new orphan rule that requires that impls of remote traits meet the following two criteria:

- the self type includes some local type; and,
- type parameters in the self type must be constrained by a local type.

A type parameter is called *constrained* if it appears in some type-parameter of a local type.

Here are some examples that are accepted. In all of these examples, I
assume that `Foo` is a trait defined in another crate. If `Foo` were
defined in the local crate, then all the examples would be legal.

- `impl Foo for LocalType`
- `impl<T> Foo<T> for LocalType` -- T does not appear in Self, so it is OK
- `impl<T> Foo<T> for LocalType<T>` -- T here is constrained by LocalType
- `impl<T> Foo<T> for (LocalType<T>, T)` -- T here is constrained by LocalType

Here are some illegal examples (again, these examples assume that
`Foo` is not local to the current crate):

- `impl Foo for int` -- the Self type is not local
- `impl<T> Foo for T` -- T appears in Self unconstrained by a local type
- `impl<T> Foo for (LocalType, T)` -- T appears in Self unconstrained by a local type

This is a [breaking-change]. For the time being, you can opt out of
the new rules by placing `#[old_orphan_check]` on the trait (and
enabling the feature gate where the trait is defined). Longer term,
you should restructure your traits to avoid the problem. Usually this
means changing the order of parameters so that the "central" type
parameter is in the `Self` position.

As an example of that refactoring, consider the `BorrowFrom` trait:

```rust
pub trait BorrowFrom<Sized? Owned> for Sized? {
    fn borrow_from(owned: &Owned) -> &Self;
}
```

As defined, this trait is commonly implemented for custom pointer
types, such as `Arc`. Those impls follow the pattern:

```rust
impl<T> BorrowFrom<Arc<T>> for T {...}
```

Unfortunately, this impl is illegal because the self type `T` is not
local to the current crate. Therefore, we are going to change the order of the parameters,
so that `BorrowFrom` becomes `Borrow`:

```rust
pub trait Borrow<Sized? Borrowed> for Sized? {
    fn borrow_from(owned: &Self) -> &Borrowed;
}
```

Now the `Arc` impl is written:

```rust
impl<T> Borrow<T> for Arc<T> { ... }
```

This impl is legal because the self type (`Arc<T>`) is local.

9 years agoStabilize collection modules
Aaron Turon [Mon, 5 Jan 2015 00:35:20 +0000 (16:35 -0800)]
Stabilize collection modules

The earlier collections stabilization did not cover the modules
themselves. This commit marks as stable those modules whose types have
been stabilized.

9 years agoFinal alpha stabilization of std::slice
Aaron Turon [Sun, 4 Jan 2015 23:53:00 +0000 (15:53 -0800)]
Final alpha stabilization of std::slice

Marks as `#[stable]`:

* Various iterator structs for stable methods, e.g. `Chunks` and
  `Windows`.
* The `SliceExt` trait itself.