Commit Graph

18031 Commits

Author SHA1 Message Date
bors
1bf2f68bb2 auto merge of #6437 : Thiez/rust/atomic, r=Aatch
This pull request adds 4 atomic intrinsics to the compiler, in preparation for #5042.

* `atomic_load(src: &int) -> int` performs an atomic sequentially consistent load.
* `atomic_load_acq(src: &int) -> int` performs an atomic acquiring load.
* `atomic_store(dst: &mut int, val: int)` performs an atomic sequentially consistent store.
* `atomic_store_rel(dst: &mut int, val: int)` performs an atomic releasing store.

For more information about the whole acquire/release thing: http://llvm.org/docs/Atomics.html

r?
2013-05-13 05:04:41 -07:00
Matthijs Hofstra
852af346d3 Tidy 2013-05-13 13:33:34 +02:00
bors
2774392b41 auto merge of #6448 : huonw/rust/deriving-doc, r=Aatch
Closes #4916.
2013-05-13 04:10:44 -07:00
Corey Richardson
2210d2d5d5 Use backticks to delineate paths/identifiers 2013-05-13 06:22:32 -04:00
Huon Wilson
d43908a3a7 doc: document the #[deriving] attribute.
Closes #4916.
2013-05-13 20:04:03 +10:00
bors
8d4a3d58b7 auto merge of #6447 : luqmana/rust/6446, r=thestinger
#6446
2013-05-13 01:25:43 -07:00
Luqman Aden
103a68b2e7 Correct #[always_inline] -> #[inline(always)] and __attribute((...)) -> __attribute__((...)). 2013-05-13 04:05:34 -04:00
Corey Richardson
be82449a9a Better error for some unresolved imports
When trying to import nonexistent items from existing modules, specify that
that is what happened, rather than just reporting "unresolved name".
2013-05-13 01:06:42 -04:00
bors
8a5561bc18 auto merge of #6438 : alexcrichton/rust/issue-5387, r=thestinger
Instead link against the built libraries and directly invoke those.

Closes #5387
2013-05-12 21:58:39 -07:00
Youngmin Yoo
1d1c502dd4 Add vec.rs each2_mut testsuite 2013-05-13 13:55:09 +09:00
Youngmin Yoo
943b9d5dd9 Add vec.rs each2_mut function 2013-05-13 13:55:09 +09:00
bors
8291e36f18 auto merge of #6400 : cmr/rust/remove_useless_import_error, r=thestinger
Every unresolved import is reported. An additional error message isn't useful
and obscures (imo) the real errors: I need to take it into account when
looking at the error count.
2013-05-12 20:22:40 -07:00
Corey Richardson
e605536648 actually fix failing test 2013-05-12 22:52:38 -04:00
Patrick Walton
58a37a1f48 libstd: Fix merge fallout. 2013-05-12 17:36:53 -07:00
Patrick Walton
db0693ac8d libsyntax: Tighten up expressions in patterns to only allow identifiers or literals (possibly with a minus).
This had very minimal fallout.
2013-05-12 16:35:19 -07:00
Patrick Walton
5d3559e645 librustc: Make self and static into keywords 2013-05-12 16:35:18 -07:00
Patrick Walton
06ef889cdc libsyntax: Remove extern mod foo { ... } from the language. 2013-05-12 16:33:15 -07:00
bors
8d1a09c810 auto merge of #6348 : sstewartgallus/rust/incoming, r=brson
In this commit I added a useful utility type, named Void, that encapsulates the
doable but annoying job of creating an uninhabited type. As well, a function on
that type, named absurd, was created which is useful for ignoring the result of
matching on that type. No unit tests were created because it is not possible to
create an instance of this type to test the usage of.

This type is useful because it is like NonCopyable in that it can be used to
create a type with special characteristics without special bloat. For instance,
instead of typing pub struct PhantomType { priv contents : () } for each void
type one may want to use one can simply type pub struct PhantomType (Void);.
This type make such special cases much easier to write.
2013-05-12 16:07:40 -07:00
Matthijs Hofstra
fa1a172f9c Removed unnecessary check from build.rs 2013-05-13 00:12:14 +02:00
bors
830b945a9d auto merge of #6439 : bjz/rust/float-classify, r=brson 2013-05-12 15:07:42 -07:00
Brendan Zabarauskas
4f8084a363 Make Float::classify matching more clear for f64 and f32 2013-05-13 07:57:27 +10:00
Alex Crichton
2a9a4a81e1 Don't create subprocesses for the rust command
Instead link against the built libraries and directly invoke those.
2013-05-12 17:48:01 -04:00
Matthijs Hofstra
a9f2132606 Adds atomic_load, atomic_load_acq, atomic_store, and atomic_store_rel intrinsics.
The default versions (atomic_load and atomic_store) are sequentially consistent.
The atomic_load_acq intrinsic acquires as described in [1].
The atomic_store_rel intrinsic releases as described in [1].

[1]: http://llvm.org/docs/Atomics.html
2013-05-12 23:23:40 +02:00
bors
7dc94b8768 auto merge of #6414 : samebchase/rust/experimental, r=graydon
Implemented to_str() for HashMap and HashSet
Added tests.
Minor formatting and stylistic cleanups.
2013-05-12 13:04:34 -07:00
bors
638b394a37 auto merge of #6427 : catamorphism/rust/issue-6319, r=nikomatsakis
r? @nikomatsakis In #6319, several people mentioned they ran into a "computing
fictitious type" ICE in trans. This turns out to be because some
of my recent changes to typeck::check::_match resulted in type errors
getting reported with ty_err as the expected type, which meant the errors
were suppressed, and typechecking incorrectly succeeded (since the errors
weren't recorded).

Changed the error messages in these cases not to use an expected type at all,
rather, printing out a string describing the type that was expected (which is
what the code originally did). The result is a bit repetitive and the
proliferation of error-reporting functions in typeck::infer is a bit annoying,
but I thought it was important to fix this now; more cleanup can happen later.
2013-05-12 10:34:38 -07:00
Samuel Chase
0acb6abb86 Add use declaration for container::Set
All tests pass now.
2013-05-12 21:02:12 +05:30
Corey Richardson
258abf1424 Fix failing test 2013-05-12 09:38:39 -04:00
bors
36771ef609 auto merge of #6429 : gifnksm/rust/bigint-is_even, r=catamorphism
`BigUint::is_even()` didn't return correct value.
2013-05-11 22:40:36 -07:00
bors
1f62b23411 auto merge of #6431 : catamorphism/rust/warnings, r=catamorphism
Just cleaning up warnings.
2013-05-11 21:28:37 -07:00
Corey Richardson
a279d65102 clean up the last bit of warnings 2013-05-11 20:36:47 -07:00
Tim Chevalier
ed41864464 Warning police 2013-05-11 20:36:44 -07:00
bors
35e6ce548f auto merge of #6426 : gifnksm/rust/new-iter, r=catamorphism 2013-05-11 20:34:40 -07:00
bors
f2f10bdc7a auto merge of #6420 : huonw/rust/rm-exec, r=thestinger 2013-05-11 18:49:41 -07:00
gifnksm
a2b81ccba4 libstd: Fix BigUint::is_even 2013-05-12 10:17:23 +09:00
Tim Chevalier
cdb52c0201 rustc: Don't call type_error_message() with ty_err as the expected type
In #6319, several people mentioned they ran into a "computing
fictitious type" ICE in trans. This turns out to be because some
of my recent changes to typeck::check::_match resulted in type errors
getting reported with ty_err as the expected type, which meant the errors
were suppressed, and typechecking incorrectly succeeded (since the errors
weren't recorded).

Changed the error messages in these cases not to use an expected type at all,
rather, printing out a string describing the type that was expected (which is
what the code originally did). The result is a bit repetitive and the
proliferation of error-reporting functions in typeck::infer is a bit annoying,
but I thought it was important to fix this now; more cleanup can happen later.
2013-05-11 17:51:00 -07:00
bors
82164a1e45 auto merge of #6402 : kud1ing/rust/fixes, r=pcwalton 2013-05-11 16:49:40 -07:00
gifnksm
82f963e347 libcore: Change each_val to follow new for-loop protocol 2013-05-12 08:06:31 +09:00
bors
9ee8d506d9 auto merge of #6398 : osaut/rust/master, r=bstrie
I have replaced io::println by println in the tutorial as I do not think it is needed anymore since it is already included in prelude.rs.
2013-05-11 15:10:44 -07:00
bors
8ca64a423b auto merge of #6397 : cantsin/rust/rusti-fixes, r=catamorphism
Fixes #6378

Don't pass the binary name to the LLVMRustExecuteJIT closure, otherwise it will leak memory; the binary name doesn't seem to be needed, anyhow.
2013-05-11 14:04:44 -07:00
bors
957251817b auto merge of #6389 : sonwow/rust/issue-3356, r=bstrie
Fix for #3356
2013-05-11 12:55:49 -07:00
bors
e478cedb0a auto merge of #6385 : huonw/rust/rustc-dtor-struct-match, r=nikomatsakis
**Caveat**: With the current commit, this check only works for `match`s, the checks (incorrectly) do not run for patterns in `let`s, and invalid/unsafe code compiles.

I don't know how to fix this, I experimented with some things to try to make let patterns and match patterns run on the same code (since this would presumably fix many of the other unsoundness issues of let-patterns, e.g. #6225), but I don't understand enough of the code. (I think I heard someone talking about a fix for `let` being in progress?)

Fixes #6344 and #6341.
2013-05-11 11:49:50 -07:00
bors
96de2b0273 auto merge of #6383 : huonw/rust/rustc-expand-then-strip, r=thestinger
This allows macros to create tests and benchmarks.

This is possibly unsound (I've got no idea, but it seemed to work), and being able to programmatically generate benchmarks to compare several implementations of similar algorithms is nice.
2013-05-11 10:52:52 -07:00
Samuel Chase
37bea2a7d0 Fix errors in test_hashset().
All tests now pass.
2013-05-11 20:35:44 +05:30
Samuel Chase
7d43b12c32 Use acc.push_str() instead of str::push_str(..)
Also added some whitespace to enhance readabilty.
2013-05-11 19:31:53 +05:30
Samuel Chase
9ed9e8c8d0 Add test: test_hashset() 2013-05-11 19:25:14 +05:30
Samuel Chase
e2c73ccaf2 Add str representation for HashSet. 2013-05-11 19:18:14 +05:30
Samuel Chase
b8d0ebe124 Remove extra space between key and value.
1. Extra space removed.
2. Using acc.push_str() instead of str::push_str
3. Update test to reflect representation change.
2013-05-11 19:09:11 +05:30
Samuel Chase
3c1e787884 All tests, including newly added test_hashmap() pass. The empty Hash Table doesn't need to be mutable. 2013-05-11 17:40:52 +05:30
Huon Wilson
9b30fa3116 Correct testcases that passed because fns with #[test] were stripped before expansion. 2013-05-11 18:24:02 +10:00
bors
18a47f9580 auto merge of #6384 : thomaslee/rust/issue-4202, r=catamorphism
This fixes the issue described in #4202.

From what I understood of the code, when we reexport a trait in a submodule using e.g. "pub use foo::SomeTrait", we were not previously making an effort to reexport the static methods on that trait.

I'm new to the Rust code base (and the Rust language itself) so my approach may not be kosher, but this patch works by changing the encoder to include the static methods associated with traits.

I couldn't see any tests for this area of the code, so I didn't really have any examples to go by. If tests are needed, I'm happy to work through that if I can get some assistance to do so.
2013-05-11 00:43:51 -07:00