]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #8427 : brson/rust/rustc-stack, r=thestinger
bors [Mon, 12 Aug 2013 00:38:09 +0000 (17:38 -0700)]
auto merge of #8427 : brson/rust/rustc-stack, r=thestinger

A lot of people are hitting stack overflows in rustc. This will make it
easier to experiment with stack size.

10 years agoauto merge of #8455 : nikomatsakis/rust/issue-5762-objects-dralston-d, r=graydon
bors [Sun, 11 Aug 2013 21:17:09 +0000 (14:17 -0700)]
auto merge of #8455 : nikomatsakis/rust/issue-5762-objects-dralston-d, r=graydon

Fix #5762 and various other aspects of object invocation.

r? @graydon

10 years agoConvert from transform to map
Niko Matsakis [Sun, 11 Aug 2013 18:56:43 +0000 (14:56 -0400)]
Convert from transform to map

10 years agotests: Add new tests for borrowck/objects and update some existing tests
Niko Matsakis [Sun, 11 Aug 2013 17:58:48 +0000 (13:58 -0400)]
tests: Add new tests for borrowck/objects and update some existing tests

10 years agoUpdate type visitor to use &Visitor and not @Visitor
Niko Matsakis [Sun, 11 Aug 2013 17:58:01 +0000 (13:58 -0400)]
Update type visitor to use &Visitor and not @Visitor

10 years agoborrowck: Integrate AutoBorrowObj into borrowck / mem_categorization
Niko Matsakis [Sun, 11 Aug 2013 17:56:30 +0000 (13:56 -0400)]
borrowck: Integrate AutoBorrowObj into borrowck / mem_categorization

Also cleanup the treatment of mutability in mem_categorization, which still
included the concept of interior mutability. At some point, we should
refactor the types to exclude the possibility of interior mutability rather
than just ignoring the mutability value in those cases.

10 years agotypeck: Modify method resolution to use new object adjustments, and
Niko Matsakis [Sun, 11 Aug 2013 17:44:26 +0000 (13:44 -0400)]
typeck: Modify method resolution to use new object adjustments, and
to favor inherent methods over extension methods.

The reason to favor inherent methods is that otherwise an impl
like

    impl Foo for @Foo { fn method(&self) { self.method() } }

causes infinite recursion.  The current change to favor inherent methods is
rather hacky; the method resolution code is in need of a refactoring.

10 years agotrans: Rely on new AutoBorrowObj adjustment to match up object receivers
Niko Matsakis [Sun, 11 Aug 2013 17:42:26 +0000 (13:42 -0400)]
trans: Rely on new AutoBorrowObj adjustment to match up object receivers

Note: some portions of this commit written by @Sodel-the-Vociferous
(Daniel Ralston)

10 years agoty: Add (but do not yet use) AutoBorrowObject option to adjustments
Niko Matsakis [Sun, 11 Aug 2013 17:39:05 +0000 (13:39 -0400)]
ty: Add (but do not yet use) AutoBorrowObject option to adjustments

Note: some portions of this commit written by @Sodel-the-Vociferous
(Daniel Ralston)

10 years agotypeck/check/method: Remove `pub` from most methods
Niko Matsakis [Sun, 11 Aug 2013 17:36:36 +0000 (13:36 -0400)]
typeck/check/method: Remove `pub` from most methods

10 years agoMisc small cleanups
Niko Matsakis [Sun, 11 Aug 2013 17:34:18 +0000 (13:34 -0400)]
Misc small cleanups

10 years agoAdd a field `borrow_offset` to the type descriptor indicating
Niko Matsakis [Sun, 11 Aug 2013 17:29:14 +0000 (13:29 -0400)]
Add a field `borrow_offset` to the type descriptor indicating
what amount a T* pointer must be adjusted to reach the contents
of the box. For `~T` types, this requires knowing the type `T`,
which is not known in the case of objects.

10 years agoauto merge of #8420 : blake2-ppc/rust/shrink-token, r=cmr
bors [Sun, 11 Aug 2013 17:50:10 +0000 (10:50 -0700)]
auto merge of #8420 : blake2-ppc/rust/shrink-token, r=cmr

`enum Token` was 192 bytes (64-bit), as pointed out by pnkfelix; the only
bloating variant being `INTERPOLATED(nonterminal)`.

Updating `enum nonterminal` to use ~ where variants included big types,
shrunk size_of(Token) to 32 bytes (64-bit).

I am unsure if the `nt_ident` variant should have an indirection, with
ast::ident being only 16 bytes (64-bit), but without this, enum Token
would be 40 bytes.

A dumb benchmark says that compilation time is unchanged, while peak
memory usage for compiling std.rs is down 3%

Before::

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1 src/libstd/std.rs
    19.00user 0.39system 0:19.41elapsed 99%CPU (0avgtext+0avgdata 627820maxresident)k
    0inputs+28896outputs (0major+228665minor)pagefaults 0swaps
    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 src/libstd/std.rs
    31.64user 0.34system 0:32.02elapsed 99%CPU (0avgtext+0avgdata 629876maxresident)k
    0inputs+22432outputs (0major+229411minor)pagefaults 0swaps

After::

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1 src/libstd/std.rs
    19.07user 0.45system 0:19.55elapsed 99%CPU (0avgtext+0avgdata 609384maxresident)k
    0inputs+28896outputs (0major+221997minor)pagefaults 0swaps

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 src/libstd/std.rs
    31.90user 0.34system 0:32.28elapsed 99%CPU (0avgtext+0avgdata 612080maxresident)k
    0inputs+22432outputs (0major+223726minor)pagefaults 0swaps

10 years agolibrustc: Convert from `@Object` to `@mut Object` as needed
Niko Matsakis [Sun, 11 Aug 2013 17:26:59 +0000 (13:26 -0400)]
librustc: Convert from `@Object` to `@mut Object` as needed

10 years agolibsyntax: Update from `@Object` to `@mut Object` as required
Niko Matsakis [Sun, 11 Aug 2013 17:23:40 +0000 (13:23 -0400)]
libsyntax: Update from `@Object` to `@mut Object` as required

10 years agoauto merge of #8421 : alexcrichton/rust/unnamed-addr, r=thestinger
bors [Sun, 11 Aug 2013 14:29:07 +0000 (07:29 -0700)]
auto merge of #8421 : alexcrichton/rust/unnamed-addr, r=thestinger

This can be applied to statics and it will indicate that LLVM will attempt to
merge the constant in .data with other statics.

I have preliminarily applied this to all of the statics generated by the new
`ifmt!` syntax extension. I compiled a file with 1000 calls to `ifmt!` and a
separate file with 1000 calls to `fmt!` to compare the sizes, and the results
were:

```
fmt           310k
ifmt (before) 529k
ifmt (after)  202k
```

This now means that ifmt! is both faster and smaller than fmt!, yay!

10 years agoauto merge of #8412 : thestinger/rust/vector-add, r=alexcrichton
bors [Sun, 11 Aug 2013 11:11:08 +0000 (04:11 -0700)]
auto merge of #8412 : thestinger/rust/vector-add, r=alexcrichton

10 years agoauto merge of #8408 : thestinger/rust/checked, r=Aatch
bors [Sun, 11 Aug 2013 07:47:07 +0000 (00:47 -0700)]
auto merge of #8408 : thestinger/rust/checked, r=Aatch

10 years agofix unused imports
Daniel Micay [Sun, 11 Aug 2013 07:17:01 +0000 (03:17 -0400)]
fix unused imports

10 years agomove `strdup_uniq` lang item to std::str
Daniel Micay [Sat, 10 Aug 2013 17:42:53 +0000 (13:42 -0400)]
move `strdup_uniq` lang item to std::str

10 years agostr: optimize `with_capacity`
Daniel Micay [Sat, 10 Aug 2013 17:32:05 +0000 (13:32 -0400)]
str: optimize `with_capacity`

before:

test bench_with_capacity ... bench: 104 ns/iter (+/- 4)

after:

test bench_with_capacity ... bench: 56 ns/iter (+/- 1)

10 years agovec: optimize the Add implementation
Daniel Micay [Fri, 9 Aug 2013 03:49:49 +0000 (23:49 -0400)]
vec: optimize the Add implementation

before:

test add ... bench: 164 ns/iter (+/- 1)

after:

test add ... bench: 113 ns/iter (+/- 2)

10 years agodisable 64-bit CheckedMul on 32-bit
Daniel Micay [Sun, 11 Aug 2013 06:58:52 +0000 (02:58 -0400)]
disable 64-bit CheckedMul on 32-bit

code generation problem reported as issue #8449

10 years agoadd intrinsics for checked overflow add/sub/mul
Daniel Micay [Wed, 7 Aug 2013 19:40:09 +0000 (15:40 -0400)]
add intrinsics for checked overflow add/sub/mul

10 years agosyntax: Shrink enum Token and enum nonterminal
blake2-ppc [Fri, 9 Aug 2013 17:55:15 +0000 (19:55 +0200)]
syntax: Shrink enum Token and enum nonterminal

`enum Token` was 192 bytes (64-bit), as pointed out by pnkfelix; the only
bloating variant being `INTERPOLATED(nonterminal)`.

Updating `enum nonterminal` to use ~ where variants included big types,
shrunk size_of(Token) to 32 bytes (64-bit).

I am unsure if the `nt_ident` variant should have an indirection, with
ast::ident being only 16 bytes (64-bit), but without this, enum Token
would be 40 bytes.

A dumb benchmark says that compilation time is unchanged, while peak
memory usage for compiling std.rs is down 3%

Before::

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1 src/libstd/std.rs
    19.00user 0.39system 0:19.41elapsed 99%CPU (0avgtext+0avgdata 627820maxresident)k
    0inputs+28896outputs (0major+228665minor)pagefaults 0swaps
    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 src/libstd/std.rs
    31.64user 0.34system 0:32.02elapsed 99%CPU (0avgtext+0avgdata 629876maxresident)k
    0inputs+22432outputs (0major+229411minor)pagefaults 0swaps

After::

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1 src/libstd/std.rs
    19.07user 0.45system 0:19.55elapsed 99%CPU (0avgtext+0avgdata 609384maxresident)k
    0inputs+28896outputs (0major+221997minor)pagefaults 0swaps

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 src/libstd/std.rs
    31.90user 0.34system 0:32.28elapsed 99%CPU (0avgtext+0avgdata 612080maxresident)k
    0inputs+22432outputs (0major+223726minor)pagefaults 0swaps

10 years agoauto merge of #8404 : stepancheg/rust/zero-unit-inline, r=alexcrichton
bors [Sun, 11 Aug 2013 02:53:06 +0000 (19:53 -0700)]
auto merge of #8404 : stepancheg/rust/zero-unit-inline, r=alexcrichton

Follow-up to #8155

10 years agoauto merge of #8444 : erickt/rust/rollup, r=cmr
bors [Sat, 10 Aug 2013 23:32:18 +0000 (16:32 -0700)]
auto merge of #8444 : erickt/rust/rollup, r=cmr

This merges these PR together:

#8430: r=thestinger
#8370: r=thestinger
#8386: r=bstrie
#8388: r=thestinger
#8390: r=graydon
#8394: r=graydon
#8402: r=thestinger
#8403: r=catamorphism

10 years agoauto merge of #8430 : erickt/rust/cleanup-iterators, r=erickt
bors [Sat, 10 Aug 2013 20:17:19 +0000 (13:17 -0700)]
auto merge of #8430 : erickt/rust/cleanup-iterators, r=erickt

This PR does a bunch of cleaning up of various APIs. The major one is that it merges `Iterator` and `IteratorUtil`, and renames functions like `transform` into `map`. I also merged `DoubleEndedIterator` and `DoubleEndedIteratorUtil`, as well as I renamed various .consume* functions to .move_iter(). This helps to implement part of #7887.

10 years agoMerge branch 'match' of https://github.com/msullivan/rust into rollup
Erick Tryzelaar [Sat, 10 Aug 2013 20:04:16 +0000 (13:04 -0700)]
Merge branch 'match' of https://github.com/msullivan/rust into rollup

10 years agoMerge branch 'master' of https://github.com/MAnyKey/rust into rollup
Erick Tryzelaar [Sat, 10 Aug 2013 20:03:34 +0000 (13:03 -0700)]
Merge branch 'master' of https://github.com/MAnyKey/rust into rollup

10 years agoMerge branch 'issue-8393-attributes-in-macros' of https://github.com/nikomatsakis...
Erick Tryzelaar [Sat, 10 Aug 2013 20:03:19 +0000 (13:03 -0700)]
Merge branch 'issue-8393-attributes-in-macros' of https://github.com/nikomatsakis/rust into rollup

10 years agoMerge branch 'master' of https://github.com/p2j4d2c/rust into rollup
Erick Tryzelaar [Sat, 10 Aug 2013 20:02:44 +0000 (13:02 -0700)]
Merge branch 'master' of https://github.com/p2j4d2c/rust into rollup

10 years agoMerge branch 'trie-bound-iters' of https://github.com/dim-an/rust into rollup
Erick Tryzelaar [Sat, 10 Aug 2013 20:01:20 +0000 (13:01 -0700)]
Merge branch 'trie-bound-iters' of https://github.com/dim-an/rust into rollup

10 years agoMerge branch 'vec-exh' of https://github.com/stepancheg/rust into rollup
Erick Tryzelaar [Sat, 10 Aug 2013 20:00:20 +0000 (13:00 -0700)]
Merge branch 'vec-exh' of https://github.com/stepancheg/rust into rollup

10 years agoMerge branch 'enum-method-privacy' of https://github.com/michaelwoerister/rust into...
Erick Tryzelaar [Sat, 10 Aug 2013 19:59:52 +0000 (12:59 -0700)]
Merge branch 'enum-method-privacy' of https://github.com/michaelwoerister/rust into rollup

Conflicts:
src/libsyntax/opt_vec.rs

10 years agoMerge remote-tracking branch 'remotes/origin/master' into cleanup-iterators
Erick Tryzelaar [Sat, 10 Aug 2013 19:04:40 +0000 (12:04 -0700)]
Merge remote-tracking branch 'remotes/origin/master' into cleanup-iterators

10 years agoauto merge of #8327 : sstewartgallus/rust/factor_out_waitqueue, r=bblum
bors [Sat, 10 Aug 2013 14:47:14 +0000 (07:47 -0700)]
auto merge of #8327 : sstewartgallus/rust/factor_out_waitqueue, r=bblum

I'm a bit disappointed that I couldn't figure out how to factor out more of the code implementing `extra::sync` but I feel this is an okay start. Also I added some documentation explaining that `WaitQueue` isn't thread safe, and needs an exclusive lock.

@bblum

10 years agosyntax and rustc: fix some warnings
Erick Tryzelaar [Sat, 10 Aug 2013 14:14:10 +0000 (07:14 -0700)]
syntax and rustc: fix some warnings

10 years agostd: fix the non-stage0 str::raw::slice_bytes which broke in a merge
Erick Tryzelaar [Sat, 10 Aug 2013 14:13:47 +0000 (07:13 -0700)]
std: fix the non-stage0 str::raw::slice_bytes which broke in a merge

10 years agostd: Transform.find_ -> .find
Erick Tryzelaar [Sat, 10 Aug 2013 03:49:29 +0000 (20:49 -0700)]
std: Transform.find_ -> .find

10 years agostd: Iterator.len_ -> .len
Erick Tryzelaar [Sat, 10 Aug 2013 03:30:03 +0000 (20:30 -0700)]
std: Iterator.len_ -> .len

10 years agostd: Iterator.last_ -> .last
Erick Tryzelaar [Sat, 10 Aug 2013 03:25:45 +0000 (20:25 -0700)]
std: Iterator.last_ -> .last

10 years agostd: Iterator.chain_ -> .chain
Erick Tryzelaar [Sat, 10 Aug 2013 03:22:59 +0000 (20:22 -0700)]
std: Iterator.chain_ -> .chain

10 years agostd: Iterator.flat_map_ -> .flat_map
Erick Tryzelaar [Sat, 10 Aug 2013 03:20:05 +0000 (20:20 -0700)]
std: Iterator.flat_map_ -> .flat_map

10 years agostd: Iterator.take_ -> .take
Erick Tryzelaar [Sat, 10 Aug 2013 03:16:07 +0000 (20:16 -0700)]
std: Iterator.take_ -> .take

10 years agostd: Rename Iterator.transform -> .map
Erick Tryzelaar [Sat, 10 Aug 2013 03:09:47 +0000 (20:09 -0700)]
std: Rename Iterator.transform -> .map

cc #5898

10 years agostd: merge Iterator and IteratorUtil
Erick Tryzelaar [Fri, 9 Aug 2013 14:19:23 +0000 (07:19 -0700)]
std: merge Iterator and IteratorUtil

10 years agostd: merge iterator::DoubleEndedIterator and DoubleEndedIteratorUtil
Erick Tryzelaar [Fri, 9 Aug 2013 03:33:28 +0000 (20:33 -0700)]
std: merge iterator::DoubleEndedIterator and DoubleEndedIteratorUtil

10 years agoClean up some unused imports in tests
Erick Tryzelaar [Thu, 8 Aug 2013 13:48:20 +0000 (06:48 -0700)]
Clean up some unused imports in tests

10 years agoMass rename of .consume{,_iter}() to .move_iter()
Erick Tryzelaar [Thu, 8 Aug 2013 02:21:36 +0000 (19:21 -0700)]
Mass rename of .consume{,_iter}() to .move_iter()

cc #7887

10 years agoauto merge of #8270 : dotdash/rust/ret_alloca_elim, r=pcwalton
bors [Sat, 10 Aug 2013 11:44:13 +0000 (04:44 -0700)]
auto merge of #8270 : dotdash/rust/ret_alloca_elim, r=pcwalton

When there is only a single store to the ret slot that dominates the
load that gets the value for the "ret" instruction, we can elide the
ret slot and directly return the operand of the dominating store
instruction. This is the same thing that clang does, except for a
special case that doesn't seem to affect us.

Fixes #8238

10 years agoElide unnecessary ret slot allocas
Björn Steinbrink [Sun, 28 Jul 2013 14:40:35 +0000 (16:40 +0200)]
Elide unnecessary ret slot allocas

When there is only a single store to the ret slot that dominates the
load that gets the value for the "ret" instruction, we can elide the
ret slot and directly return the operand of the dominating store
instruction. This is the same thing that clang does, except for a
special case that doesn't seem to affect us.

Fixes #8238

10 years agoauto merge of #8425 : dim-an/rust/increase-stack-size, r=brson
bors [Sat, 10 Aug 2013 08:20:14 +0000 (01:20 -0700)]
auto merge of #8425 : dim-an/rust/increase-stack-size, r=brson

10 years agoauto merge of #8296 : erickt/rust/remove-str-trailing-nulls, r=erickt
bors [Sat, 10 Aug 2013 04:56:17 +0000 (21:56 -0700)]
auto merge of #8296 : erickt/rust/remove-str-trailing-nulls, r=erickt

This PR fixes #7235 and #3371, which removes trailing nulls from `str` types. Instead, it replaces the creation of c strings with a new type, `std::c_str::CString`, which wraps a malloced byte array, and respects:

*  No interior nulls
* Ends with a trailing null

10 years agoMerge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls
Erick Tryzelaar [Sat, 10 Aug 2013 01:48:01 +0000 (18:48 -0700)]
Merge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls

10 years agoauto merge of #8387 : brson/rust/nooldrt, r=brson
bors [Sat, 10 Aug 2013 01:41:13 +0000 (18:41 -0700)]
auto merge of #8387 : brson/rust/nooldrt, r=brson

10 years agoFix interaction between default matches and guards. Closes #3121.
Michael Sullivan [Sat, 10 Aug 2013 00:39:21 +0000 (17:39 -0700)]
Fix interaction between default matches and guards. Closes #3121.

10 years agorustc: Obey RUST_MIN_STACK env var
Brian Anderson [Sat, 10 Aug 2013 00:28:27 +0000 (17:28 -0700)]
rustc: Obey RUST_MIN_STACK env var

A lot of people are hitting stack overflows in rustc. This will make it
easier to experiment with stack size.

10 years agoRemove the C++ runtime. Sayonara
Brian Anderson [Thu, 1 Aug 2013 06:12:20 +0000 (23:12 -0700)]
Remove the C++ runtime. Sayonara

10 years agoIncrease system stack size.
Dmitry Ermolov [Fri, 9 Aug 2013 23:37:39 +0000 (03:37 +0400)]
Increase system stack size.

10 years agoauto merge of #8176 : catamorphism/rust/rustpkg-extern-mod, r=catamorphism
bors [Fri, 9 Aug 2013 23:17:10 +0000 (16:17 -0700)]
auto merge of #8176 : catamorphism/rust/rustpkg-extern-mod, r=catamorphism

r? @graydon Also, notably, make rustpkgtest depend on the rustpkg executable (otherwise, tests that shell out to rustpgk might run when rustpkg doesn't exist).

10 years agoFix some warnings.
Michael Sullivan [Fri, 9 Aug 2013 23:07:26 +0000 (16:07 -0700)]
Fix some warnings.

10 years agorustpkg: Simplify the PkgId struct
Tim Chevalier [Fri, 2 Aug 2013 23:59:58 +0000 (16:59 -0700)]
rustpkg: Simplify the PkgId struct

Get rid of special cases for names beginning with "rust-" or
containing hyphens, and just store a Path in a package ID. The Rust-identifier
for the crate is none of rustpkg's business.

10 years agostd/rustc/rustpkg/syntax: Support the `extern mod = ...` form
Tim Chevalier [Wed, 31 Jul 2013 20:47:32 +0000 (13:47 -0700)]
std/rustc/rustpkg/syntax: Support the `extern mod = ...` form

This commit allows you to write:

 extern mod x = "a/b/c";

which means rustc will search in the RUST_PATH for a package with
ID a/b/c, and bind it to the name `x` if it's found.

Incidentally, move get_relative_to from back::rpath into std::path

10 years agorustpkg: another fix for windows
Erick Tryzelaar [Fri, 9 Aug 2013 21:06:03 +0000 (14:06 -0700)]
rustpkg: another fix for windows

10 years agoauto merge of #8415 : brson/rust/newrt-local-heap-perf, r=pcwalton,brson
bors [Fri, 9 Aug 2013 20:53:08 +0000 (13:53 -0700)]
auto merge of #8415 : brson/rust/newrt-local-heap-perf, r=pcwalton,brson

Mostly optimizing TLS accesses to bring local heap allocation performance
closer to that of oldsched. It's not completely at parity but removing the
branches involved in supporting oldsched and optimizing pthread_get/setspecific
to instead use our dedicated TCB slot will probably make up for it.

10 years agoImplement an `address_insignificant` attribute
Alex Crichton [Fri, 9 Aug 2013 20:47:00 +0000 (13:47 -0700)]
Implement an `address_insignificant` attribute

This can be applied to statics and it will indicate that LLVM will attempt to
merge the constant in .data with other statics.

I have preliminarily applied this to all of the statics generated by the new
`ifmt!` syntax extension. I compiled a file with 1000 calls to `ifmt!` and a
separate file with 1000 calls to `fmt!` to compare the sizes, and the results
were:

fmt           310k
ifmt (before) 529k
ifmt (after)  202k

This now means that ifmt! is both faster and smaller than fmt!, yay!

10 years agoFix vector pattern matching. Closes #6909.
Michael Sullivan [Thu, 8 Aug 2013 22:19:19 +0000 (15:19 -0700)]
Fix vector pattern matching. Closes #6909.

10 years agoSwitch to using .enumerate() some places in _match.
Michael Sullivan [Tue, 6 Aug 2013 23:50:58 +0000 (16:50 -0700)]
Switch to using .enumerate() some places in _match.

10 years agostd: more windows fixes to os.rs and run.rs
Erick Tryzelaar [Fri, 9 Aug 2013 18:13:26 +0000 (11:13 -0700)]
std: more windows fixes to os.rs and run.rs

10 years agoauto merge of #8369 : yichoi/rust/arm-test, r=sanxiyn
bors [Fri, 9 Aug 2013 17:59:08 +0000 (10:59 -0700)]
auto merge of #8369 : yichoi/rust/arm-test, r=sanxiyn

fix some part of test code to pass make check on ARM Android

10 years agoauto merge of #8352 : stepancheg/rust/ipv6-to-str, r=luqmana
bors [Fri, 9 Aug 2013 15:17:04 +0000 (08:17 -0700)]
auto merge of #8352 : stepancheg/rust/ipv6-to-str, r=luqmana

Reported by @luqmana

10 years agoauto merge of #8362 : sfackler/rust/env, r=alexcrichton
bors [Fri, 9 Aug 2013 12:35:06 +0000 (05:35 -0700)]
auto merge of #8362 : sfackler/rust/env, r=alexcrichton

env! aborts compilation of the specified environment variable is not
defined and takes an optional second argument containing a custom
error message. option_env! creates an Option<&'static str> containing
the value of the environment variable.

There are no run-pass tests that check the behavior when the environment
variable is defined since the test framework doesn't support setting
environment variables at compile time as opposed to runtime. However,
both env! and option_env! are used inside of rustc itself, which should
act as a sufficient test.

Fixes #2248.

10 years agoImplement `lower_bound_iter`/`upper_bound_iter` for TrieMap/TrieSet
Dmitry Ermolov [Wed, 7 Aug 2013 22:37:13 +0000 (02:37 +0400)]
Implement `lower_bound_iter`/`upper_bound_iter` for TrieMap/TrieSet

10 years agoFix Ipv6Addr to_str for ::1:x.x.x.x addresses
Stepan Koltsov [Fri, 9 Aug 2013 09:53:28 +0000 (13:53 +0400)]
Fix Ipv6Addr to_str for ::1:x.x.x.x addresses

Reported by luqmana@

10 years agoauto merge of #8361 : alexcrichton/rust/fix-node-hashes-in-crates, r=thestinger
bors [Fri, 9 Aug 2013 09:53:08 +0000 (02:53 -0700)]
auto merge of #8361 : alexcrichton/rust/fix-node-hashes-in-crates, r=thestinger

When running rusti 32-bit tests from a 64-bit host, these errors came up frequently. My best idea as to what was happening is:

1. First, if you hash the same `int` value on 32-bit and 64-bit, you will get two different hashes.
2. In a cross-compile situation, let's say x86_64 is building an i686 library, all of the hashes will be 64-bit hashes.
3. Then let's say you use the i686 libraries and then attempt to link against the same i686 libraries, because you're calculating hashes with a 32-bit int instead of a 64-bit one, you'll have different hashes and you won't be able to find items in the metadata (the items were generated with a 64-bit int).

This patch changes the items to always be hashed as an `i64` to preserve the hash value across architectures. Here's a nice before/after for this patch of the state of rusti tests

```
host   target  before  after
64     64      yes     yes
64     32      no      no (llvm assertion)
32     64      no      yes
32     32      no      no (llvm assertion)
```

Basically one case started working, but currently when the target is 32-bit LLVM is having a lot of problems generating code. That's another separate issue though.

10 years agostd: Fix perf of local allocations in newsched
Brian Anderson [Fri, 9 Aug 2013 08:15:31 +0000 (01:15 -0700)]
std: Fix perf of local allocations in newsched

Mostly optimizing TLS accesses to bring local heap allocation performance
closer to that of oldsched. It's not completely at parity but removing the
branches involved in supporting oldsched and optimizing pthread_get/setspecific
to instead use our dedicated TCB slot will probably make up for it.

10 years agoauto merge of #8357 : omasanori/rust/cleanup, r=alexcrichton
bors [Fri, 9 Aug 2013 07:17:06 +0000 (00:17 -0700)]
auto merge of #8357 : omasanori/rust/cleanup, r=alexcrichton

I feel it's time to eliminate them (and add some testcases.)

10 years agoRemove redundant Ord method impls.
OGINO Masanori [Thu, 8 Aug 2013 01:03:34 +0000 (10:03 +0900)]
Remove redundant Ord method impls.

Basically, generic containers should not use the default methods since a
type of elements may not guarantees total order. str could use them
since u8's Ord guarantees total order. Floating point numbers are also
broken with the default methods because of NaN. Thanks for @thestinger.

Timespec also guarantees total order AIUI. I'm unsure whether
extra::semver::Identifier does so I left it alone. Proof needed.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoauto merge of #8350 : dim-an/rust/fix-struct-match, r=pcwalton
bors [Fri, 9 Aug 2013 04:41:05 +0000 (21:41 -0700)]
auto merge of #8350 : dim-an/rust/fix-struct-match, r=pcwalton

Code that collects fields in struct-like patterns used to ignore
wildcard patterns like `Foo{_}`. But `enter_defaults` considered
struct-like patterns as default in order to overcome this
(accoring to my understanding of situation).

However such behaviour caused code like this:
```
enum E {
    Foo{f: int},
    Bar
}
let e = Bar;
match e {
    Foo{f: _f} => { /* do something (1) */ }
    _ => { /* do something (2) */ }
}
```
consider pattern `Foo{f: _f}` as default. That caused inproper behaviour
and even segfaults while trying to destruct `Bar` as `Foo{f: _f}`.
Issues: #5625 , #5530.

This patch fixes `collect_record_or_struct_fields` to split cases of
single wildcard struct-like pattern and no struct-like pattern at all.
Former case resolved with `enter_rec_or_struct` (and not with
`enter_defaults`).

Closes #5625.
Closes #5530.

10 years agoIsolate common wait_end logic
Steven Stewart-Gallus [Fri, 9 Aug 2013 02:33:34 +0000 (19:33 -0700)]
Isolate common wait_end logic

10 years agoMerge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls
Erick Tryzelaar [Fri, 9 Aug 2013 02:27:03 +0000 (19:27 -0700)]
Merge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls

10 years agoauto merge of #8336 : stepancheg/rust/socket-addr-from-str, r=brson
bors [Fri, 9 Aug 2013 02:08:02 +0000 (19:08 -0700)]
auto merge of #8336 : stepancheg/rust/socket-addr-from-str, r=brson

FromStr implemented from scratch.

It is overengineered a bit, however.

Old implementation handles errors by fail!()-ing. And it has bugs, like it accepts `127.0.0.1::127.0.0.1` as IPv6 address, and does not handle all ipv4-in-ipv6 schemes. So I decided to implement parser from scratch.

10 years agoAllow attributes to appear as macro arguments
Niko Matsakis [Thu, 8 Aug 2013 17:28:06 +0000 (13:28 -0400)]
Allow attributes to appear as macro arguments

Fixes #8393

10 years agoauto merge of #8356 : toddaaro/rust/ws, r=brson
bors [Thu, 8 Aug 2013 23:32:02 +0000 (16:32 -0700)]
auto merge of #8356 : toddaaro/rust/ws, r=brson

This pull request converts the scheduler from a naive shared queue scheduler to a naive workstealing scheduler. The deque is still a queue inside a lock, but there is still a substantial performance gain. Fiddling with the messaging benchmark I got a ~10x speedup and observed massively reduced memory usage.

There are still *many* locations for optimization, but based on my experience so far it is a clear performance win as it is now.

10 years agoAdd #[inline] to impl Zero for ()
Stepan Koltsov [Thu, 8 Aug 2013 22:19:50 +0000 (02:19 +0400)]
Add #[inline] to impl Zero for ()

Follow-up to #8155

10 years agoMakefiles: make rustpkgtest depend on rustpkg executable
Tim Chevalier [Tue, 30 Jul 2013 21:24:27 +0000 (14:24 -0700)]
Makefiles: make rustpkgtest depend on rustpkg executable

10 years agorustpkg: Eliminate a copy
Tim Chevalier [Tue, 30 Jul 2013 21:58:30 +0000 (14:58 -0700)]
rustpkg: Eliminate a copy

10 years agotypo in tutorial
Maxim Kolganov [Thu, 8 Aug 2013 21:43:44 +0000 (01:43 +0400)]
typo in tutorial

10 years agoauto merge of #8385 : cmr/rust/big-rollup, r=alexcrichton
bors [Thu, 8 Aug 2013 21:32:02 +0000 (14:32 -0700)]
auto merge of #8385 : cmr/rust/big-rollup, r=alexcrichton

This is a fairly large rollup, but I've tested everything locally, and none of
it should be platform-specific.

r=alexcrichton (bdfdbdd)
r=brson (d803c18)
r=alexcrichton (a5041d0)
r=bstrie (317412a)
r=alexcrichton (135c85e)
r=thestinger (8805baa)
r=pcwalton (0661178)
r=cmr (9397fe0)
r=cmr (caa4135)
r=cmr (6a21d93)
r=cmr (4dc3379)
r=cmr (0aa5154)
r=cmr (18be261)
r=thestinger (f10be03)

10 years agoEnabled workstealing in the scheduler. Previously we had one global work queue shared...
toddaaro [Mon, 5 Aug 2013 20:06:24 +0000 (13:06 -0700)]
Enabled workstealing in the scheduler. Previously we had one global work queue shared by each scheduler. Now there is a separate work queue for each scheduler, and work is "stolen" from other queues when it is exhausted locally.

10 years agoFix more priv fallout
Corey Richardson [Thu, 8 Aug 2013 21:02:03 +0000 (17:02 -0400)]
Fix more priv fallout

10 years agoxfail-fast an aux test
Corey Richardson [Thu, 8 Aug 2013 19:34:59 +0000 (15:34 -0400)]
xfail-fast an aux test

11 years agoenv! syntax extension changes
Steven Fackler [Wed, 7 Aug 2013 04:50:23 +0000 (00:50 -0400)]
env! syntax extension changes

env! aborts compilation of the specified environment variable is not
defined and takes an optional second argument containing a custom
error message. option_env! creates an Option<&'static str> containing
the value of the environment variable.

There are no run-pass tests that check the behavior when the environment
variable is defined since the test framework doesn't support setting
environment variables at compile time as opposed to runtime. However,
both env! and option_env! are used inside of rustc itself, which should
act as a sufficient test.

Close #2248

11 years agostd: more fixes for os.rs for windows
Erick Tryzelaar [Thu, 8 Aug 2013 13:37:55 +0000 (06:37 -0700)]
std: more fixes for os.rs for windows

11 years agorust-mode: make indentation customizable
Paul Collins [Thu, 8 Aug 2013 06:48:04 +0000 (18:48 +1200)]
rust-mode: make indentation customizable

Add new variable rust-indent-offset, defaulting to
the old value, and use it.

11 years agoauto merge of #8245 : alexcrichton/rust/fmt2, r=graydon
bors [Thu, 8 Aug 2013 07:22:52 +0000 (00:22 -0700)]
auto merge of #8245 : alexcrichton/rust/fmt2, r=graydon

This is a reopening of #8182, although this removes any abuse of the compiler internals. Now it's just a pure syntax extension (hard coded what the attribute names are).

11 years agostd: import HANDLE for os::list_dir for windows
Erick Tryzelaar [Thu, 8 Aug 2013 04:07:06 +0000 (21:07 -0700)]
std: import HANDLE for os::list_dir for windows

11 years agoFix a stack to use the new .to_c_str() api
Erick Tryzelaar [Thu, 8 Aug 2013 03:25:38 +0000 (20:25 -0700)]
Fix a stack to use the new .to_c_str() api

11 years agoFix fallout
Corey Richardson [Thu, 8 Aug 2013 03:20:06 +0000 (23:20 -0400)]
Fix fallout