Commit Graph

17945 Commits

Author SHA1 Message Date
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
bors
d43d3e538c auto merge of #6376 : nikomatsakis/rust/issue-6272-tests, r=graydon
r? @graydon
2013-05-10 22:58:53 -07:00
bors
842e304ab5 auto merge of #6368 : catamorphism/rust/issue-5315, r=catamorphism 2013-05-10 21:52:56 -07:00
Tom Lee
1e241ce52b Test case for issue #4202 2013-05-10 21:33:58 -07:00
Huon Wilson
4958e9b4b6 Remove core executable 2013-05-11 13:42:51 +10:00
bors
9f106a643e auto merge of #6260 : alexcrichton/rust/issue-3466-no-swap, r=pcwalton
There may be a more efficient implementation of `core::util::swap_ptr`. The issue mentioned using `move_val_init`, but I couldn't figure out what that did, so I just used `copy_memory` a few times instead.

I'm not exactly the best at reading LLVM generated by rust, but this does appear to be optimized away just as expected (when possible).
2013-05-10 20:35:00 -07:00
Alex Crichton
60803e5fc8 Fix tests with the swap operator 2013-05-10 22:51:06 -04:00
Alex Crichton
63c7e2f991 Remove the '<->' operator from the language 2013-05-10 22:51:06 -04:00
Alex Crichton
998fececd6 Stop using the '<->' operator 2013-05-10 22:51:06 -04:00
Alex Crichton
7d22437ecd Implement util::swap without the '<->' operator 2013-05-10 22:51:06 -04:00
bors
c49cf8b330 auto merge of #6205 : brson/rust/flate, r=brson
r? @graydon

I don't think this is necessary in core.
2013-05-10 19:41:00 -07:00
bors
3e0400fb86 auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwalton
Closes #6183.

The first commit changes the compiler's method of treating a `for` loop, and all the remaining commits are just dealing with the fallout.

The biggest fallout was the `IterBytes` trait, although it's really a whole lot nicer now because all of the `iter_bytes_XX` methods are just and-ed together. Sadly there was a huge amount of stuff that's `cfg(stage0)` gated, but whoever lands the next snapshot is going to have a lot of fun deleting all this code!
2013-05-10 17:56:02 -07:00
Alex Crichton
606bd75586 Fix merge "failures" 2013-05-10 19:20:21 -04:00
Alex Crichton
b05aae2d41 test: Use the new for protocol 2013-05-10 19:20:20 -04:00
Brian Anderson
7652f3ddb8 Move flate from core to std 2013-05-10 16:00:26 -07:00
Samuel Chase
fd5a3520d5 Removed test_hashmap() for the time, being. All tests pass with make check. 2013-05-11 04:00:00 +05:30
Lenny222
52610c3980 more back-ticks, less colons 2013-05-10 23:34:20 +02:00
Samuel Chase
d807f00bfd Add to_str() for HashMaps, and some basic tests as well. 2013-05-11 02:14:36 +05:30
Corey Richardson
7d4bb90e76 Remove redundant import error 2013-05-10 16:23:12 -04:00
bors
d546493096 auto merge of #6380 : pcwalton/rust/core-text-ice, r=pcwalton 2013-05-10 13:10:54 -07:00
Olivier Saut
017e7e8be1 Replace io::println by println as it is now included in prelude.rs 2013-05-10 21:12:11 +02:00
James Tranovich
3db74ddd2e Fixes rusti crashes.
Don't pass the binary name to the LLVMRustExecuteJIT closure; doesn't
seem to be needed, anyhow.
2013-05-10 10:51:00 -07:00
bors
dba9337a48 auto merge of #6366 : catamorphism/rust/issue-3920, r=catamorphism
r? @nikomatsakis as per #3920
2013-05-10 05:52:48 -07:00
Youngsoo Son
24ef88cee9 renamed str::from_slice to str::to_owned 2013-05-10 20:08:56 +09:00
bors
fdf601eaf3 auto merge of #6358 : crabtw/rust/mips-segstk, r=brson
I changed ```RED_ZONE_SIZE``` to ```RZ_MAC_32``` because of stack canary failure.
Here is a LLVM patch for MIPS segmented stacks.
http://people.cs.nctu.edu.tw/~jyyou/rust/mips-segstk.patch

Current test results
```
failures:
    rand::tests::test_rng_seeded_custom_seed2
    run::tests::test_forced_destroy_actually_kills
    run::tests::test_unforced_destroy_actually_kills
    time::tests::run_tests
    uv_ll::test::test_uv_ll_struct_size_addrinfo
    uv_ll::test::test_uv_ll_struct_size_uv_timer_t

segfaults:
    rt::io::option::test::test_option_writer_error
    rt::local_services::test::unwind
    rt::sched::test_swap_tasks_then
    stackwalk::test_simple
    stackwalk::test_simple_deep
```
2013-05-10 04:07:50 -07:00
bors
6da2c989ba auto merge of #6329 : sonwow/rust/issue-6306, r=ILyoan
Fix for #6306
2013-05-10 03:04:51 -07:00
Huon Wilson
912a352712 Add some positive tests for dtor struct destructuring 2013-05-10 19:42:24 +10:00
Youngsoo Son
b7da975049 renamed vec::from_slice to vec::to_owned 2013-05-10 18:38:54 +09:00
Huon Wilson
81e06a5259 Issue number on xfailed test 2013-05-10 19:30:42 +10:00
bors
e9d0018abf auto merge of #6356 : dotdash/rust/strinterner, r=pcwalton
&str can be turned into @~str on demand, using to_owned(), so for
strings, we can create a specialized interner that accepts &str for
intern() and find() but stores and returns @~str.
2013-05-10 01:55:54 -07:00
Huon Wilson
f6743fea70 librustc: allow destructuring of structs with destructors if the pattern has no moves.
This check only works for `match`s, the checks (incorrectly) do not run for patterns in
`let`s.
2013-05-10 18:34:19 +10:00
Youngsoo Son
4400bbd72a A test file is fixed 2013-05-10 16:55:59 +09:00
bors
f04eb37c7e auto merge of #6347 : cmr/rust/unknown_module_resolve_error, r=catamorphism
This improves error reporting for the following class of imports:

```rust
use foo::bar;
```

Where foo, the topmost module, is unresolved. It now results in:

```text
/tmp/foo.rs:1:4: 1:7 error: unresolved import.  perhapsyou forgot an 'extern mod foo'?
/tmp/foo.rs:1 use foo::bar;
                  ^~~
/tmp/foo.rs:1:4: 1:12 error: failed to resolve import: foo::bar
/tmp/foo.rs:1 use foo::bar;
                  ^~~~~~~~
error: failed to resolve imports
error: aborting due to 3 previous errors
```

This is the first of a series of changes I plan on making to unresolved name error messages.
2013-05-10 00:52:52 -07:00
bors
3e106cf2c2 auto merge of #6339 : alexcrichton/rust/unsafe-cvec, r=catamorphism
As noted by @jwise [here](52445129fd (commitcomment-3172192)), it's probably a good idea to keep these unsafe.

The lint check won't warn about these because it ignore `unsafe fn` declarations.
2013-05-09 23:58:53 -07:00
Alex Crichton
cdc266e47d Fix deriving(IterBytes) to use the new for-loop protocol 2013-05-10 02:46:19 -04:00
Alex Crichton
b01a40d459 rustpkg: Use the new for protocol 2013-05-10 02:46:19 -04:00
Alex Crichton
a87db3e2cd rustc: Use the new for protocol 2013-05-10 02:46:19 -04:00