]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoDocument why `core::str::Searcher::new` doesn't overflow
Tobias Bucher [Fri, 12 Sep 2014 13:03:50 +0000 (15:03 +0200)]
Document why `core::str::Searcher::new` doesn't overflow

9 years agoauto merge of #17145 : ahmedcharles/rust/unicode, r=alexcrichton
bors [Fri, 12 Sep 2014 08:05:42 +0000 (08:05 +0000)]
auto merge of #17145 : ahmedcharles/rust/unicode, r=alexcrichton

9 years agoauto merge of #17112 : nick29581/rust/unsized-fields, r=nikomatsakis
bors [Fri, 12 Sep 2014 03:35:38 +0000 (03:35 +0000)]
auto merge of #17112 : nick29581/rust/unsized-fields, r=nikomatsakis

closes #16977

r? @nikomatsakis

9 years agoauto merge of #16657 : steveklabnik/rust/goodbye_tutorial, r=brson
bors [Fri, 12 Sep 2014 01:15:41 +0000 (01:15 +0000)]
auto merge of #16657 : steveklabnik/rust/goodbye_tutorial, r=brson

The Guide isn't 100% perfect, but it's basically complete. It's
certainly better than the tutorial is. Time to start pointing more
people its way.

I also just made it consistent to call all things 'guides' rather than
tutorials.

Fixes #9874. This is the big one.

And two bugs that just go away.

Fixes #14503.
Fixes #15009.

9 years agoFix bug in padding unicode, #17105.
Ahmed Charles [Fri, 12 Sep 2014 00:39:57 +0000 (17:39 -0700)]
Fix bug in padding unicode, #17105.

9 years agoauto merge of #16957 : vadimcn/rust/package-gcc, r=brson
bors [Thu, 11 Sep 2014 21:55:42 +0000 (21:55 +0000)]
auto merge of #16957 : vadimcn/rust/package-gcc, r=brson

Package rustc's mingw dependencies into Windows installer to avoid requiring a separate mingw install.

Closes #11782

9 years agoHandle always-unsized structs
Nick Cameron [Tue, 9 Sep 2014 04:54:13 +0000 (16:54 +1200)]
Handle always-unsized structs

closes #16977

9 years agoonly deprecate the guide rather than :fire: :fire: :fire:
Steve Klabnik [Thu, 21 Aug 2014 21:43:48 +0000 (17:43 -0400)]
only deprecate the guide rather than :fire: :fire: :fire:

9 years agoReplace the Tutorial with the Guide.
Steve Klabnik [Thu, 21 Aug 2014 21:20:33 +0000 (17:20 -0400)]
Replace the Tutorial with the Guide.

The Guide isn't 100% perfect, but it's basically complete. It's
certainly better than the tutorial is. Time to start pointing more
people its way.

I also just made it consistent to call all things 'guides' rather than
tutorials.

Fixes #9874. This is the big one.

And two bugs that just go away.

Fixes #14503.
Fixes #15009.

9 years agoauto merge of #17154 : steveklabnik/rust/array_clarification, r=huonw
bors [Thu, 11 Sep 2014 18:50:41 +0000 (18:50 +0000)]
auto merge of #17154 : steveklabnik/rust/array_clarification, r=huonw

fixes #17148

9 years agoPackage rustc's mingw dependencies into Windows installer.
Vadim Chugunov [Tue, 2 Sep 2014 08:56:54 +0000 (01:56 -0700)]
Package rustc's mingw dependencies into Windows installer.
gcc, ld, ar, dlltool, windres go into $(RUST)/bin/rustlib/<triple>/bin/
platform libraries and startup objects got into $(RUST)/bin/rustlib/<triple>/lib/

9 years agoUpdate license notice.
Vadim Chugunov [Thu, 11 Sep 2014 04:32:36 +0000 (21:32 -0700)]
Update license notice.

9 years agoAppend target-specific tools directory ($(RUST)/bin/rustlib/<triple>/bin/) to PATH...
Vadim Chugunov [Wed, 3 Sep 2014 07:46:23 +0000 (00:46 -0700)]
Append target-specific tools directory ($(RUST)/bin/rustlib/<triple>/bin/) to PATH during linking,
so that rustc can invoke them.

9 years agoauto merge of #17153 : steveklabnik/rust/add_link_to_manual, r=sfackler
bors [Thu, 11 Sep 2014 15:50:45 +0000 (15:50 +0000)]
auto merge of #17153 : steveklabnik/rust/add_link_to_manual, r=sfackler

whoops

Fixes https://github.com/rust-lang/rust/pull/16827#issuecomment-55160273

9 years agoauto merge of #17157 : nikomatsakis/rust/occurs-check, r=pcwalton
bors [Thu, 11 Sep 2014 12:20:43 +0000 (12:20 +0000)]
auto merge of #17157 : nikomatsakis/rust/occurs-check, r=pcwalton

Avoid ever constructing cyclic types in the first place, rather than detecting them in resolve. This simplifies logic elsewhere in the compiler, in particular on the trait reform branch.

r? @pnkfelix or @pcwalton

cc #5527

9 years agoauto merge of #17139 : brson/rust/lualatex, r=alexcrichton
bors [Thu, 11 Sep 2014 07:15:46 +0000 (07:15 +0000)]
auto merge of #17139 : brson/rust/lualatex, r=alexcrichton

Bugs in pdflatex (#12804) are preventing the guide from landing (https://github.com/rust-lang/rust/pull/16657). This solves the immediate problem by changing the build system to prefer lualatex, xelatex to pdflatex (which is apparently obsolete). Because the xelatex on the snapshot bot seems to completely ignore the `-output-directory` option, I also had to frob the makefiles a bit for that case.

9 years agoauto merge of #17110 : thestinger/rust/dst, r=cmr
bors [Thu, 11 Sep 2014 04:55:41 +0000 (04:55 +0000)]
auto merge of #17110 : thestinger/rust/dst, r=cmr

The pointer in the slice must not be null, because enum representations
make that assumption. The `exchange_malloc` function returns a non-null
sentinel for the zero size case, and it must not be passed to the
`exchange_free` lang item.

Since the length is always equal to the true capacity, a branch on the
length is enough for most types. Slices of zero size types are
statically special cased to never attempt deallocation. This is the same
implementation as `Vec<T>`.

Closes #14395

9 years agoRemove dependency on GCC's LTO linker plugin, since Rust does its' own LTO.
Vadim Chugunov [Wed, 3 Sep 2014 07:41:53 +0000 (00:41 -0700)]
Remove dependency on GCC's LTO linker plugin, since Rust does its' own LTO.

9 years agoauto merge of #17142 : sfackler/rust/issue-17115, r=alexcrichton
bors [Thu, 11 Sep 2014 02:35:38 +0000 (02:35 +0000)]
auto merge of #17142 : sfackler/rust/issue-17115, r=alexcrichton

Closes #17115

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 agoFix vector terminology in the manual.
Steve Klabnik [Wed, 10 Sep 2014 21:02:37 +0000 (17:02 -0400)]
Fix vector terminology in the manual.

fixes #17148

9 years agoreintroduce manual link in doc index
Steve Klabnik [Wed, 10 Sep 2014 20:57:00 +0000 (16:57 -0400)]
reintroduce manual link in doc index

whoops

Fixes https://github.com/rust-lang/rust/pull/16827#issuecomment-55160273

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 agoDon't ICE on macros with -Z show-span
Steven Fackler [Wed, 10 Sep 2014 05:38:23 +0000 (22:38 -0700)]
Don't ICE on macros with -Z show-span

Closes #17115

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 agoPrefer lualatex, xelatex, pdflatex, in that order. #12804
Brian Anderson [Tue, 9 Sep 2014 22:47:47 +0000 (15:47 -0700)]
Prefer lualatex, xelatex, pdflatex, in that order. #12804

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 agoAvoid ever constructing cyclic types in the first place, rather than detecting them...
Niko Matsakis [Tue, 9 Sep 2014 21:45:51 +0000 (17:45 -0400)]
Avoid ever constructing cyclic types in the first place, rather than detecting them in resolve. This simplifies logic elsewhere in the compiler. cc #5527

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 agofixes for Box<[T]>
Daniel Micay [Mon, 8 Sep 2014 23:27:06 +0000 (19:27 -0400)]
fixes for Box<[T]>

The pointer in the slice must not be null, because enum representations
make that assumption. The `exchange_malloc` function returns a non-null
sentinel for the zero size case, and it must not be passed to the
`exchange_free` lang item.

Since the length is always equal to the true capacity, a branch on the
length is enough for most types. Slices of zero size types are
statically special cased to never attempt deallocation. This is the same
implementation as `Vec<T>`.

Closes #14395

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.