Commit Graph

32153 Commits

Author SHA1 Message Date
bors
a1f4973090 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.
2014-09-09 23:55:43 +00:00
bors
651106462c auto merge of #17127 : alexcrichton/rust/rollup, r=alexcrichton 2014-09-09 20:16:19 +00:00
Alex Crichton
e5abe15ff5 Test fixes from the rollup 2014-09-09 13:13:04 -07:00
Piotr Czarnecki
fcf88b8f87 coretest: Ensure that pointer formatting flags are cleaned up 2014-09-09 20:34:41 +01:00
Piotr Czarnecki
5aaa606932 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`.
2014-09-09 20:34:41 +01:00
Piotr Czarnecki
696367fb8d Decouple string and argument pieces 2014-09-09 20:34:41 +01:00
Alex Crichton
25e08fb4fe rollup merge of #17114 : nick29581/dst-type 2014-09-09 12:07:14 -07:00
Alex Crichton
456f00eb7e rollup merge of #17107 : steveklabnik/uninitialized_bindings 2014-09-09 12:07:14 -07:00
Alex Crichton
613ae0b486 rollup merge of #17106 : treeman/test-warnings 2014-09-09 12:07:14 -07:00
Alex Crichton
a9d8f295e0 rollup merge of #17101 : pcwalton/for-loop-borrowck 2014-09-09 12:07:13 -07:00
Alex Crichton
6b487ebbc0 rollup merge of #17096 : TeXitoi/relicense-shootout-chameneos-redux 2014-09-09 12:07:13 -07:00
Alex Crichton
e561a28b98 rollup merge of #17093 : nathantypanski/17021 2014-09-09 12:07:13 -07:00
Alex Crichton
b00db6801e rollup merge of #17090 : alexcrichton/rustdoc-no-strip 2014-09-09 12:07:13 -07:00
Alex Crichton
c9b1e836c5 rollup merge of #17087 : DanAlbert/llvm-3.6 2014-09-09 12:07:13 -07:00
Alex Crichton
e6b0784903 rollup merge of #17085 : jakub-/issue-17074 2014-09-09 12:07:13 -07:00
Alex Crichton
b8dd7d5056 rollup merge of #17080 : treeman/issue-17066 2014-09-09 12:07:12 -07:00
Alex Crichton
83e4653404 rollup merge of #17077 : TeXitoi/relicense-shootout-nbody 2014-09-09 12:07:12 -07:00
Alex Crichton
d0cd01104c rollup merge of #17070 : TeXitoi/relicense-shootout-reverse-complement.rs 2014-09-09 12:07:12 -07:00
Alex Crichton
2703fcf988 rollup merge of #17062 : nathantypanski/generic-lifetime-trait-impl 2014-09-09 12:07:12 -07:00
Alex Crichton
e8e62393bb rollup merge of #17061 : nathantypanski/test-borrowck-trait 2014-09-09 12:07:12 -07:00
Alex Crichton
8158463122 rollup merge of #17054 : pcwalton/subslice-syntax 2014-09-09 12:07:12 -07:00
Alex Crichton
2c66c296db rollup merge of #17052 : pcwalton/feature-gate-subslices 2014-09-09 12:07:11 -07:00
Alex Crichton
fb3c67a65c rollup merge of #17040 : kmcallister/borrow-extctxt 2014-09-09 12:07:11 -07:00
Alex Crichton
d1d9d195c9 rollup merge of #17020 : nodakai/libnative-c_int 2014-09-09 12:07:11 -07:00
Alex Crichton
a0b3701a21 rollup merge of #17013 : rgawdzik/literal_int 2014-09-09 12:07:11 -07:00
Alex Crichton
f48b701213 rollup merge of #17008 : nick29581/impl2 2014-09-09 12:07:11 -07:00
Alex Crichton
679b4e1b38 rollup merge of #16971 : treeman/json-decode 2014-09-09 12:07:11 -07:00
bors
b625d43f8f auto merge of #16927 : dotdash/rust/llvmup, r=alexcrichton 2014-09-09 17:16:18 +00:00
bors
504ed55775 auto merge of #16827 : steveklabnik/rust/fix_doc_index, r=brson
Fixes #14972
2014-09-09 13:26:16 +00:00
bors
3884f5fc8e 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.)
2014-09-09 11:11:17 +00:00
Jonas Hietala
947a1b923b Remove some test warnings. 2014-09-09 11:32:58 +02:00
bors
7ab58f67d1 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.
2014-09-09 07:56:19 +00:00
Nick Cameron
b1916288bf Handle Sized? in type items.
Resolves bounds for `type` and adds the warning for 'unbounds' (? bounds) that we have for bounds.

Closes #16888
2014-09-09 18:22:20 +12:00
Jonas Hietala
4f4a3dfb1a Decoding json now defaults Option<_> to None.
Closes #12794
2014-09-09 07:28:59 +02:00
bors
641b1980a4 auto merge of #16825 : steveklabnik/rust/fix_manual_array_terms, r=brson
fixes #16015
2014-09-09 04:26:18 +00:00
Patrick Walton
eb678ff87f 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]
2014-09-08 16:12:13 -07:00
Steve Klabnik
18f1f5a06e 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.
2014-09-08 18:50:08 -04:00
Nick Cameron
c2fcd4ca72 Check traits for built-in bounds in impls 2014-09-09 10:41:27 +12:00
bors
325808a33d 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.
2014-09-08 20:51:14 +00:00
Alex Crichton
198030fadf 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.
2014-09-08 12:54:32 -07:00
Keegan McAllister
2b3619412f quote: Explicitly borrow the ExtCtxt
Fixes #16992.
2014-09-08 11:30:55 -07:00
Patrick Walton
22179f49e5 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]
2014-09-08 11:04:14 -07:00
Patrick Walton
3ca53d3a10 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]
2014-09-08 10:50:34 -07:00
bors
0c73e5fc5f 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).
2014-09-08 15:36:13 +00:00
Björn Steinbrink
cdfa637dad Update LLVM to fix a crash in the MergeFunc pass 2014-09-08 17:07:03 +02:00
bors
6f34760e41 auto merge of #16903 : mahkoh/rust/move_items_unwrap, r=aturon
Closes #16879
2014-09-08 13:46:15 +00:00
Eduard Burtescu
8bfbcddf53 rustdoc: fix fallout from the addition of a 'tcx lifetime on tcx. 2014-09-08 15:28:25 +03:00
Eduard Burtescu
f7a997be05 rustc: fix fallout from the addition of a 'tcx lifetime on trans::Block. 2014-09-08 15:28:24 +03:00
Eduard Burtescu
28be695b2c rustc: fix fallout from the addition of a 'tcx lifetime on tcx. 2014-09-08 15:28:23 +03:00
Eduard Burtescu
22f8b8462e rustc: use a TypedArena to allocate types in the type context. 2014-09-08 15:14:10 +03:00