Commit Graph

30096 Commits

Author SHA1 Message Date
bors
82ec1aef29 auto merge of #14963 : w3ln4/rust/master, r=alexcrichton
The aim of these changes is not working out a generic bi-endianness architectures support but to allow people develop for little endian MIPS machines (issue #7190).
2014-06-24 13:46:54 +00:00
Tom Jakubowski
0af4985332 librustc: Remove outdated reference to ~ and @
Fix #15052
2014-06-24 05:02:53 -07:00
bors
71fe44def9 auto merge of #15113 : pnkfelix/rust/fsk-add-regression-test-for-ice-from-10846, r=alexcrichton
Includes a bit more comments than usual for a regression test; I felt like documenting Niko's diagnosis of the original problem here. 

Fix #15111 

r? anyone.
2014-06-24 12:01:50 +00:00
bors
58bf8b2155 auto merge of #15107 : ipetkov/rust/tutorial-update, r=alexcrichton 2014-06-24 10:16:49 +00:00
Pawel Olzacki
34a384a128 Added Mipsel architecture support 2014-06-24 11:12:10 +02:00
bors
d9611da4e6 auto merge of #15066 : pcwalton/rust/lang-and-intrinsic-feature-gate, r=alexcrichton
If you define lang items in your crate, add `#[feature(lang_items)]`.

If you define intrinsics (`extern "rust-intrinsic"`), add
`#[feature(intrinsics)]`.

Closes #12858.

[breaking-change]

r? @brson
2014-06-24 07:56:51 +00:00
Patrick Walton
5466d13d43 librustc: Feature gate lang items and intrinsics.
If you define lang items in your crate, add `#[feature(lang_items)]`.

If you define intrinsics (`extern "rust-intrinsic"`), add
`#[feature(intrinsics)]`.

Closes #12858.

[breaking-change]
2014-06-23 23:28:28 -07:00
bors
e8c12d32a2 auto merge of #15079 : nikomatsakis/rust/issue-5527-unify-refactor, r=pnkfelix
This is just a cleanup of the code. Doesn't really change anything deep about the way we operate. This is a prelude to implementing a good solution for one-way matching for #5527.

r? @pnkfelix (we were just crawling about this code, after all)
2014-06-24 06:06:52 +00:00
bors
7689213713 auto merge of #14952 : alexcrichton/rust/const-unsafe-pointers, r=brson
This does not yet change the compiler and libraries from `*T` to `*const T` as
it will require a snapshot to do so.

cc #7362

---

Note that the corresponding RFC, https://github.com/rust-lang/rfcs/pull/68, has not yet been accepted. It was [discussed at the last meeting](https://github.com/rust-lang/rust/wiki/Meeting-weekly-2014-06-10#rfc-pr-68-unsafe-pointers-rename-t-to-const-t) and decided to be accepted, however. I figured I'd get started on the preliminary work for the RFC that will be required regardless.
2014-06-24 04:16:53 +00:00
bors
10b12bc123 auto merge of #15105 : alexcrichton/rust/snapshots, r=luqmana 2014-06-24 02:31:55 +00:00
bors
e07cec6f9a auto merge of #14885 : pcwalton/rust/struct-literal-tightening, r=alexcrichton
`for...in`.

Closes #14803.

If you used a structure literal after one of these keywords, surround it
in parentheses.

[breaking-change]

r? @nick29581
2014-06-24 00:36:54 +00:00
Patrick Walton
654d6444fe libsyntax: Disallow struct literals after if, while, match, and
`for...in`.

Closes #14803.

If you used a structure literal after one of these keywords, surround it
in parentheses.

[breaking-change]
2014-06-23 15:39:29 -07:00
Ivan Petkov
39efe3c82b Docs: tutorial: Remove a couple references to ~T 2014-06-23 14:51:03 -07:00
bors
d6c1b85246 auto merge of #14974 : Ryman/rust/non_trait_method, r=alexcrichton
Closes #3973.
2014-06-23 21:46:46 +00:00
Kevin Butler
ab24d29f0d rustc: catch impl X for Y where X is not a trait in resolve. 2014-06-23 17:38:32 +01:00
Kevin Butler
579a139215 rustc: catch non-trait methods before typeck.
Closes #3973.
2014-06-23 17:38:32 +01:00
bors
575710f6ce auto merge of #15106 : Sawyer47/rust/rm-duplicated-tests, r=alexcrichton
Even if they used to test different things in the past, they are
now identical to other files.

Closes #11496
2014-06-23 16:16:37 +00:00
Stepan Koltsov
85467b6b41 Allow trailing comma in concat!
(And in other extensions implemented with `get_exprs_from_tts` function).
2014-06-23 15:51:40 +00:00
bors
d77cb22bb6 auto merge of #15100 : rapha/rust/master, r=alexcrichton
/usr/bin/env appears to be more portable.
2014-06-23 14:31:39 +00:00
bors
baa72085f4 auto merge of #15098 : ben0x539/rust/nullary-tuple-struct, r=pcwalton
Reject `struct Foo();` to fix #15095.
2014-06-23 12:46:33 +00:00
Felix S. Klock II
7be2019428 Add regression test for ICE from issue 10846. 2014-06-23 14:17:18 +02:00
Benjamin Herr
17108207b1 test: readd TMPDIR to LD_LIBRARY_PATH for run-make
It was accidentally removed in #15006 and that somehow got past the
build bots, causing `src/test/run-make/c-dynamic-dylib` to fail on at
least my linux system.

This resolves #15103 (thanks to @alexcrichton!).
2014-06-23 13:12:37 +02:00
bors
4362db0d68 auto merge of #15089 : tomjakubowski/rust/rustdoc-default-typarams-12291, r=alexcrichton
fix #12291
2014-06-23 11:01:36 +00:00
bors
9a583bb931 auto merge of #15086 : jakub-/rust/xc-struct-variants-match, r=alexcrichton
Turns out field names of struct variants are not encoded in crate metadata.
2014-06-23 09:16:36 +00:00
bors
1efc02a9ec auto merge of #15083 : edwardw/rust/destructure-trait-ref, r=pcwalton
Closes #15031.
2014-06-23 07:26:37 +00:00
bors
c6f86e41a1 auto merge of #15061 : pnkfelix/rust/fsk-fix-issue-10846, r=nikomatsakis
In other words, Late-bound regions that occur non-free should be
skipped.

Fix #10846 (specifically the ICE, not the weakness in the current type inference).
2014-06-23 04:31:35 +00:00
Alex Crichton
70d4b50071 Register new snapshots 2014-06-22 21:16:11 -07:00
bors
5971193332 auto merge of #15097 : tomjakubowski/rust/fix-feature-gate-docs, r=sfackler
See http://static.rust-lang.org/doc/master/rustc/front/feature_gate/index.html for the problem this fixes.
2014-06-23 02:21:37 +00:00
bors
1c7b780787 auto merge of #15068 : erickt/rust/mem-inline, r=pcwalton
This is a couple micro-optimizations I've been sitting on for a while. This inlines a couple functions that are important to the `std::io::mem`. Ultimately, this results in about a 15% performance increase in some micro-benchmarks for my [libserialize](https://github.com/erickt/rust-serde) rewrite.
2014-06-23 00:11:39 +00:00
Raphael Speyer
53ec4a6732 Change /bin/env to /usr/bin/env in helper python script, as it is more portable 2014-06-23 09:17:40 +10:00
bors
ca3e557ee8 auto merge of #15081 : jakub-/rust/issue-15080, r=alexcrichton
Fixes #15080.
2014-06-22 21:31:39 +00:00
bors
34bd169171 auto merge of #15091 : nikomatsakis/rust/issue-5527-rename-types, r=pcwalton
Some cleanups I'm sick of rebasing.

r? @pcwalton (do you agree with new names?)
2014-06-22 18:41:41 +00:00
Benjamin Herr
ff50ce9a1b libsyntax: don't allow enum structs with no fields
Unit-like structs are written as `struct Foo;`, but we erroneously
accepted `struct Foo();` and took it to mean the same thing. Now we
don't, so use the `struct Foo;` form!

[breaking-change]
2014-06-22 20:21:11 +02:00
Tom Jakubowski
ffcc443098 librustc: Fix poorly formatted doc in feature_gate
The #![feature(...)] line had been rendering in the docs as a header
because of Markdown syntax.
2014-06-22 10:29:42 -07:00
bors
c9f3c68961 auto merge of #15088 : Sawyer47/rust/detotal, r=alexcrichton
There were still Total{Ord,Eq} in docs and src/etc
2014-06-22 15:16:39 +00:00
Niko Matsakis
8a4bb8a576 Rename ty_param_bounds_and_ty to Polytype 2014-06-22 10:25:11 -04:00
Niko Matsakis
7ead6bed48 Rename and move ty_param_substs_and_ty 2014-06-22 10:25:11 -04:00
Piotr Jawniak
37b8ce0064 Remove duplicated test files
Even if they used to test different things in the past, they are
now identical to other files.

Closes #11496
2014-06-22 15:55:27 +02:00
Niko Matsakis
020373f2c8 Refactor the unification code and rejuvenate the unit test
infrastructure that has been accidentally left out of the build
for a rather long time (it was still using `@DVec`!)
2014-06-22 09:54:42 -04:00
Piotr Jawniak
0b9e4fcaff Update few files after comparison traits renaming
There were still Total{Ord,Eq} in docs and src/etc
2014-06-22 09:31:39 +02:00
Felix S. Klock II
36caa7a729 RegionFolder should only invoke callback on free regions.
In other words, Late-bound regions that occur non-free should be
skipped.

Fix #10846.
2014-06-22 06:19:56 +02:00
bors
4c39962d32 auto merge of #15005 : dotdash/rust/i1_bool, r=alexcrichton
We currently compiled bools to i8 values, because there was a bug in
LLVM that sometimes caused miscompilations when using i1 in, for
example, structs.

Using i8 means a lot of unnecessary zero-extend and truncate operations
though, since we have to convert the value from and to i1 when using for
example icmp or br instructions. Besides the unnecessary overhead caused
by this, it also sometimes made LLVM miss some optimizations.

First, we have to fix some bugs concerning the handling of
attributes in foreign function declarations and calls. These
are required because the i1 type needs the ZExt attribute when
used as a function parameter or return type.

Then we have to update LLVM to get a bugfix without which LLVM
sometimes generates broken code when using i1.

And then, finally, we can switch bools over to i1.
2014-06-22 00:01:34 +00:00
Jakub Wieczorek
26e692dd39 Fix spurious non-exhaustive errors for cross-crate struct variants 2014-06-21 23:54:48 +02:00
Erick Tryzelaar
b9aeda4802 collections: fix running make check-stage1-collections 2014-06-21 17:42:22 -04:00
Erick Tryzelaar
0f39dc7b78 std: inline many of the Writer/Reader methods
This allows llvm to optimize away much of the overhead from using
the MemReader/MemWriters. My benchmarks showed it to shave 15% off
of my in progress serialization/json encoding.
2014-06-21 17:42:22 -04:00
Erick Tryzelaar
76371d1ff1 serialize: Simplify the json docs 2014-06-21 17:42:22 -04:00
Erick Tryzelaar
b0fb520f72 std: micro-optimize Vec constructors and add benchmarks
Generally speaking, inlining doesn't really help out with
constructing vectors, except for when we construct a zero-sized
vector. This patch allows llvm to optimize this case away in
a lot of cases, which shaves off 4-8ns. It's not much, but it
might help in some inner loop somewhere.

before:

running 12 tests
test bench_extend_0          ... bench:       123 ns/iter (+/- 6)
test bench_extend_5          ... bench:       323 ns/iter (+/- 11)
test bench_from_fn_0         ... bench:         7 ns/iter (+/- 0)
test bench_from_fn_5         ... bench:        49 ns/iter (+/- 6)
test bench_from_iter_0       ... bench:        11 ns/iter (+/- 0)
test bench_from_iter_5       ... bench:       176 ns/iter (+/- 11)
test bench_from_slice_0      ... bench:         8 ns/iter (+/- 1)
test bench_from_slice_5      ... bench:        73 ns/iter (+/- 5)
test bench_new               ... bench:         0 ns/iter (+/- 0)
test bench_with_capacity_0   ... bench:         6 ns/iter (+/- 1)
test bench_with_capacity_100 ... bench:        41 ns/iter (+/- 3)
test bench_with_capacity_5   ... bench:        40 ns/iter (+/- 2)

after:

test bench_extend_0          ... bench:       123 ns/iter (+/- 7)
test bench_extend_5          ... bench:       339 ns/iter (+/- 27)
test bench_from_fn_0         ... bench:         7 ns/iter (+/- 0)
test bench_from_fn_5         ... bench:        54 ns/iter (+/- 4)
test bench_from_iter_0       ... bench:        11 ns/iter (+/- 1)
test bench_from_iter_5       ... bench:       182 ns/iter (+/- 16)
test bench_from_slice_0      ... bench:         4 ns/iter (+/- 0)
test bench_from_slice_5      ... bench:        62 ns/iter (+/- 3)
test bench_new               ... bench:         0 ns/iter (+/- 0)
test bench_with_capacity_0   ... bench:         0 ns/iter (+/- 0)
test bench_with_capacity_100 ... bench:        41 ns/iter (+/- 1)
test bench_with_capacity_5   ... bench:        41 ns/iter (+/- 3)
2014-06-21 17:42:22 -04:00
Edward Wang
f87bc6a5d1 Make destructuring trait reference work
Closes #15031.
2014-06-22 04:03:15 +08:00
Jakub Wieczorek
d4da4ba4b2 Fix a #14731 regression in missing_constructor() for vector patterns
Fixes #15080.
2014-06-21 20:36:17 +02:00
Björn Steinbrink
d747de5a92 Compile bools to i1
We currently compiled bools to i8 values, because there was a bug in
LLVM that sometimes caused miscompilations when using i1 in, for
example, structs.

Using i8 means a lot of unnecessary zero-extend and truncate operations
though, since we have to convert the value from and to i1 when using for
example icmp or br instructions. Besides the unnecessary overhead caused
by this, it also sometimes made LLVM miss some optimizations.

Fixes #8106.
2014-06-21 19:59:58 +02:00