]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoauto merge of #16866 : P1start/rust/tuple-indexing, r=brson
bors [Thu, 11 Sep 2014 00:05:41 +0000 (00:05 +0000)]
auto merge of #16866 : P1start/rust/tuple-indexing, r=brson

This allows code to access the fields of tuples and tuple structs behind the feature gate `tuple_indexing`:

```rust
#![feature(tuple_indexing)]

let x = (1i, 2i);
assert_eq!(x.1, 2);

struct Point(int, int);
let origin = Point(0, 0);
assert_eq!(origin.0, 0);
assert_eq!(origin.1, 0);
```

Implements [RFC 53](https://github.com/rust-lang/rfcs/blob/master/active/0053-tuple-accessors.md). Closes #16950.

9 years agoauto merge of #17135 : brson/rust/wininst, r=alexcrichton
bors [Wed, 10 Sep 2014 19:25:36 +0000 (19:25 +0000)]
auto merge of #17135 : brson/rust/wininst, r=alexcrichton

This builds on https://github.com/rust-lang/rust/pull/17109, putting the target triple into the installer name so that we can have both 32-bit and 64-bit.

The resulting installers will be called `rust-0.12.0-pre-x86_64-w64-mingw32.exe`, etc.

9 years agoauto merge of #16680 : brson/rust/readme, r=steveklabnik
bors [Wed, 10 Sep 2014 16:45:37 +0000 (16:45 +0000)]
auto merge of #16680 : brson/rust/readme, r=steveklabnik

This adds links to SO, reddit, and discuss to the README. The main intent is to start advertising discuss.rust-lang.org more, in a location that doesn't mislead casual users to it (people who are building Rust are more likely to be the right audience than those that are just visiting the web site).

9 years agoauto merge of #17129 : epdtry/rust/misc/llvm-root-reconfig, r=brson
bors [Wed, 10 Sep 2014 14:20:37 +0000 (14:20 +0000)]
auto merge of #17129 : epdtry/rust/misc/llvm-root-reconfig, r=brson

Currently `./configure --llvm-root=...` and similar flags will break incremental builds by forcing reconfiguration on every `make`.  This happens because `reconfig.mk` incorrectly treats submodules in the `-` (uninitialized) state as requiring reconfiguration, and `./configure` deliberately deinitializes unneeded submodules.  The fix is to reconfigure only when submodules are in the `+` state (wrong commit checked out).

9 years agoauto merge of #17109 : brson/rust/win64snap, r=alexcrichton
bors [Wed, 10 Sep 2014 11:45:44 +0000 (11:45 +0000)]
auto merge of #17109 : brson/rust/win64snap, r=alexcrichton

9 years agoauto merge of #17095 : thestinger/rust/alloc, r=alexcrichton
bors [Wed, 10 Sep 2014 09:20:39 +0000 (09:20 +0000)]
auto merge of #17095 : thestinger/rust/alloc, r=alexcrichton

Previously, some parts of this optimization were impossible because the
alignment passed to the free function was not correct. That was fully
fixed by #17012.

Closes #17092

9 years agoimplement sized deallocation
Daniel Micay [Fri, 5 Sep 2014 14:39:36 +0000 (10:39 -0400)]
implement sized deallocation

Closes #13994

9 years agomicro-optimize dynamic allocation alignment
Daniel Micay [Mon, 8 Sep 2014 05:46:33 +0000 (01:46 -0400)]
micro-optimize dynamic allocation alignment

Previously, some parts of this optimization were impossible because the
alignment passed to the free function was not correct. That was fully
fixed by #17012.

Closes #17092

9 years agoauto merge of #17108 : steveklabnik/rust/explicitness, r=alexcrichton
bors [Wed, 10 Sep 2014 07:35:41 +0000 (07:35 +0000)]
auto merge of #17108 : steveklabnik/rust/explicitness, r=alexcrichton

I missed some annotations, and some were in a different style.

9 years agoauto merge of #17048 : pcwalton/rust/remove-old-import-renaming-syntax, r=brson
bors [Wed, 10 Sep 2014 05:05:39 +0000 (05:05 +0000)]
auto merge of #17048 : pcwalton/rust/remove-old-import-renaming-syntax, r=brson

Instead of `extern crate foo = bar`, write `extern crate bar as foo`.
Instead of `extern crate baz = "quux"`, write `extern crate "quux" as
baz`.

Closes #16461.

[breaking-change]

r? @brson

9 years agoauto merge of #16824 : steveklabnik/rust/string_guide_improvements, r=alexcrichton
bors [Wed, 10 Sep 2014 03:20:40 +0000 (03:20 +0000)]
auto merge of #16824 : steveklabnik/rust/string_guide_improvements, r=alexcrichton

A few steps toward https://github.com/rust-lang/rust/issues/15994

9 years agolibrustc: Obsolete the old external crate renaming syntax.
Patrick Walton [Sat, 6 Sep 2014 18:54:11 +0000 (11:54 -0700)]
librustc: Obsolete the old external crate renaming syntax.

Instead of `extern crate foo = bar`, write `extern crate bar as foo`.
Instead of `extern crate baz = "quux"`, write `extern crate "quux" as
baz`.

Closes #16461.

[breaking-change]

9 years agoauto merge of #16662 : pczarn/rust/format-fmtstr-opt, r=brson
bors [Tue, 9 Sep 2014 23:55:43 +0000 (23:55 +0000)]
auto merge of #16662 : pczarn/rust/format-fmtstr-opt, r=brson

Based on an observation that strings and arguments are always interleaved, thanks to #15832. Additionally optimize invocations where formatting parameters are unspecified for all arguments, e.g. `"{} {:?} {:x}"`, by emptying the `__STATIC_FMTARGS` array. Next, `Arguments::new` replaces an empty slice with `None` so that passing empty `__STATIC_FMTARGS` generates slightly less machine code when `Arguments::new` is inlined. Furthermore, formatting itself treats these cases separately without making redundant copies of formatting parameters.

All in all, this adds a single mov instruction per `write!` in most cases. That's why code size has increased.

9 years agoAdd section about Str trait
Steve Klabnik [Thu, 28 Aug 2014 18:05:33 +0000 (14:05 -0400)]
Add section about Str trait

9 years agoBe explicit with rustdoc.
Steve Klabnik [Mon, 8 Sep 2014 22:58:34 +0000 (18:58 -0400)]
Be explicit with rustdoc.

I missed some annotations, and some were in a different style.

9 years agoImplement tuple and tuple struct indexing
P1start [Sun, 10 Aug 2014 03:54:33 +0000 (15:54 +1200)]
Implement tuple and tuple struct indexing

This allows code to access the fields of tuples and tuple structs:

    let x = (1i, 2i);
    assert_eq!(x.1, 2);

    struct Point(int, int);
    let origin = Point(0, 0);
    assert_eq!(origin.0, 0);
    assert_eq!(origin.1, 0);

9 years agoFix naming of windows installer
Brian Anderson [Tue, 9 Sep 2014 20:07:20 +0000 (13:07 -0700)]
Fix naming of windows installer

9 years agoFix snapshot.py for win64
Brian Anderson [Mon, 8 Sep 2014 23:38:05 +0000 (16:38 -0700)]
Fix snapshot.py for win64

9 years agoauto merge of #17127 : alexcrichton/rust/rollup, r=alexcrichton
bors [Tue, 9 Sep 2014 20:16:19 +0000 (20:16 +0000)]
auto merge of #17127 : alexcrichton/rust/rollup, r=alexcrichton

9 years agoTest fixes from the rollup
Alex Crichton [Tue, 9 Sep 2014 15:08:30 +0000 (08:08 -0700)]
Test fixes from the rollup

9 years agoAdd links to forums in README.md, including discuss.rust-lang.org
Brian Anderson [Fri, 22 Aug 2014 18:04:35 +0000 (11:04 -0700)]
Add links to forums in README.md, including discuss.rust-lang.org

9 years agocoretest: Ensure that pointer formatting flags are cleaned up
Piotr Czarnecki [Mon, 25 Aug 2014 13:31:42 +0000 (14:31 +0100)]
coretest: Ensure that pointer formatting flags are cleaned up

9 years agoOptimize for the most common cases of `format!`
Piotr Czarnecki [Mon, 25 Aug 2014 13:26:18 +0000 (14:26 +0100)]
Optimize for the most common cases of `format!`

Format specs are ignored and not stored in case they're all default.
Restore default formatting parameters during iteration.
Pass `None` instead of empty slices of format specs to take advantage
of non-nullable pointer optimization.

Generate a call to one of two functions of `fmt::Argument`.

9 years agoDecouple string and argument pieces
Piotr Czarnecki [Thu, 21 Aug 2014 13:34:00 +0000 (14:34 +0100)]
Decouple string and argument pieces

9 years agorollup merge of #17114 : nick29581/dst-type
Alex Crichton [Tue, 9 Sep 2014 14:39:23 +0000 (07:39 -0700)]
rollup merge of #17114 : nick29581/dst-type

9 years agorollup merge of #17107 : steveklabnik/uninitialized_bindings
Alex Crichton [Tue, 9 Sep 2014 14:39:14 +0000 (07:39 -0700)]
rollup merge of #17107 : steveklabnik/uninitialized_bindings

9 years agorollup merge of #17106 : treeman/test-warnings
Alex Crichton [Tue, 9 Sep 2014 14:39:11 +0000 (07:39 -0700)]
rollup merge of #17106 : treeman/test-warnings

9 years agorollup merge of #17101 : pcwalton/for-loop-borrowck
Alex Crichton [Tue, 9 Sep 2014 14:39:09 +0000 (07:39 -0700)]
rollup merge of #17101 : pcwalton/for-loop-borrowck

9 years agorollup merge of #17096 : TeXitoi/relicense-shootout-chameneos-redux
Alex Crichton [Tue, 9 Sep 2014 14:39:05 +0000 (07:39 -0700)]
rollup merge of #17096 : TeXitoi/relicense-shootout-chameneos-redux

9 years agorollup merge of #17093 : nathantypanski/17021
Alex Crichton [Tue, 9 Sep 2014 14:39:02 +0000 (07:39 -0700)]
rollup merge of #17093 : nathantypanski/17021

9 years agorollup merge of #17090 : alexcrichton/rustdoc-no-strip
Alex Crichton [Tue, 9 Sep 2014 14:38:58 +0000 (07:38 -0700)]
rollup merge of #17090 : alexcrichton/rustdoc-no-strip

9 years agorollup merge of #17087 : DanAlbert/llvm-3.6
Alex Crichton [Tue, 9 Sep 2014 14:38:56 +0000 (07:38 -0700)]
rollup merge of #17087 : DanAlbert/llvm-3.6

9 years agorollup merge of #17085 : jakub-/issue-17074
Alex Crichton [Tue, 9 Sep 2014 14:38:54 +0000 (07:38 -0700)]
rollup merge of #17085 : jakub-/issue-17074

9 years agorollup merge of #17080 : treeman/issue-17066
Alex Crichton [Tue, 9 Sep 2014 14:38:51 +0000 (07:38 -0700)]
rollup merge of #17080 : treeman/issue-17066

9 years agorollup merge of #17077 : TeXitoi/relicense-shootout-nbody
Alex Crichton [Tue, 9 Sep 2014 14:38:47 +0000 (07:38 -0700)]
rollup merge of #17077 : TeXitoi/relicense-shootout-nbody

9 years agorollup merge of #17070 : TeXitoi/relicense-shootout-reverse-complement.rs
Alex Crichton [Tue, 9 Sep 2014 14:38:30 +0000 (07:38 -0700)]
rollup merge of #17070 : TeXitoi/relicense-shootout-reverse-complement.rs

9 years agorollup merge of #17062 : nathantypanski/generic-lifetime-trait-impl
Alex Crichton [Tue, 9 Sep 2014 14:38:27 +0000 (07:38 -0700)]
rollup merge of #17062 : nathantypanski/generic-lifetime-trait-impl

9 years agorollup merge of #17061 : nathantypanski/test-borrowck-trait
Alex Crichton [Tue, 9 Sep 2014 14:38:23 +0000 (07:38 -0700)]
rollup merge of #17061 : nathantypanski/test-borrowck-trait

9 years agorollup merge of #17054 : pcwalton/subslice-syntax
Alex Crichton [Tue, 9 Sep 2014 14:38:21 +0000 (07:38 -0700)]
rollup merge of #17054 : pcwalton/subslice-syntax

9 years agorollup merge of #17052 : pcwalton/feature-gate-subslices
Alex Crichton [Tue, 9 Sep 2014 14:38:17 +0000 (07:38 -0700)]
rollup merge of #17052 : pcwalton/feature-gate-subslices

9 years agorollup merge of #17040 : kmcallister/borrow-extctxt
Alex Crichton [Tue, 9 Sep 2014 14:38:11 +0000 (07:38 -0700)]
rollup merge of #17040 : kmcallister/borrow-extctxt

9 years agorollup merge of #17020 : nodakai/libnative-c_int
Alex Crichton [Tue, 9 Sep 2014 14:38:06 +0000 (07:38 -0700)]
rollup merge of #17020 : nodakai/libnative-c_int

9 years agorollup merge of #17013 : rgawdzik/literal_int
Alex Crichton [Tue, 9 Sep 2014 14:38:03 +0000 (07:38 -0700)]
rollup merge of #17013 : rgawdzik/literal_int

9 years agorollup merge of #17008 : nick29581/impl2
Alex Crichton [Tue, 9 Sep 2014 14:37:58 +0000 (07:37 -0700)]
rollup merge of #17008 : nick29581/impl2

9 years agorollup merge of #16971 : treeman/json-decode
Alex Crichton [Tue, 9 Sep 2014 14:37:43 +0000 (07:37 -0700)]
rollup merge of #16971 : treeman/json-decode

9 years agoignore uninitialized submodules when checking if ./configure should be re-run
Stuart Pernsteiner [Tue, 9 Sep 2014 18:24:17 +0000 (11:24 -0700)]
ignore uninitialized submodules when checking if ./configure should be re-run

9 years agoauto merge of #16927 : dotdash/rust/llvmup, r=alexcrichton
bors [Tue, 9 Sep 2014 17:16:18 +0000 (17:16 +0000)]
auto merge of #16927 : dotdash/rust/llvmup, r=alexcrichton

9 years agoauto merge of #16827 : steveklabnik/rust/fix_doc_index, r=brson
bors [Tue, 9 Sep 2014 13:26:16 +0000 (13:26 +0000)]
auto merge of #16827 : steveklabnik/rust/fix_doc_index, r=brson

Fixes #14972

9 years agoauto merge of #16965 : huonw/rust/isaac-oob--, r=alexcrichton
bors [Tue, 9 Sep 2014 11:11:17 +0000 (11:11 +0000)]
auto merge of #16965 : huonw/rust/isaac-oob--, r=alexcrichton

rand: inform the optimiser that indexing is never out-of-bounds.

This uses a bitwise mask to ensure that there's no bounds checking for
the array accesses when generating the next random number. This isn't
costless, but the single instruction is nothing compared to the branch.

A `debug_assert` for "bounds check" is preserved to ensure that
refactoring doesn't accidentally break it (i.e. create values of `cnt`
that are out of bounds with the masking causing it to silently wrap-
around).

Before:

test test::rand_isaac   ... bench: 990 ns/iter (+/- 24) = 808 MB/s
test test::rand_isaac64 ... bench: 614 ns/iter (+/- 25) = 1302 MB/s

After:

test test::rand_isaac   ... bench: 877 ns/iter (+/- 134) = 912 MB/s
test test::rand_isaac64 ... bench: 470 ns/iter (+/- 30) = 1702 MB/s

(It also removes the unsafe code in Isaac64Rng.next_u64, with a *gain*
in performance; today is a good day.)

9 years agoRemove some test warnings.
Jonas Hietala [Tue, 9 Sep 2014 09:32:58 +0000 (11:32 +0200)]
Remove some test warnings.

9 years agoauto merge of #17083 : thestinger/rust/jemalloc, r=alexcrichton
bors [Tue, 9 Sep 2014 07:56:19 +0000 (07:56 +0000)]
auto merge of #17083 : thestinger/rust/jemalloc, r=alexcrichton

The performance hit from these checks is significant, but unoptimized
builds are already incredibly slow. Enabling these checks results in
better test coverage since there are bots doing unoptimized builds, and
the cost is relatively small in the context of an unoptimized build.
This also allows using `JEMALLOC_FLAGS` to override the default
configure flags.

9 years agoHandle `Sized?` in `type` items.
Nick Cameron [Tue, 9 Sep 2014 06:22:20 +0000 (18:22 +1200)]
Handle `Sized?` in `type` items.

Resolves bounds for `type` and adds the warning for 'unbounds' (? bounds) that we have for bounds.

Closes #16888

9 years agoDecoding json now defaults Option<_> to None.
Jonas Hietala [Tue, 9 Sep 2014 05:28:59 +0000 (07:28 +0200)]
Decoding json now defaults Option<_> to None.

Closes #12794

9 years agoauto merge of #16825 : steveklabnik/rust/fix_manual_array_terms, r=brson
bors [Tue, 9 Sep 2014 04:26:18 +0000 (04:26 +0000)]
auto merge of #16825 : steveklabnik/rust/fix_manual_array_terms, r=brson

fixes #16015

9 years agolibrustc: Change the syntax of subslice matching to use postfix `..`
Patrick Walton [Sat, 6 Sep 2014 22:23:55 +0000 (15:23 -0700)]
librustc: Change the syntax of subslice matching to use postfix `..`
instead of prefix `..`.

This breaks code that looked like:

    match foo {
        [ first, ..middle, last ] => { ... }
    }

Change this code to:

    match foo {
        [ first, middle.., last ] => { ... }
    }

RFC #55.

Closes #16967.

[breaking-change]

9 years agoguide: Remove reference to uninitialized bindings
Steve Klabnik [Mon, 8 Sep 2014 22:50:08 +0000 (18:50 -0400)]
guide: Remove reference to uninitialized bindings

There isn't a good way to fit this in, so let's just not
mention it.

Fixes #16792.

9 years agoCheck traits for built-in bounds in impls
Nick Cameron [Fri, 5 Sep 2014 05:10:32 +0000 (17:10 +1200)]
Check traits for built-in bounds in impls

9 years agoauto merge of #16952 : alexcrichton/rust/windows-large-console-write, r=brson
bors [Mon, 8 Sep 2014 20:51:14 +0000 (20:51 +0000)]
auto merge of #16952 : alexcrichton/rust/windows-large-console-write, r=brson

I've found that 64k is still too much and continue to see the errors as reported
in #14940. I've locally found that 32k fails, and 24k succeeds, so I've trimmed
the size down to 10000 which the included links in the added comment end up
recommending.

It sounds like the limit can still be hit with many threads in play, but I have
yet to reproduce this, so I figure we can wait until that's hit (if it's
possible) and then take action.

9 years agostd: Turn down the stdout chunk size
Alex Crichton [Wed, 3 Sep 2014 01:39:19 +0000 (18:39 -0700)]
std: Turn down the stdout chunk size

I've found that 64k is still too much and continue to see the errors as reported
in #14940. I've locally found that 32k fails, and 24k succeeds, so I've trimmed
the size down to 8192 which libuv happens to use as well.

It sounds like the limit can still be hit with many threads in play, but I have
yet to reproduce this, so I figure we can wait until that's hit (if it's
possible) and then take action.

9 years agoquote: Explicitly borrow the ExtCtxt
Keegan McAllister [Sat, 6 Sep 2014 02:50:05 +0000 (19:50 -0700)]
quote: Explicitly borrow the ExtCtxt

Fixes #16992.

9 years agolibrustc: Feature gate subslice matching in non-tail positions.
Patrick Walton [Sat, 6 Sep 2014 20:52:07 +0000 (13:52 -0700)]
librustc: Feature gate subslice matching in non-tail positions.

This breaks code that uses the `..xs` form anywhere but at the end of a
slice. For example:

    match foo {
        [ 1, ..xs, 2 ]
        [ ..xs, 1, 2 ]
    }

Add the `#![feature(advanced_slice_patterns)]` gate to reenable the
syntax.

RFC #54.

Closes #16951.

[breaking-change]

9 years agolibrustc: Make sure lifetimes in `for` loop heads outlive the `for` loop
Patrick Walton [Mon, 8 Sep 2014 16:50:18 +0000 (09:50 -0700)]
librustc: Make sure lifetimes in `for` loop heads outlive the `for` loop
itself.

This breaks code like:

    for &x in my_vector.iter() {
        my_vector[2] = "wibble";
        ...
    }

Change this code to not invalidate iterators. For example:

    for i in range(0, my_vector.len()) {
        my_vector[2] = "wibble";
        ...
    }

The `for-loop-does-not-borrow-iterators` test for #8372 was incorrect
and has been removed.

Closes #16820.

[breaking-change]

9 years agoauto merge of #12809 : eddyb/rust/ty-arena, r=cmr
bors [Mon, 8 Sep 2014 15:36:13 +0000 (15:36 +0000)]
auto merge of #12809 : eddyb/rust/ty-arena, r=cmr

This was inspired by seeing a LLVM flatline of **~600MB** when running rustc with jemalloc (each type's `t_box_` is allocated on the heap, creating a lot of fragmentation, which jemalloc can deal with, unlike glibc).

9 years agoUpdate LLVM to fix a crash in the MergeFunc pass
Björn Steinbrink [Mon, 8 Sep 2014 15:07:03 +0000 (17:07 +0200)]
Update LLVM to fix a crash in the MergeFunc pass

9 years agoauto merge of #16903 : mahkoh/rust/move_items_unwrap, r=aturon
bors [Mon, 8 Sep 2014 13:46:15 +0000 (13:46 +0000)]
auto merge of #16903 : mahkoh/rust/move_items_unwrap, r=aturon

Closes #16879

9 years agorustdoc: fix fallout from the addition of a 'tcx lifetime on tcx.
Eduard Burtescu [Sat, 6 Sep 2014 16:13:40 +0000 (19:13 +0300)]
rustdoc: fix fallout from the addition of a 'tcx lifetime on tcx.

9 years agorustc: fix fallout from the addition of a 'tcx lifetime on trans::Block.
Eduard Burtescu [Sat, 6 Sep 2014 16:13:04 +0000 (19:13 +0300)]
rustc: fix fallout from the addition of a 'tcx lifetime on trans::Block.

9 years agorustc: fix fallout from the addition of a 'tcx lifetime on tcx.
Eduard Burtescu [Tue, 22 Apr 2014 12:56:37 +0000 (15:56 +0300)]
rustc: fix fallout from the addition of a 'tcx lifetime on tcx.

9 years agorustc: use a TypedArena to allocate types in the type context.
Eduard Burtescu [Tue, 22 Apr 2014 11:33:15 +0000 (14:33 +0300)]
rustc: use a TypedArena to allocate types in the type context.

9 years agoauto merge of #17053 : thestinger/rust/large_address_aware, r=sfackler,cmr
bors [Mon, 8 Sep 2014 11:56:12 +0000 (11:56 +0000)]
auto merge of #17053 : thestinger/rust/large_address_aware, r=sfackler,cmr

By default, 32-bit Windows executables are restricted to 2GiB of address
space even when running on 64-bit Windows when 4GiB is available.

Closes #17043

9 years agoauto merge of #17063 : huonw/rust/snap, r=alexcrichton
bors [Mon, 8 Sep 2014 10:06:15 +0000 (10:06 +0000)]
auto merge of #17063 : huonw/rust/snap, r=alexcrichton

Closes #16880.

9 years agorand: inform the optimiser that indexing is never out-of-bounds.
Huon Wilson [Mon, 8 Sep 2014 09:33:37 +0000 (19:33 +1000)]
rand: inform the optimiser that indexing is never out-of-bounds.

This uses a bitwise mask to ensure that there's no bounds checking for
the array accesses when generating the next random number. This isn't
costless, but the single instruction is nothing compared to the branch.

A `debug_assert` for "bounds check" is preserved to ensure that
refactoring doesn't accidentally break it (i.e. create values of `cnt`
that are out of bounds with the masking causing it to silently wrap-
around).

Before:

    test test::rand_isaac   ... bench: 990 ns/iter (+/- 24) = 808 MB/s
    test test::rand_isaac64 ... bench: 614 ns/iter (+/- 25) = 1302 MB/s

After:

    test test::rand_isaac   ... bench: 877 ns/iter (+/- 134) = 912 MB/s
    test test::rand_isaac64 ... bench: 470 ns/iter (+/- 30) = 1702 MB/s

(It also removes the unsafe code in Isaac64Rng.next_u64, with a *gain*
in performance; today is a good day.)

9 years agoauto merge of #17036 : pczarn/rust/issue-15913-ICE-with-call-trans, r=alexcrichton
bors [Mon, 8 Sep 2014 08:06:18 +0000 (08:06 +0000)]
auto merge of #17036 : pczarn/rust/issue-15913-ICE-with-call-trans, r=alexcrichton

A match in callee.rs was recognizing some foreign fns as named tuple constructors. A reproducible test case for this is nearly impossible since it depends on the way NodeIds happen to be assigned in different crates.

Fixes #15913

9 years agoRelicense shootout-chameneos-redux.rs to the shootout license.
Guillaume Pinot [Mon, 8 Sep 2014 06:43:21 +0000 (08:43 +0200)]
Relicense shootout-chameneos-redux.rs to the shootout license.

Everyone agreed. fix #17076

9 years agoAdd ICE regression test with unboxed closures
Nathan Typanski [Mon, 8 Sep 2014 03:45:27 +0000 (23:45 -0400)]
Add ICE regression test with unboxed closures

This code used to produce the following ICE:

   error: internal compiler error: get_unique_type_id_of_type() -
   unexpected type: closure,
   ty_unboxed_closure(syntax::ast::DefId{krate: 0u32, node: 66u32},
   ReScope(63u32))

This is a regression test for issue #17021.

9 years agoauto merge of #16933 : nick29581/rust/dst-rvalue, r=nikomatsakis
bors [Mon, 8 Sep 2014 02:36:15 +0000 (02:36 +0000)]
auto merge of #16933 : nick29581/rust/dst-rvalue, r=nikomatsakis

Closes #16813

r? @nikomatsakis I feel like I should be checking more things in check_rvalues, but not sure what - I don't properly understand expr_use_visitor

9 years agolibnative/io: generic retry() for Unix 64 bit read/write().
NODA, Kai [Fri, 5 Sep 2014 07:05:22 +0000 (15:05 +0800)]
libnative/io: generic retry() for Unix 64 bit read/write().

Win32/WinSock APIs never call WSASetLastError() with WSAEINTR
unless a programmer specifically cancels the ongoing blocking call by
a deprecated WinSock1 API WSACancelBlockingCall().
So the errno check was simply removed and retry() became an id function
on Windows.
Note: Windows' equivalent of SIGINT is always handled in a separate thread:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682541%28v=vs.85%29.aspx
"CTRL+C and CTRL+BREAK Signals"

Also, incidentally rename a type parameter and clean up some module imports.

9 years agorustdoc: Don't strip #-lines if notrust
Alex Crichton [Sun, 7 Sep 2014 23:42:58 +0000 (16:42 -0700)]
rustdoc: Don't strip #-lines if notrust

Other languages may not want to have a leading #-line get stripped.

9 years agoauto merge of #16942 : alexcrichton/rust/remove-net-assert, r=brson
bors [Sun, 7 Sep 2014 23:01:34 +0000 (23:01 +0000)]
auto merge of #16942 : alexcrichton/rust/remove-net-assert, r=brson

This assert was likely inherited from some point, but it's not quite valid as a
no-timeout read may enter this loop, but data could be stolen by any other read
after the socket is deemed readable.

I saw this fail in a recent bors run where the assertion was tripped.

9 years agoAllow Rust to be built with LLVM trunk (3.6).
Dan Albert [Sun, 7 Sep 2014 21:42:48 +0000 (14:42 -0700)]
Allow Rust to be built with LLVM trunk (3.6).

9 years agoForbid unsized rvalues
Nick Cameron [Tue, 2 Sep 2014 03:55:07 +0000 (15:55 +1200)]
Forbid unsized rvalues

Closes #16813

9 years agoauto merge of #17035 : huonw/rust/moar-jquery, r=alexcrichton
bors [Sun, 7 Sep 2014 21:06:29 +0000 (21:06 +0000)]
auto merge of #17035 : huonw/rust/moar-jquery, r=alexcrichton

Sometimes (e.g. on Rust CI) the "expand description" text of the
collapse toggle was displayed by default, when a page is first
loaded (even though the description is expanded), because some
Content-Security-Policy settings disable inline CSS.

Setting it the style with the `.css` method allows the output to be used
in more places.

9 years agoFix casts in constant expressions
Jakub Wieczorek [Sun, 7 Sep 2014 18:45:12 +0000 (20:45 +0200)]
Fix casts in constant expressions

Fixes #17074.

9 years agoauto merge of #16904 : inrustwetrust/rust/link-path-order, r=alexcrichton
bors [Sun, 7 Sep 2014 19:06:28 +0000 (19:06 +0000)]
auto merge of #16904 : inrustwetrust/rust/link-path-order, r=alexcrichton

Issue can be reproduced by the following:
```
$ cat main.rs
fn main() {}
$ rustc -Z print-link-args -Lfoo -Lbar main.rs
```
Run the rustc command a few times and observe that the order of the '-L' 'foo' '-L' 'bar' options randomly changes.

Actually hit this issue in practice on Windows when specifying two -L directories to rustc, one with rust-sdl2 in it and one with the C SDL2.dll. Since Windows file systems aren't case-sensitive, gcc randomly attempted to link against the rust sdl2.dll instead of SDL2.dll if that -L directory happened to come first.

The randomness was due to addl_lib_search_paths being a HashSet. Changed it to a Vec instead which maintains the ordering.
Unsure how to test this though since it is random by nature; suggestions very welcome.

9 years agoenable jemalloc debugging in unoptimized builds
Daniel Micay [Sun, 7 Sep 2014 18:05:32 +0000 (14:05 -0400)]
enable jemalloc debugging in unoptimized builds

The performance hit from these checks is significant, but unoptimized
builds are already incredibly slow. Enabling these checks results in
better test coverage since there are bots doing unoptimized builds, and
the cost is relatively small in the context of an unoptimized build.
This also allows using `JEMALLOC_FLAGS` to override the default
configure flags.

9 years agoFlip arguments to `std::iter::iterate`.
Jonas Hietala [Sun, 7 Sep 2014 17:06:13 +0000 (19:06 +0200)]
Flip arguments to `std::iter::iterate`.

Breaks `iterate(f, seed)`, use `iterate(seed, f)` instead.
The convention is to have the closure last.

Closes #17066.

[breaking-change]

9 years agoRelicense shootout-nbody.rs to the shootout license
Guillaume Pinot [Sun, 7 Sep 2014 17:16:55 +0000 (19:16 +0200)]
Relicense shootout-nbody.rs to the shootout license

Everyone agreed. fix #17073

9 years agoauto merge of #17015 : seb-m/rust/fix-extern-crate-as, r=sfackler
bors [Sun, 7 Sep 2014 16:21:29 +0000 (16:21 +0000)]
auto merge of #17015 : seb-m/rust/fix-extern-crate-as, r=sfackler

Its arguments were inverted.

For instance it displayed this message:

```
warning: this extern crate syntax is deprecated. Use: extern create "foobar" as foo;
```

Instead of:

```
warning: this extern crate syntax is deprecated. Use: extern create "foo" as foobar;
```

9 years agoRelicense shootout-reverse-complement.rs to the shootout license.
Guillaume Pinot [Sun, 7 Sep 2014 16:09:01 +0000 (18:09 +0200)]
Relicense shootout-reverse-complement.rs to the shootout license.

Everyone agreed.  Fix #17065

9 years agoFix deprecate warning "extern crate ... as ..."
Sebastien Martini [Fri, 5 Sep 2014 09:42:16 +0000 (11:42 +0200)]
Fix deprecate warning "extern crate ... as ..."

Its arguments were inverted.

9 years agoauto merge of #17034 : retep998/rust/glob-fix, r=alexcrichton
bors [Sun, 7 Sep 2014 14:31:24 +0000 (14:31 +0000)]
auto merge of #17034 : retep998/rust/glob-fix, r=alexcrichton

Fixes #15279
Based on #13338

9 years agoauto merge of #17005 : bjz/rust/bit-count, r=thestinger
bors [Sun, 7 Sep 2014 12:41:25 +0000 (12:41 +0000)]
auto merge of #17005 : bjz/rust/bit-count, r=thestinger

Fixes rust-lang/rfcs#224

9 years agoRegister snapshots.
Huon Wilson [Sun, 7 Sep 2014 10:42:14 +0000 (20:42 +1000)]
Register snapshots.

Closes #16880.

9 years agoAdded test for link path ordering
inrustwetrust [Thu, 4 Sep 2014 20:41:00 +0000 (22:41 +0200)]
Added test for link path ordering

9 years agoChanged addl_lib_search_paths from HashSet to Vec
inrustwetrust [Sun, 31 Aug 2014 17:07:27 +0000 (19:07 +0200)]
Changed addl_lib_search_paths from HashSet to Vec

This makes the extra library paths given to the gcc linker come in
the same order as the -L options on the rustc command line.

9 years agoFix vector/array/slice terminology in manual.
Steve Klabnik [Thu, 28 Aug 2014 18:29:48 +0000 (14:29 -0400)]
Fix vector/array/slice terminology in manual.

Fixes #16015.

9 years agoauto merge of #17032 : jamesluke/rust/master, r=alexcrichton
bors [Sun, 7 Sep 2014 09:26:27 +0000 (09:26 +0000)]
auto merge of #17032 : jamesluke/rust/master, r=alexcrichton

"extern create" -> "extern crate"

9 years agoAdd regression test for issue #10766
Nathan Typanski [Sun, 7 Sep 2014 05:31:41 +0000 (01:31 -0400)]
Add regression test for issue #10766

This test verifies that casting from the same lifetime on a value
to the same lifetime on a trait succeeds. Closes #10766.

9 years agoAdd ICE regression test for issue #16218.
Nathan Typanski [Sun, 7 Sep 2014 05:43:02 +0000 (01:43 -0400)]
Add ICE regression test for issue #16218.

This code used to produce an ICE on the definition of trait Bar
with the following message:

Type parameter out of range when substituting in region 'a (root
type=fn(Self) -> 'astr) (space=FnSpace, index=0)

Closes #16218.

9 years agoauto merge of #17019 : steveklabnik/rust/remove_compromise, r=thestinger
bors [Sun, 7 Sep 2014 07:16:27 +0000 (07:16 +0000)]
auto merge of #17019 : steveklabnik/rust/remove_compromise, r=thestinger

@dherman doesn't like it :smile: