Commit Graph

32472 Commits

Author SHA1 Message Date
bors
6ceb9b4157 auto merge of #16824 : steveklabnik/rust/string_guide_improvements, r=alexcrichton
A few steps toward https://github.com/rust-lang/rust/issues/15994
2014-09-10 03:20:40 +00:00
Patrick Walton
1bce8698cd 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]
2014-09-09 19:24:06 -07:00
Brian Anderson
7864243380 Prefer lualatex, xelatex, pdflatex, in that order. #12804 2014-09-09 18:07:53 -07:00
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
Steve Klabnik
8ddb9c71c3 Add section about Str trait 2014-09-09 18:48:30 -04:00
Steve Klabnik
c8e5068ec9 Be explicit with rustdoc.
I missed some annotations, and some were in a different style.
2014-09-09 18:42:05 -04:00
Niko Matsakis
c4d56b7ee7 Avoid ever constructing cyclic types in the first place, rather than detecting them in resolve. This simplifies logic elsewhere in the compiler. cc #5527 2014-09-09 18:33:07 -04:00
P1start
bf274bc18b 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);
2014-09-10 10:25:12 +12:00
Brian Anderson
5206e79b92 Fix naming of windows installer 2014-09-09 13:33:29 -07:00
Brian Anderson
3ebf25ee80 Fix snapshot.py for win64 2014-09-09 13:29:55 -07: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
Brian Anderson
cd1fabe55e Add links to forums in README.md, including discuss.rust-lang.org 2014-09-09 13:08:14 -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
Daniel Micay
9639cafd36 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
2014-09-09 15:14:36 -04: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
Stuart Pernsteiner
ba43f7bc8c ignore uninitialized submodules when checking if ./configure should be re-run 2014-09-09 11:33:53 -07:00
Jakub Wieczorek
28bc56828f Change method lookup to require invariance for mutable references
Fixes #17033.
Fixes #15965.
2014-09-09 20:25:31 +02: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