Commit Graph

36817 Commits

Author SHA1 Message Date
bors
3d5a102007 Merge pull request #20415 from eddyb/unify-expected-return
rustc_typeck: unify expected return types with formal return types to propagate coercions through calls of generic functions.

Reviewed-by: nikomatsakis
2015-01-12 00:21:22 +00:00
bors
e7b397b02e auto merge of #20935 : dotdash/rust/cpu_x86-64, r=luqmana
Using "generic" disables a number of features that are present on all
x86_64 cpus, the "x86-64" target cpu is the common denominator for that
arch.

Refs #20777
2015-01-11 22:15:52 +00:00
Eduard Burtescu
474872160a tests: update some compile-fail tests for the new behavior of type expectations. 2015-01-11 22:09:46 +02:00
Eduard Burtescu
e73fbc69cd rustc_typeck: unify expected return types with formal return types to propagate coercions through calls of generic functions. 2015-01-11 22:09:46 +02:00
Eduard Burtescu
21ec0c85d9 rustc_typeck: don't use double indirection to Expr's in check_argument_types. 2015-01-11 22:09:45 +02:00
Eduard Burtescu
2c76710ece rustc_typeck: make Expectation more composable by replacing map and map_to_option with to_option. 2015-01-11 22:09:45 +02:00
bors
32ddbb82e0 auto merge of #20406 : TimDumol/rust/dlist-append-split-off, r=Gankro
Implements the `append()` and `split_off()` methods proposed by the collections reform part 2 RFC.

RFC: https://github.com/rust-lang/rfcs/pull/509
Tracking issue: https://github.com/rust-lang/rust/issues/19986
2015-01-11 18:50:46 +00:00
bors
2e4cef4e78 auto merge of #20910 : sfackler/rust/show-impls, r=alexcrichton
A derived implementation would not be appropriate for the Buffered types
since the buffer is both huge (64k by default) and full of uninitialized
memory. Instead of printing the whole thing, we display how full it is.

I also altered `MultiWriter` to make it generic over Writers instead of
taking `Box<Writer>` trait objects. `Box<Writer>` implements `Writer` so
existing use cases should continue to work, and this enables a more
useful Show implementation in applicable cases.

The change to `MultiWriter` may break code that uses it, but any fixes
should be easy.

[breaking-change]

r? @alexcrichton
2015-01-11 16:45:48 +00:00
bors
2127e0d56d auto merge of #20865 : killercup/rust/patch-3, r=alexcrichton
This adds an early return to skip code blocks without IDs.

Fixes #20864.
2015-01-11 14:35:46 +00:00
bors
9d2e9b9be6 auto merge of #20859 : mahkoh/rust/as_mut_vec, r=nikomatsakis
Closes #20822
2015-01-11 12:15:46 +00:00
Björn Steinbrink
14b6c6d153 Default to "x86-64" as the target cpu for x86_64 builds
Using "generic" disables a number of features that are present on all
x86_64 cpus, the "x86-64" target cpu is the common denominator for that
arch.

Refs #20777
2015-01-11 12:26:54 +01:00
bors
71a71ce4f9 auto merge of #20925 : alexcrichton/rust/more-flaky-test, r=sfackler
I saw these hanging on a windows bot, and the previous ones seem to have calmed
down after switching from Thread::spawn to Thread::scoped, so try that here as
well!
2015-01-11 09:01:00 +00:00
Alex Crichton
b8304e5404 test: Use Thread::scoped in two more tests
I saw these hanging on a windows bot, and the previous ones seem to have calmed
down after switching from Thread::spawn to Thread::scoped, so try that here as
well!
2015-01-10 22:56:01 -08:00
bors
d2d35db570 auto merge of #20755 : dotdash/rust/fca, r=Aatch
Currently, small aggregates are passed to functions as immediate values
as is. This has two consequences.
    
One is that aggregates are passed component-wise by LLVM, so e.g. a
struct containing four u8 values (e.g. an RGBA struct) will be passed as
four individual values.
    
The other is that LLVM isn't very good at optimizing loads/stores of
first class attributes. What clang does is converting the aggregate to
an appropriately sized integer type (e.g. i32 for the four u8 values),
and using that for the function argument. This allows LLVM to create
code that is a lot better.
    
Fixes #20450 #20149 #16506 #13927
2015-01-11 06:55:33 +00:00
Steven Fackler
b4fae2fba9 Implement Show for types in std::io::{buffered,util}
A derived implementation would not be appropriate for the Buffered types
since the buffer is both huge (64k by default) and full of uninitialized
memory. Instead of printing the whole thing, we display how full it is.

I also altered MultiWriter to make it generic over Writers instead of
taking Box<Writer> trait objects. Box<Writer> implements Writer so
existing use cases should continue to work, and this enables a more
useful Show implementation in applicable cases.

The change to MultiWriter may break code that uses it, but any fixes
should be easy.

[breaking-change]
2015-01-10 17:32:54 -08:00
Björn Steinbrink
6f1b06eb65 Pass small fixed-size arrays as immediates
Currently even small fixed-size arrays are passed as indirect
parameters, which seems to be just an oversight. Let's handle them the
same as structs of the same size, passing them as immediate values.
2015-01-11 01:44:03 +01:00
Björn Steinbrink
6ef08406dc Avoid loads/stores of first class aggregates
Currently, small aggregates are passed to functions as immediate values
as is. This has two consequences.

One is that aggregates are passed component-wise by LLVM, so e.g. a
struct containing four u8 values (e.g. an RGBA struct) will be passed as
four individual values.

The other is that LLVM isn't very good at optimizing loads/stores of
first class attributes. What clang does is converting the aggregate to
an appropriately sized integer type (e.g. i32 for the four u8 values),
and using that for the function argument. This allows LLVM to create
code that is a lot better.

Fixes #20450 #20149 #16506 #13927
2015-01-11 01:44:02 +01:00
bors
431105a70a Merge pull request #20887 from TeXitoi/improve-shootout-binarytrees
Improvement of shootout-binarytrees.rs

Reviewed-by: alexcrichton
2015-01-10 23:40:20 +00:00
Guillaume Pinot
629bcdd873 Improvement of shootout-binarytrees.rs
Part of #18085

Instead of using an Enum, we use a struct with Option<&Tree> as leaves. It allow
to limit a lot of allocation.

before:
```
texitoi@vaio:~/dev/benchmarksgame-rs$ time ./bin/binary-trees-orig 20
stretch tree of depth 21	 check: -1
2097152	 trees of depth 4	 check: -2097152
524288	 trees of depth 6	 check: -524288
131072	 trees of depth 8	 check: -131072
32768	 trees of depth 10	 check: -32768
8192	 trees of depth 12	 check: -8192
2048	 trees of depth 14	 check: -2048
512	 trees of depth 16	 check: -512
128	 trees of depth 18	 check: -128
32	 trees of depth 20	 check: -32
long lived tree of depth 20	 check: -1

real	0m3.860s
user	0m11.032s
sys	0m3.572s
```
after:
```
texitoi@vaio:~/dev/benchmarksgame-rs$ time ./bin/binary-trees 20
stretch tree of depth 21	 check: -1
2097152	 trees of depth 4	 check: -2097152
524288	 trees of depth 6	 check: -524288
131072	 trees of depth 8	 check: -131072
32768	 trees of depth 10	 check: -32768
8192	 trees of depth 12	 check: -8192
2048	 trees of depth 14	 check: -2048
512	 trees of depth 16	 check: -512
128	 trees of depth 18	 check: -128
32	 trees of depth 20	 check: -32
long lived tree of depth 20	 check: -1

real	0m2.824s
user	0m9.224s
sys	0m1.428s
```
2015-01-10 20:19:54 +01:00
bors
099b411e08 auto merge of #20869 : nikomatsakis/rust/issue-18875, r=huonw
Feature-gate `<>` syntax used with `Fn`. Fixes #18875.

r? @huonw
2015-01-10 16:20:04 +00:00
Julian Orth
a03ae681d3 add inline to every String function 2015-01-10 16:37:27 +01:00
bors
3b03c20c6d Merge pull request #20851 from englishm/patch-1
Docs: Should be `assert_eq!` not `assert_eq`

Reviewed-by: sfackler
2015-01-10 14:15:12 +00:00
bors
52e5ae786d Merge pull request #20849 from scode/scode/fix-book-typo
Fix typo in documentation.

Reviewed-by: sfackler
2015-01-10 14:15:12 +00:00
bors
1ca581d440 Merge pull request #20833 from nstoddard/master
Fix a couple wording issues in TRPL book

Reviewed-by: Gankro
2015-01-10 14:15:11 +00:00
bors
507d9575bd Merge pull request #20819 from GuillaumeGomez/master
Fixes typo

Reviewed-by: alexcrichton
2015-01-10 14:15:11 +00:00
bors
2bb9b3f0be Merge pull request #20818 from rgs1/fix-guide
Remove extra dangling period

Reviewed-by: alexcrichton
2015-01-10 14:15:10 +00:00
bors
e912f13a94 Merge pull request #20817 from killercup/patch-2
Update Conclusion of The Rust Programming Language

Reviewed-by: steveklabnik
2015-01-10 14:15:10 +00:00
bors
ac0c2fb5f1 Merge pull request #20808 from Manishearth/span_fix
Fix checking of command line expansion spans

Reviewed-by: alexcrichton
2015-01-10 14:15:09 +00:00
bors
c0ca57a6fb Merge pull request #20771 from Kimundi/vec-macro-repeat
Enabled the `vec![]` macro to use the `[a; b]` repeat syntax.

Reviewed-by: alexcrichton
2015-01-10 14:15:09 +00:00
Niko Matsakis
152d623877 Feature-gate <> syntax used with Fn. Fixes #18875. 2015-01-10 09:12:25 -05:00
bors
a09b139f9c auto merge of #20839 : alexcrichton/rust/missing-stability, r=aturon
Both `Extend::extend` and `DoubleEndedIterator::next_back` were intended to be
stable, but they mistakenly didn't have the `#[stable]` tag.
2015-01-10 12:10:08 +00:00
Pascal Hertleif
89ca858bb5 Fix playpen.js errors on pres without IDs
This adds an early return to skip code blocks without IDs.

Fixes #20864.
2015-01-10 11:55:48 +01:00
bors
3975af567a auto merge of #20837 : huonw/rust/remove-unused-lifetime, r=nikomatsakis 2015-01-10 10:05:05 +00:00
bors
d36dc15952 auto merge of #20794 : sfackler/rust/trailing-attrs, r=alexcrichton
Closes #20711
2015-01-10 08:00:09 +00:00
Mike English
68ecfe0b61 Should be assert_eq! not assert_eq 2015-01-10 01:52:51 -05:00
Peter Schuller
d873aeeb92 Fix typo in documentation. 2015-01-09 22:35:18 -08:00
bors
391e0106ef auto merge of #20802 : huonw/rust/book-css, r=steveklabnik
There is likely to be new users with the alpha release, and there are a lot of documents on the internet (StackOverflow, reddit, blogs) that refer to these guides, so emitting a more helpful error than "404" is nice. Hence, I've temporarily reinstated stub documents for each of the old guides, referring to as relevant a part of the book as possible.

Also, rustbook was silently ignoring some errors, which lead to an inconsistency with directory creation/file writing. This meant the CSS file was not being written if no `doc` directory existed in the users build dir (e.g. the buildbots). This should mean that the CSS will appear automatically in later builds.
2015-01-10 05:55:07 +00:00
bors
9205d74fe0 auto merge of #20782 : iKevinY/rust/trpl-formatting, r=steveklabnik
Here's my PR for the changes discussed in #19823. I decided to leave `_these_` types of italics the way there were because it differentiates the use of italics for emphasis from `*key term*` italics. Otherwise, bolded terms have been changed to italics, and single and double quotes have been changed appropriately, depending on their context (my judgement may not be the best, though).

r? @steveklabnik (congratulations on #19897 being finalized and merged, by the way!)
2015-01-10 03:45:11 +00:00
bors
14f9d1f256 auto merge of #20828 : alexcrichton/rust/issue-20823, r=brson
This will temporarily prevent warnings generated from expanding to code that the
test harness itself uses. This solution will require tweaking around the beta
cycle, but it will prevent spurious warnings for now.

Closes #20823
2015-01-10 00:55:12 +00:00
Huon Wilson
719c5d7bde core: rm unused lifetime. 2015-01-10 11:31:53 +11:00
Alex Crichton
ccb1e460dc std: Mark two missing functions as #[stable]
Both `Extend::extend` and `DoubleEndedIterator::next_back` were intended to be
stable, but they mistakenly didn't have the `#[stable]` tag.
2015-01-09 15:49:09 -08:00
Nathan Stoddard
2a29296ea3 Fix a couple wording issues in trpl book 2015-01-09 17:21:30 -05:00
bors
c133b2110b auto merge of #20776 : kmcallister/rust/macro-cleanup, r=alexcrichton
r? @alexcrichton. This passes tests for me.
2015-01-09 22:15:12 +00:00
Alex Crichton
9cc847d8c3 syntax: Add #[allow(unstable)] to --test expansion
This will temporarily prevent warnings generated from expanding to code that the
test harness itself uses. This solution will require tweaking around the beta
cycle, but it will prevent spurious warnings for now.

Closes #20823
2015-01-09 13:26:21 -08:00
bors
73a25f55ad auto merge of #20815 : brson/rust/installer, r=alexcrichton 2015-01-09 20:10:07 +00:00
Guillaume Gomez
ba462b88e9 Update advanced.md 2015-01-09 20:08:30 +01:00
Keegan McAllister
a96a8b2b25 Update macro scope intro 2015-01-09 11:06:17 -08:00
Keegan McAllister
128e7ff53b Re-reduce libstd macro duplication
The libstd definitions move to libcore, which causes some minor updates there.
2015-01-09 11:06:17 -08:00
Raul Gutierrez S
28723048a5 Remove extra dangling period
Signed-off-by: Raul Gutierrez S <rgs@itevenworks.net>
2015-01-09 10:54:00 -08:00
Pascal Hertleif
1a602c1779 Update Conclusion of The Rust Programming Language
This replaces a obsolete conclusion (based on the original, basic Guide) with
links to further documentation sources.
2015-01-09 19:48:27 +01:00