Commit Graph

37144 Commits

Author SHA1 Message Date
Niko Matsakis
2b8678cf5d Give where clauses priority over builtin rules. Fixes #20959. 2015-01-11 14:52:37 -05:00
Steven Fackler
8b6cda3ce6 Rename AtomicInt and AtomicUint
Change any use of AtomicInt to AtomicIsize and AtomicUint to AtomicUsize

Closes #20893

[breaking-change]
2015-01-11 11:47:44 -08:00
Matt Roche
c989bd4ab7 replace deprecated uint references with u32
Replaced uint references with u32 to prevent compiler warnings.
2015-01-11 13:55:23 -05:00
Niko Matsakis
06e798a881 Normalize the types of fields we project out of a struct or tuple struct.
Fixes #20954.
2015-01-11 13:54:23 -05: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
Manish Goregaokar
ad7e33efee Feature gate #[rustc_on_unimplemented] 2015-01-12 00:00:53 +05:30
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
Erick Rivas
217cb6f131 Merge remote-tracking branch 'rust/master' 2015-01-11 10:43:49 -06:00
Erick Rivas
84813d3fbc Merge branch 'master' of git://github.com/rust-lang/rust into rust 2015-01-11 10:40:16 -06:00
Manish Goregaokar
dd074ab4ee Rename #[on_unimplemented] -> #[rustc_on_unimplemented] 2015-01-11 20:52:43 +05:30
Tim Brooks
4c78d28344 Remove range function 2015-01-11 14:37:24 +00:00
Tim Brooks
ed13698317 Remove old number literal suffixes from Vim syntax 2015-01-11 14:36:55 +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
Brian Anderson
740c837e89 std: Remove fortune cookies from fatal runtime errors
Closes #13871
2015-01-11 05:50:52 -08:00
Simonas Kazlauskas
348d833187 Allow any integral to be used as Shr and Shl RHS
This is only relevant to the code that uses generics such as

    fn magic<T: Shl>(a: T) { a << 10u8; }

Fixes #20288
2015-01-11 15:34:53 +02:00
Manish Goregaokar
add20bbb6d Move error to typeck::check 2015-01-11 18:17:51 +05:30
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
Manish Goregaokar
e183277948 Make errors allow for cross-crate issues 2015-01-11 16:41:02 +05:30
Barosl Lee
a0155444cf Permit node types to be missing if type errors occurred previously
If the type of a node cannot be determined due to a previous type error,
a "no type for node" ICE occurs. This commit makes it return ty_err
instead in such a case.

Fixes #20401.
Fixes #20506.
Fixes #20614.
Fixes #20752.
Fixes #20829.
Fixes #20846.
Fixes #20885.
Fixes #20886.
2015-01-11 19:42:18 +09:00
Tom Jakubowski
6f45cb493e Escape a leading # in a doc comment
rustdoc was rendering this as a header
2015-01-11 02:34:55 -08: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
NAKASHIMA, Makoto
add9225038 cargo build doesn't run the executables 2015-01-11 17:40:42 +09:00
Erick Rivas
8e42f1e6c3 Switching out range(0,10) example to 0..10. Tests fine 2015-01-11 02:15:29 -06: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
Carter Hinsley
da15417b9d Correct romanization of さようなら 2015-01-11 01:53:34 -05:00
Manish Goregaokar
dc0de42035 Add lint and test for malformed but unused #[on_unimplemented] attributes 2015-01-11 09:51:09 +05:30
Manish Goregaokar
4d17fbaf37 Add ability to attach custom #[on_unimplemented] error messages for unimplemented traits (fixes #20783) 2015-01-11 09:49:02 +05:30
Clifford Caoile
0568464d36 Give mmap a page-aligned stack start address 2015-01-11 12:56:04 +09:00
Chase Southwood
c05338793b Add ExactSizeIterator impls for Hash{Map, Set, Table}
This commit also changes the return types of all `size_hint()` impls
in these files from (uint, Option<uint>) to (usize, Option<usize>).
2015-01-10 20:07:42 -06: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
Akos Kiss
6c9bdf2a11 Fix: GNU AArch64 assembler does not like @plt symbol suffix 2015-01-11 00:40:26 +00:00
Nathaniel Theis
514497e347 Fix dead link (s/task/thread/) 2015-01-11 00:12:00 +00:00
Steven Crockett
e7e308f447 reference: Made a number of small gramatical fixes changes for correctness/consistency. Small updates to text and code where the language has since changed. 2015-01-10 23:58:38 +00: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
8af47508e9 fix shootout-threadring.rs
Without joining the threads, the program can finish before the end of the trip
of the token.
2015-01-11 00:10:26 +01:00
Sebastian Rasmussen
64b1a0da98 Cosmetic updates to TRPL text
* Make messages match rustc's error messages
* Use correct function name in example
* Rewording to match previously presented material
2015-01-10 23:11:26 +01:00
Duncan Regan
c871773f32 Updates fixed-size suffix
Compiler gives the following warning:
`warning: the `u` suffix on integers is deprecated; use `us` or one of the fixed-sized suffixes`
And also the errror:
`error: mismatched types: expected `u64`, found `usize` (expected u64, found usize)`

Changing the suffix to `u64` results in a successful `cargo run` outputting the desired `Versions compared successfully!`
2015-01-10 16:19:11 -05: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
Armin Preiml
e4a2de7ed1 Update 7.2.9 Array expressions 2015-01-10 19:08:07 +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
Pascal Hertleif
6ff5ab1d01 Add Line Break to Robert Burns Quote 2015-01-10 15:47:52 +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