Commit Graph

19358 Commits

Author SHA1 Message Date
Jeff Olson
4015b4a9b4 std: add FileStream::unlink + more tests 2013-08-22 16:31:57 -07:00
Jeff Olson
f6d897d7d9 std: rt::io::file::FileStream fleshed out.. needs more work.. see extended
- change all uses of Path in fn args to &P
- FileStream.read assumptions were wrong (libuv file io is non-positional)
- the above will mean that we "own" Seek impl info .. should probably
  push it in UvFileDescriptor..
- needs more tests
2013-08-22 16:31:57 -07:00
Jeff Olson
47f0e91689 std: CRUD file io bindings in uvio, fs_open()/unlink() in IoFactory + test 2013-08-22 16:31:57 -07:00
Jeff Olson
f60bd75f4d std: remove fcntl const bindings + making valgrind clean w/ no owned vecs 2013-08-22 16:31:57 -07:00
Jeff Olson
e0a80ee332 std: support async/threadpool & sync paths in uv_fs_* calls + add sync test 2013-08-22 16:31:57 -07:00
Jeff Olson
c49c2921b0 std: add read and unlink to low-level FileDescriptor + end-to-end CRUD test 2013-08-22 16:31:57 -07:00
Jeff Olson
dabbac1d6c std: working tests for low-level libuv open, write and close operations 2013-08-22 16:31:57 -07:00
Jeff Olson
a901b16690 std: bootstrapping libuv-based fileio in newrt... open & close
the test "touch"es a new file
2013-08-22 16:31:57 -07:00
Kevin Ballard
77a3de3b95 Implement size_hint() on RangeInclusive 2013-08-22 15:36:29 -07:00
Michael Sullivan
7b08b2c838 Suppress a broken test. Issue #8690. 2013-08-22 15:27:25 -07:00
Keegan McAllister
9721732976 doc: Fix transmute example 2013-08-22 12:06:41 -07:00
Michael Sullivan
ad6eeb843b Don't do a bogus substitution on the transformed self ty for objects. Closes #8664. 2013-08-22 10:52:11 -07:00
Michael Sullivan
97d2b44f87 Substitute into the impl method rather than the trait method when emitting vtables. Closes #8601. 2013-08-22 10:52:11 -07:00
Michael Sullivan
8a9cddad7a Fix type parameter handling for static default methods. Closes #8654. 2013-08-22 10:52:11 -07:00
bors
063a005459 auto merge of #8669 : lkuper/rust/infer-refactor, r=nikomatsakis
This commit removes the "super_*" functions from
typeck::infer::combine, and adds them as default methods on the
Combine trait instead, making it possible to remove a lot of
boilerplate from the various impls of Combine.

I've been wanting to do this for over a year.  In fact, it was my
original motivation for default methods!

It might be possible to tighten things up even more, but this is the
bulk of it.
2013-08-22 10:31:25 -07:00
Michael Sullivan
451de33f7b Add self to the ast_map for provided methods. Closes #8010. 2013-08-22 10:14:10 -07:00
Michael Sullivan
48a682398a Don't ICE if an argument in a default method doesn't have a name. Closes #8417. 2013-08-22 10:14:10 -07:00
bors
4e3dbf959a auto merge of #8666 : nikomatsakis/rust/issue-3678-extern-fn-types, r=pcwalton
Change the type of crust fns like this one:

    extern fn foo() { ... }

from `*u8` to `extern "C" fn()`.

r? @pcwalton (or whomever)
2013-08-22 07:01:27 -07:00
bors
3f6f79b789 auto merge of #8627 : kballard/rust/fix-rusti, r=catamorphism
Commit 0932ab336 accidentally broke rusti by making it parse the binary
name as the input, instead of parsing what the user typed.
2013-08-22 04:41:27 -07:00
bors
7e50260f13 auto merge of #8626 : kballard/rust/issue-8615, r=catamorphism
Fixes #8615.
2013-08-22 03:11:29 -07:00
Michael Woerister
0e8a64073c debuginfo: Improved handling of function preludes. 2013-08-22 10:58:01 +02:00
Michael Woerister
8c09e2b790 debuginfo: Big cleanup refactoring and support for foreign_item_fn. 2013-08-22 10:58:01 +02:00
bors
b95c135621 auto merge of #8620 : brson/rust/issue-7563, r=alexcrichton 2013-08-22 01:41:30 -07:00
Vadim Chugunov
9e4fddeade Cleanup assembly source. 2013-08-22 00:12:44 -07:00
Vadim Chugunov
39fc0883fd Enabled tests. 2013-08-22 00:12:44 -07:00
Vadim Chugunov
3768bb32cd Compile via external assembler on Windows. 2013-08-22 00:12:43 -07:00
Vadim Chugunov
84e683063b Emit unwind info in rustrt assembly files on Windows. 2013-08-22 00:12:43 -07:00
Vadim Chugunov
9e7f1fce73 Un-disable stack unwinding on Windows. 2013-08-22 00:12:43 -07:00
Vadim Chugunov
1860efbfc6 On Windows, use g++ for linking, instead of gcc.
This is required in order to produce linked modules that perform correct registration of unwind tables.
2013-08-22 00:12:42 -07:00
bors
f51d30d729 auto merge of #8616 : kballard/rust/url-parse-errors, r=catamorphism
Fixes issue #8612.
2013-08-22 00:01:32 -07:00
Brandon Sanderson
3b9e2efd64 Make json::to_xxx(&Json) fns Json::to_xxx(&self)
to_str, to_pretty_str, to_writer, and to_pretty_writer were at the top
level of extra::json, this moves them into an impl for Json to match
with what's been done for the rest of libextra and libstd.
2013-08-21 22:49:17 -07:00
bors
f1132496dd auto merge of #8590 : blake2-ppc/rust/std-str, r=alexcrichton
Implement CharIterator as a separate struct, so that it can be .clone()'d. Fix `.char_range_at_reverse` so that it performs better, closer to the forwards version. This makes the reverse iterators and users like `.rfind()` perform better.

    Before
    test str::bench::char_iterator ... bench: 146 ns/iter (+/- 0)
    test str::bench::char_iterator_ascii ... bench: 397 ns/iter (+/- 49)
    test str::bench::char_iterator_rev ... bench: 576 ns/iter (+/- 8)
    test str::bench::char_offset_iterator ... bench: 128 ns/iter (+/- 2)
    test str::bench::char_offset_iterator_rev ... bench: 425 ns/iter (+/- 59)
    
    After
    test str::bench::char_iterator ... bench: 130 ns/iter (+/- 1)
    test str::bench::char_iterator_ascii ... bench: 307 ns/iter (+/- 5)
    test str::bench::char_iterator_rev ... bench: 185 ns/iter (+/- 8)
    test str::bench::char_offset_iterator ... bench: 131 ns/iter (+/- 13)
    test str::bench::char_offset_iterator_rev ... bench: 183 ns/iter (+/- 2)

To be able to use a string slice to represent the CharIterator, a function `slice_unchecked` is added, that does the same as `slice_bytes` but without any boundary checks.

It would be possible to implement CharIterator with pointer arithmetic to make it *much more efficient*, but since vec iterator is still improving, it's too early to attempt to re-implement it in other places. Hopefully CharIterator can be implemented on top of vec iterator without any unsafe code later.

Additional changes fix the documentation about null termination.
2013-08-21 21:51:30 -07:00
bors
8e776c75e9 auto merge of #8570 : catamorphism/rust/2013-08-16-rollup, r=catamorphism
Nothing arguable here, as far as I can tell.
2013-08-21 20:21:32 -07:00
bors
3ddfb72512 auto merge of #8562 : bblum/rust/superkinds, r=nikomatsakis
For #7083.

The metadata issue with the old version is now fixed. Ready for review.

This is also not the full solution to #7083, because this is not supported yet:
```
trait Foo : Send { }

impl <T: Send> Foo for T { }

fn foo<T: Foo>(val: T, chan: std::comm::Chan<T>) {
    chan.send(val);
}
```

cc @nikomatsakis
2013-08-21 18:51:42 -07:00
Tim Chevalier
a9aa4ad2a0 rustpkg: Add test for #7348. Closes #7348 2013-08-21 18:05:10 -07:00
Brian Anderson
a02a759f14 test: Add test for #7563. Closes #7563 2013-08-21 17:50:18 -07:00
Ben Blum
b795fab046 oops v2, apparently writing std::comm::stream() doesn't work on check-fast; fix this 2013-08-21 20:33:56 -04:00
Tim Chevalier
5fd47c7aac rustpkg: Re-enable some more tests 2013-08-21 17:26:18 -07:00
bors
fca75199c7 auto merge of #8595 : vadimcn/rust/print_link_args, r=alexcrichton
This resolves issue #8569
2013-08-21 17:21:33 -07:00
Tim Chevalier
996989cdb4 rustpkg: Add test for #7338. Closes #7338 2013-08-21 17:20:43 -07:00
Tim Chevalier
ef8a5044ff rustc: More helpful error message when using a struct type like a function
Closes #6702
2013-08-21 17:17:50 -07:00
Tim Chevalier
5622ce10fe testsuite: Un-xfail test for #5917 2013-08-21 17:17:50 -07:00
Tim Chevalier
8e3a4f13c5 testsuite: Test for #4447
Closes #4447
2013-08-21 17:17:50 -07:00
Tim Chevalier
120c5503a6 rustc: Remove FIXME (see #4949) 2013-08-21 17:17:50 -07:00
Tim Chevalier
21720a09de testsuite: Test for #6132
Closes #6132
2013-08-21 17:17:50 -07:00
Tim Chevalier
fb9f97ebee rustc: More helpful error message when using a struct type like a function
Closes #6702
2013-08-21 17:17:50 -07:00
Tim Chevalier
393a130b3d Testsuite: Test for #7013. Closes #7013 2013-08-21 17:17:49 -07:00
Tim Chevalier
1b860881ab extra: change XXX to FIXME and elaborate on comments 2013-08-21 17:17:47 -07:00
Tim Chevalier
5da4b4d928 std/extra: changing XXX to FIXME; cleanup
* Get rid of by-value-self workarounds; it works now
* Remove type annotations, they're not needed anymore
2013-08-21 17:17:41 -07:00
Tim Chevalier
77279a73cb testsuite: Tests for #6458. Closes #6458 2013-08-21 17:14:31 -07:00
Ben Blum
0081961c57 Only bug on self-not-mapped-to-def if no previous errors were present. Close #6642. 2013-08-21 19:22:57 -04:00
Ben Blum
598072afa4 Don't fail in port.try_recv() the second time. Close #7800. 2013-08-21 18:57:22 -04:00
bors
9feaf1d023 auto merge of #8594 : bytewiseand/rust/static-fn-ptr, r=pcwalton
Fixes #8588
2013-08-21 15:51:34 -07:00
blake2-ppc
93de60e511 std::str: Add test for CharIterator .clone() 2013-08-22 00:35:43 +02:00
Ben Blum
22ad36d75b oops, xfail-fast the cross-crate superkind tests 2013-08-21 15:52:31 -04:00
bors
18144b12b1 auto merge of #8546 : jld/rust/discrim-symbol-rm, r=pcwalton
Given that bootstrapping and running the testsuite works without
exporting discriminant values as global constants, I conclude that
they're unused and can be removed.
2013-08-21 12:51:40 -07:00
Vadim Chugunov
2b10968542 Trimmed whitespace 2013-08-21 11:54:30 -07:00
bors
0c6cc11e05 auto merge of #8445 : Florob/rust/unicode, r=graydon
This adds support for performing Unicode Normalization Forms D and KD on strings.
To enable this the decomposition and canonical combining class properties are added to std::unicode.
On my system this increases libstd's size by ~250KiB.
2013-08-21 11:01:44 -07:00
Lindsey Kuper
3613c22c8c Refactor type combining to use default methods. Woohoo!
This commit removes the "super_*" functions from
typeck::infer::combine, and adds them as default methods on the
Combine trait instead, making it possible to remove a lot of
boilerplate from the various impls of Combine.

I've been wanting to do this for over a year.  In fact, it was my
original motivation for default methods!

It might be possible to tighten things up even more, but this is the
bulk of it.
2013-08-21 13:33:30 -04:00
Andreas Martens
5ed9f60a97 Changed fn main to pub fn main 2013-08-21 18:32:04 +02:00
bors
e66478193b auto merge of #8610 : kballard/rust/mod_floor, r=alexcrichton
`mod_floor()` was incorrectly defined for uint types as `a / b` instead of `a % b`.
2013-08-21 09:31:43 -07:00
Niko Matsakis
6b23d20452 Prohibit assignment to &mut pointers that are found in frozen or borrowed locations.
Fixes #8625.
2013-08-21 12:02:21 -04:00
Andreas Martens
0f6dd53948 Split cross-crate test into own test and xfail-fast it 2013-08-21 17:29:47 +02:00
bors
bf90634087 auto merge of #8604 : kballard/rust/iter-size-hint, r=graydon
Implement `size_hint()` on the new std::vec Iterators.

Add or update `size_hint()` on std::iterator Iterators where appropriate.

r? @thestinger
2013-08-21 08:01:44 -07:00
Niko Matsakis
ffb6404c5a Adjust callbacks in the libraries for the new type of extern fns
cc #3678
2013-08-21 10:50:42 -04:00
Niko Matsakis
82a9abbf62 Change type of extern fns from *u8 to extern "ABI" fn
cc #3678
2013-08-21 10:50:37 -04:00
Niko Matsakis
94a084a4b4 Fix crash(!) by using the *Rust fn type* not the extern fn type
cc #3678
2013-08-21 10:50:32 -04:00
bors
9765f337a9 auto merge of #8602 : sanxiyn/rust/sysconf, r=graydon
Linux and Android share the kernel, but not the C library, so sysconf constants are different. For example, _SC_PAGESIZE is 30 on Linux, but 39 on Android.

This patch
* splits sysconf constants to sysconf module
* merges non-MIPS and MIPS sysconf constants (they are same)
* adds Android sysconf constants

This patch also lets mmap tests to pass on Android.
2013-08-21 06:31:44 -07:00
bors
4c75e92612 auto merge of #8600 : sfackler/rust/http, r=brson
It's an empty stub and as one of the comments notes, doesn't belong in
libstd.
2013-08-21 05:01:43 -07:00
Florian Zeitz
3d720c6c09 Add support for performing NFD and NFKD on strings 2013-08-21 11:50:07 +02:00
Florian Zeitz
2675f3e9e7 Add canonical combining class to std::unicode 2013-08-21 11:50:07 +02:00
Florian Zeitz
83f4bee44f Add Unicode decomposition mappings to std::unicode 2013-08-21 11:50:07 +02:00
bors
c87d798fb0 auto merge of #8585 : jankobler/rust/extract-grammar-01, r=catamorphism
This fixes some errors which extract_grammar.py reports, when called with

python2.7 src/etc/extract_grammar.py <doc/rust.md
2013-08-21 02:22:25 -07:00
bors
d4d856b129 auto merge of #8582 : thestinger/rust/container, r=thestinger
5f3a637 r=huonw
934a5eb r=thestinger
0f6e90a r=cmr
2013-08-21 01:01:47 -07:00
bors
48dded95c6 auto merge of #8580 : bytewiseand/rust/tuple-struct-ctor-ptr, r=alexcrichton
Fixes #5315
2013-08-20 23:11:50 -07:00
bors
00dd9e9cc5 auto merge of #8573 : mrordinaire/rust/struct-new-as-field-name, r=alexcrichton
fix for #8088, along with a test.
2013-08-20 21:41:50 -07:00
nsf
0f6e90a5fd Fix typo in test/bench/noise.rs. Closes #8574. 2013-08-20 22:38:00 -04:00
Steven Fackler
934a5eba50 Deleted fun_treemap
@thestinger and I talked about this in IRC. There are a couple of use
cases for a persistent map, but they aren't common enough to justify
inclusion in libextra and vary enough that they would require multiple
implementations anyways.

In any case, fun_treemap in its current state is basically useless.
2013-08-20 22:09:47 -04:00
Daniel Micay
5f3a637b7c enable tests for the container tutorial 2013-08-20 22:05:46 -04:00
Daniel Micay
7727920ba2 iterator: add a method for reversing a container
this works on any container with a mutable double-ended iterator
2013-08-20 22:05:03 -04:00
Daniel Micay
b68eedf846 option: derive Clone/DeepClone for the iterator 2013-08-20 22:05:03 -04:00
Daniel Micay
25bac776d9 vec: add shrink_to_fit
Closes #4960
2013-08-20 22:05:03 -04:00
Daniel Micay
0ba8ccdaee rm obsolete float to_str_radix free functions 2013-08-20 22:05:03 -04:00
Daniel Micay
46fc549fa9 rm obsolete integer to_str{,_radix} free functions 2013-08-20 22:05:03 -04:00
Daniel Micay
0d72f604b7 iterator: add a range_inclusive function
Closes #6242
2013-08-20 22:05:03 -04:00
Daniel Micay
2bc999a636 container: inline contains_key default method 2013-08-20 22:05:03 -04:00
bors
d56b9b102b auto merge of #8656 : toddaaro/rust/idle-opt+cleaning, r=brson
Fixed a memory leak caused by the singleton idle callback failing to close correctly. The problem was that the close function requires running inside a callback in the event loop, but we were trying to close the idle watcher after the loop returned from run. The fix was to just call run again to process this callback. There is an additional tweak to move the initialization logic fully into bootstrap, so tasks that do not ever call run do not have problems destructing.
2013-08-20 18:51:55 -07:00
bors
0bc1ca4045 auto merge of #8631 : anasazi/rust/homing-io, r=brson
libuv handles are tied to the event loop that created them. In order to perform IO, the handle must be on the thread with its home event loop. Thus, when as task wants to do IO it must first go to the IO handle's home event loop and pin itself to the corresponding scheduler while the IO action is in flight. Once the IO action completes, the task is unpinned and either returns to its home scheduler if it is a pinned task, or otherwise stays on the current scheduler.

Making new blocking IO implementations (i.e. files) thread safe is rather simple. Add a home field to the IO handle's struct in uvio and implement the HomingIO trait. Wrap every IO call in the HomingIO.home_for_io method, which will take care of the scheduling.

I'm not sure if this remains thread safe in the presence of asynchronous IO at the libuv level. If we decide to do that, then this set up should be revisited.
2013-08-20 17:12:09 -07:00
toddaaro
352ac2efdf Fixed a memory leak caused by the singleton idle callback failing to close correctly. The problem was that the close function requires running inside a callback in the event loop, but we were trying to close the idle watcher after the loop returned from run. The fix was to just call run again to process this callback. There is an additional tweak to move the initialization logic fully into bootstrap, so tasks that do not ever call run do not have problems destructing. 2013-08-20 15:48:59 -07:00
Ben Blum
b81f5c547c small cleanups in task/spawn.rs 2013-08-20 18:39:18 -04:00
Niko Matsakis
0ea2a20397 Add PointerKind to LpDeref 2013-08-20 17:37:49 -04:00
bors
293660d443 auto merge of #8519 : msullivan/rust/objects, r=catamorphism
r?
2013-08-20 13:32:00 -07:00
Eric Reed
66365b6378 Added home_for_io_with_sched variant. Temporarily making IO unkillable. 2013-08-20 13:27:33 -07:00
Ben Blum
5796e9e49c Add tests for self type using builtin kinds. (#7083) 2013-08-20 15:56:34 -04:00
Ben Blum
cdbdfe88a5 Allow the Self type to benefit from builtin-kinds-as-supertraits (#7083). 2013-08-20 15:56:34 -04:00
bors
a8c3fe45c6 auto merge of #8328 : alexcrichton/rust/llvm-head, r=brson
The first commit message is pretty good, but whomever reviews this should probably also at least glance at the changes I made in LLVM. I basically reorganized our pending patch queue to be a bit more organized and clearer in what needs to go where. After this, our queue would be:

* Add the `no-split-stack` attribute
* Add the `fixedstacksegment` attribute
* Add split-stacks for arm android
* Add split-stacks for arm linux
* Add split stacks for mips

Then there's a patch which I added to get rust to build at all on LLVM-head, and I'm not quite sure why it's there, but nothing seems to be crashing for now! (famous last words).

Otherwise, I just updated code to reflect the changes I made in LLVM with the only major change being the advent of the new `no_split_stack` attribute. This is work towards #1226, but someone more familiar with the code should probably actually assign the attribute to the appropriate functions.

Also as a bonus, I've verified that this closes #5774
2013-08-20 11:31:59 -07:00
Ben Blum
dd406365e1 Add assert_once_ever macro. Close #7748. (fixme cf #8472) 2013-08-20 13:28:59 -04:00
Ben Blum
4fd404f2ca Fixup style of test cases for #7083 2013-08-20 13:28:51 -04:00
Ben Blum
95089d3793 Add tests for super-builtin-kind capabilities (#7083) 2013-08-20 13:28:50 -04:00
Ben Blum
3c3bfb4c3c Add more capabilities to typarams bounded by traits with super-builtin-kinds. Close #7083. 2013-08-20 13:28:50 -04:00
Ben Blum
4ca2e55adb Add tests for #7083. 2013-08-20 13:28:50 -04:00
Ben Blum
69322d9410 Allow traits to use builtin kinds as supertraits for #7083. 2013-08-20 13:28:50 -04:00
Ben Blum
369f7fa169 Prevent Send, Freeze, and Sized from being manually implemented. Close #8517. 2013-08-20 13:28:50 -04:00
Eric Reed
a909144b1c Moved .sleep() to Timer. 2013-08-20 09:53:02 -07:00
bors
67c954e365 auto merge of #8566 : toddaaro/rust/idle-opt+cleaning, r=catamorphism,brson
Instead of a furious storm of idle callbacks we just have one. This is a major performance gain - around 40% on my machine for the ping pong bench.

Also in this PR is a cleanup commit for the scheduler code. Was previously up as a separate PR, but bors load + imminent merge hell led me to roll them together. Was #8549.
2013-08-20 09:42:00 -07:00
Alex Crichton
7f91e7740d Fix LLVM compilation issues and use the new attrs
This implements #[no_split_stack] and also changes #[fast_ffi] to using the new
"fixedstacksegment" string attribute instead of integer attribute.
2013-08-20 08:33:52 -07:00
bors
7f26812895 auto merge of #8463 : brson/rust/borrowck, r=nmatsakis,nikomatsakis
r? @nikomatsakis
2013-08-20 06:41:58 -07:00
bors
5e9dff90c9 auto merge of #8638 : pnkfelix/rust/fsk-visitor-vpar-defaults-step5, r=huonw
"non-mechanical" : there was lots more hacking than the other more-mechanical ports Felix did.

r? @huonw.  (Or @nikomatsakis ; I just want someone to sanity-check this.  Its not a thing of beauty.)

Followup to #8623.  (See #8527, which was step 1 of 5, for the full outline.  Part of #7081.)

Notes on the change follow.

There's also a strange pattern that I hacked in to accommodate the
Outer/Inner traversal structure of the existing code (which was
previously encoding this by untying the Y-combinator style knot of the
vtable, and then retying it but superimposing new methods that "stop
at items").  I hope either I or someone else can come back in the
future and replace this ugliness with something more natural.

Added boilerplate macro; all the OuterLint definitions are the same
(but must be abstracted over implementing struct, thus the macro).

Revised lint.rs use declarations to make ast references explicit.
Also removed unused imports.
2013-08-20 03:52:01 -07:00
Felix S. Klock II
9b82d50f6d add line break post dbaupp review. 2013-08-20 12:25:34 +02:00
Felix S. Klock II
213d89b6da remove trailing whitespace to placate make tidy. 2013-08-20 11:09:47 +02:00
Felix S. Klock II
c709c0a3ab Port lint.rs from oldvisit to <V:Visit> trait API. Less mechanical port.
That is, there was lots more hacking than the other more-mechanical
ports Felix did.

There's also a strange pattern that I hacked in to accommodate the
Outer/Inner traversal structure of the existing code (which was
previously encoding this by untying the Y-combinator style knot of the
vtable, and then retying it but superimposing new methods that "stop
at items").  I hope either I or someone else can come back in the
future and replace this ugliness with something more natural.

Added boilerplate macro; all the OuterLint definitions are the same
(but must be abstracted over implementing struct, thus the macro).

Revised lint.rs use declarations to make ast references explicit.
Also removed unused imports.
2013-08-20 10:45:40 +02:00
Alex Crichton
d1e4815255 Upgrade llvm to current HEAD
* This has one workaround patch (everything's testing just fine...)
* I reworked the fixedstacksegment attribute to be specified with a string
  rather than using a keyword and an integer and modifying the parser
* I added a "no-split-stack" attribute along the same lines as the
  "fixedstacksegment" attribute for #1226
2013-08-20 01:12:47 -07:00
bors
c099242a1a auto merge of #8548 : catamorphism/rust/unignore-rustpkg-tests, r=catamorphism
r? @brson This necessitated some cleanup to how we parse library filenames
when searching for libraries, since rustpkg may now create filenames
that contain '-' characters. Also cleaned up how rustpkg passes the
sysroot to a custom build script.
2013-08-19 23:41:55 -07:00
Brian Anderson
0f9ab93642 std: Restore dynamic borrow tracking 2013-08-19 20:39:39 -07:00
bors
5034792c88 auto merge of #8584 : thestinger/rust/jemalloc, r=graydon
This reverts commit 371a316ec9.

Closes #7217
2013-08-19 20:21:58 -07:00
Vadim Chugunov
c8354ff958 Rename functional-struct-update.rs to avoid tripping Windows installer detector.
(The "update" keyword in the test name makes Windows want to run it with elevated privileges, which fails of course)
2013-08-19 18:45:09 -07:00
Daniel Micay
ef436637ea jemalloc: use $(AR), not ar 2013-08-19 20:53:02 -04:00
Graydon Hoare
517e611271 regenerate configure 2013-08-19 20:48:11 -04:00
bors
2ec9b8ce2f auto merge of #8500 : graydon/rust/2013-08-13-self-rollup, r=thestinger
close #8424 r=brson
close #8173 r=brson
close #8209 r=strcat
2013-08-19 17:42:35 -07:00
Eric Reed
35e844ffc1 Make IO thread-safe.
Each IO handle has a home event loop, which created it.
When a task wants to use an IO handle, it must first make sure it is on that home event loop.
It uses the scheduler handle in the IO handle to send itself there before starting the IO action.
Once the IO action completes, the task restores its previous home state.
If it is an AnySched task, then it will be executed on the new scheduler.
If it has a normal home, then it will return there before executing any more code after the IO action.
2013-08-19 16:31:21 -07:00
Eric Reed
d09412ab89 Homed UDP sockets 2013-08-19 16:26:50 -07:00
Eric Reed
d7b6fcba29 Working homing UDP socket prototype. 2013-08-19 16:26:50 -07:00
Eric Reed
88f718341e Instruct event loops to ignore SIGPIPE when constructed.
libuv does not always catch SIGPIPE.
2013-08-19 16:26:50 -07:00
Eric Reed
f68514c128 Do not execute the callback before cleaning up resources. 2013-08-19 16:26:50 -07:00
Eric Reed
97555e865c Derive Clone for IpAddr and SocketAddr 2013-08-19 16:26:50 -07:00
Graydon Hoare
2c7164595f rt: make jemalloc header conform to android signature. 2013-08-19 16:09:46 -07:00
Kevin Ballard
aeb06f2fb1 Fix broken rusti
Commit 0932ab336 accidentally broke rusti by making it parse the binary
name as the input, instead of parsing what the user typed.
2013-08-19 16:00:33 -07:00
Tim Chevalier
d9293d1d87 rustpkg: Un-ignore most of the remaining tests
This necessitated some cleanup to how we parse library filenames
when searching for libraries, since rustpkg may now create filenames
that contain '-' characters. Also cleaned up how rustpkg passes the
sysroot to a custom build script.
2013-08-19 15:27:21 -07:00
Graydon Hoare
610b2b58ec compiletest: do not run tests in sub-threads if on valgrind. 2013-08-19 15:09:20 -07:00
Graydon Hoare
19f4ae1415 Try to fix mac valgrind bot by disabling thread-heavy activities. 2013-08-19 15:09:20 -07:00
Graydon Hoare
29a449aae3 Add tests for cross-crate condition handling. Close #5446. 2013-08-19 15:09:20 -07:00
Graydon Hoare
eaa378033c test: add testcase, close #4929 which was already fixed. 2013-08-19 15:09:20 -07:00
Graydon Hoare
8c78311e81 test: un-xfail now working run-pass/foreign-struct.rs, close #2334. 2013-08-19 15:09:19 -07:00
bors
e6e678fac7 auto merge of #8623 : pnkfelix/rust/fsk-visitor-vpar-defaults-step4, r=nmatsakis
Follow up to #8619 (step 3 of 5).

(See #8527, which was step 1 of 5, for the full outline.)

Part of #7081.
2013-08-19 15:02:07 -07:00
Kevin Ballard
8aa47990da Don't skip token after @'static
Fixes #8615.
2013-08-19 14:55:35 -07:00
bors
4bdceb9c00 auto merge of #8459 : thestinger/rust/checked, r=graydon 2013-08-19 12:42:48 -07:00
toddaaro
e5ccf13668 clean whitespace :/ 2013-08-19 12:01:13 -07:00
Jed Davis
46672d2b06 Remove discriminant symbols.
Given that bootstrapping and running the testsuite works without
exporting discriminant values as global constants, I conclude that
they're unused and can be removed.
2013-08-19 11:34:43 -07:00
Michael Sullivan
6a6d3b600f Make supertrait methods callable on object types.
This requires changes to method search and to codegen. We now emit a
vtable for objects that includes methods from all supertraits.
Closes #4100.

Also, actually populate the cache for vtables, and also key it by type
so that it actually works.
2013-08-19 11:08:07 -07:00
Michael Sullivan
dc9b3e37e2 Rangechange the log message truncation limit. 2013-08-19 09:35:51 -07:00
bors
2246d56e71 auto merge of #8619 : pnkfelix/rust/fsk-visitor-vpar-defaults-step3, r=nmatsakis
Follow up to #8539 (step 2 of 5).

(See  #8527, which was step 1 of 5, for the full outline.)

Part of #7081.
2013-08-19 09:12:03 -07:00
blake2-ppc
8fe8302887 std::str: Use iterators instead of while loops for CharSplitIterator
Embed an iterator in the CharSplitIterator struct, and combine that with
the former bool `only_ascii`; so use an enum instead.
2013-08-19 16:11:45 +02:00
bors
d597f54fc2 auto merge of #8539 : pnkfelix/rust/fsk-visitor-vpar-defaults-step2, r=graydon,nikomatsakis
r? @nikomatsakis

Follow up to #8527 (which was step 1 of 5).  See that for overall description 

Part of #7081
2013-08-19 06:52:03 -07:00
bors
81a78161b5 auto merge of #8535 : nikomatsakis/rust/issue-3678-wrappers-be-gone-2, r=graydon
Long-standing branch to remove foreign function wrappers altogether. Calls to C functions are done "in place" with no stack manipulation; the scheme relies entirely on the correct use of `#[fixed_stack_segment]` to guarantee adequate stack space. A linter is added to detect when `#[fixed_stack_segment]` annotations are missing. An `externfn!` macro is added to make it easier to declare foreign fns and wrappers in one go: this macro may need some refinement, though, for example it might be good to be able to declare a group of foreign fns. I leave that for future work (hopefully somebody else's work :) ).

Fixes #3678.
2013-08-19 04:32:04 -07:00
Niko Matsakis
0479d946c8 Add externfn macro and correctly label fixed_stack_segments 2013-08-19 07:13:15 -04:00
Niko Matsakis
303f650ecf Issue #3678: Remove wrappers and call foreign functions directly 2013-08-19 07:13:15 -04:00
Kevin Ballard
4d97b6e445 Fix some parsing errors in extra::url
Fixes issue #8612.
2013-08-19 02:27:57 -07:00
blake2-ppc
30ab96b272 std::str: Improve comments for CharIterator 2013-08-19 11:20:00 +02:00
blake2-ppc
5eff3e1bd9 std::str: Use CharOffsetIterator in slice_chars 2013-08-19 11:20:00 +02:00
blake2-ppc
8931ad9e52 std::str: Only check char boundary for end index in .slice_to() 2013-08-19 11:20:00 +02:00
blake2-ppc
f33a30e7e8 std::str: Correct docstrings for lack of null terminator in ~str and &str 2013-08-19 11:20:00 +02:00
blake2-ppc
595dd843d7 std::str: Use CharOffsetIterator in .find() and .rfind() 2013-08-19 11:20:00 +02:00
blake2-ppc
db3eb7291a std::str: Implement CharIterator separately
Let CharIterator be a separate type from CharOffsetIterator (so that
CharIterator can be cloned, for example).

Implement CharOffsetIterator by using the same technique as the method
subslice_offset.
2013-08-19 11:20:00 +02:00
blake2-ppc
8a5889d2a2 std::str: Add str::raw::slice_unchecked
Add a function like raw::slice_bytes, but it doesn't check slice
boundaries. For iterator use where we always know the begin, end indices
are in range.
2013-08-19 11:19:59 +02:00
blake2-ppc
3cb5b8dc18 std::str: Special case char_range_at_reverse so it is faster
Implement char_range_at_reverse similarly to char_range_at, instead of
re-using that method.
2013-08-19 11:19:59 +02:00
blake2-ppc
4043c70f23 std::str: Small fix for slice 2013-08-19 11:19:59 +02:00
blake2-ppc
548bdbaa29 std::str: Bench test for char iterators 2013-08-19 11:19:59 +02:00
bors
3e4f40ec5a auto merge of #8564 : alexcrichton/rust/ifmt+++, r=graydon
See discussion in #8489, but this selects option 3 by adding a `Default` trait to be implemented by various basic types.

Once this makes it into a snapshot I think it's about time to start overhauling all current use-cases of `fmt!` to move towards `ifmt!`. The goal is to replace `%X` with `{}` in 90% of situations, and this commit should enable that.
2013-08-19 01:42:05 -07:00
Kevin Ballard
ac3bc9cfcc Fix mod_floor() for uint primitive types 2013-08-19 01:01:11 -07:00
Kevin Ballard
8741770471 Update size_hint()s on std::iterator Iterators
Add size_hint() to a few Iterators that were missing it.

Update a couple of existing size_hint()s to use checked_add() instead of
saturating_add() for the upper bound.
2013-08-18 22:33:32 -07:00
Kevin Ballard
c64f96361e Implement .size_hint() on new vec iterators 2013-08-18 21:58:56 -07:00
bors
c178b52fe5 auto merge of #8556 : sfackler/rust/quote, r=alexcrichton
They previously required one called "ext_cx" to be in scope.

Fixes part of #7727
2013-08-18 21:51:58 -07:00
bors
557ff049f0 auto merge of #8565 : bblum/rust/select-bugfix, r=brson
@brson grilled me about how this bugfix worked the first time around, and it occurred to me that it didn't in the case where the task is unwinding. Now it will.
2013-08-18 19:32:36 -07:00
Steven Fackler
b66cdb16fe Delete std::rt::io::net::http
It's an empty stub and as one of the comments notes, doesn't belong in
libstd.
2013-08-18 20:32:35 -04:00
bors
8fff3f40f2 auto merge of #8561 : kballard/rust/do-block-internal-err-msg, r=thestinger
When using a `do` block to call an internal iterator, if you forgot to
return a value from the body, it would tell you

    error: Do-block body must return bool, but returns () here. Perhaps
    you meant to write a `for`-loop?

This advice no longer applies as `for` loops are now for external
iterators. Delete this message outright and let it use the default error
message

    error: mismatched types: expected `bool` but found `()`

r? @thestinger
2013-08-18 17:12:02 -07:00
bors
b26e11db86 auto merge of #8560 : kballard/rust/reserve-yield, r=pcwalton
Rename task::yield() to task::deschedule().

Fixes #8494.
2013-08-18 15:02:04 -07:00
Andreas Martens
cc0c6fd43c Add assertions and cross crate tests 2013-08-18 22:17:47 +02:00
Vadim Chugunov
ed6694a9b5 Fixed -Z print-link-args 2013-08-18 13:06:35 -07:00
bors
e185b049af auto merge of #8545 : blake2-ppc/rust/iterbytes, r=alexcrichton
Address issue #5257, for example these values all had the same hash value:

	("aaa", "bbb", "ccc")
	("aaab", "bb", "ccc")
	("aaabbb", "", "ccc")

IterBytes for &[A] now includes the length, before calling iter_bytes on
each element.

IterBytes for &str is now terminated by a byte that does not appear in
UTF-8. This way only one more byte is processed when hashing strings.
2013-08-18 12:41:59 -07:00
Andreas Martens
29ab2daa5e Add assertions to test 2013-08-18 21:37:40 +02:00
Andreas Martens
a1066130c0 Fix ICE when calling static and static function pointers
Fixes #8588
2013-08-18 20:21:23 +02:00
Steven Fackler
8b80922a4c quote_*! macros take an ExtCtx
They previously required one called "ext_cx" to be in scope.

Fixes part of #7727
2013-08-18 13:14:15 -04:00
bors
88bd2155d7 auto merge of #8558 : kballard/rust/xorshift-seed, r=cmr
Fixes #8359.
2013-08-18 10:01:55 -07:00
blake2-ppc
bfa1331cd7 std:#️⃣ Add testcase for colliding hashes of tuples
Add a testcase that verifies that (s, t) and (u, v) don't collide even if
s + t == u + v (concatenation).
2013-08-18 18:39:47 +02:00
blake2-ppc
73fdacbac9 std::to_bytes: Implement IterBytes on 1- to 8-tuples 2013-08-18 18:39:47 +02:00
blake2-ppc
6066118b29 std::to_bytes: Delimit sequences &[A] and ~str when hashing
Address issue #5257, for example these values all had the same hash value:

	("aaa", "bbb", "ccc")
	("aaab", "bb", "ccc")
	("aaabbb", "", "ccc")

IterBytes for &[A] now includes the length, before calling iter_bytes on
each element.

IterBytes for &str is now terminated by a byte that does not appear in
UTF-8. This way only one more byte is processed when hashing strings.
2013-08-18 18:39:47 +02:00
bors
0a238288d3 auto merge of #8555 : chris-morgan/rust/time-clone, r=huonw
I need `Clone` for `Tm` for my latest work on [rust-http](https://github.com/chris-morgan/rust-http) (static typing for headers, and headers like `Date` are a time), so here it is.

@huonw recommended deriving DeepClone while I was at it.

I also had to implement `DeepClone` for `~str` to get a derived implementation of `DeepClone` for `Tm`; I did `@str` while I was at it, for consistency.
2013-08-18 07:21:58 -07:00
bors
3bc6858428 auto merge of #8551 : huonw/rust/speling, r=alexcrichton
(This doesn't add/remove `u`s or change `ize` to `ise`, or anything like that.)
2013-08-18 05:11:58 -07:00
bors
600901152c auto merge of #8550 : kballard/rust/token-start-err-msg, r=catamorphism
The span was fixed at some point to point to the correct character, but
the error message is still bad. Update it to emit the actual character
in question (potentially escaped).

Fixes #3747.
2013-08-18 02:51:59 -07:00
bors
758c5e8236 auto merge of #8547 : kballard/rust/trait-parse-err-msg, r=alexcrichton
When parsing a trait function, the function must end with either `;` or
`{` (signifying a default implementation). The error message incorrectly
stated that it must be `;` or `}`.

Fixes #6610.
2013-08-17 22:52:00 -07:00
Jan Kobler
87761c1f99 extract_grammar symnames
add missing symnames

Signed-off-by: Jan Kobler <eng1@koblersystems.de>
2013-08-18 07:25:54 +02:00
bors
6a88415ed8 auto merge of #8544 : dim-an/rust/fix-match-pipes, r=pcwalton
Pointers to bound variables shouldn't be stored before checking pattern,
otherwise piped patterns can conflict with each other (issue #6338).

Closes #6338.
2013-08-17 20:12:02 -07:00
Huon Wilson
6440343a6c More spelling corrections. 2013-08-18 08:28:04 +10:00
bors
679102109f auto merge of #8554 : michaelwoerister/rust/generics, r=brson
This pull request includes support for generic functions and self arguments in methods, and combinations thereof. This also encompasses any kind of trait methods, regular and static, with and without default implementation. The implementation is backed up by a felt ton of test cases `:)`

This is a very important step towards being able to compile larger programs with debug info, since practically any generic function caused an ICE before.

One point worth discussing is that activating debug info now automatically (and silently) sets the `no_monomorphic_collapse` flag. Otherwise debug info would show wrong type names in all but one instance of the monomorphized function.

Another thing to note is that the handling of generic types does not strictly follow the DWARF specification. That is, variables with type `T` (where `T=int`) are described as having type `int` and not as having type `T`. In other words, we are losing information whether a variable has been declared with a type parameter as its type. In practice this should not make much of difference though since the concrete type is mostly what one is interested in. I'll post an issue later so this won't be forgotten.

Also included are a number of bug fixes:
* Closes #1758
* Closes #8513
* Closes #8443
* Fixes handling of field names in tuple structs
* Fixes and re-enables test case for option-like enums that relied on undefined behavior before
* Closes #1339 (should have been closed a while ago)

Cheers,
Michael
2013-08-17 15:22:04 -07:00
Andreas Martens
c4b4cb36c8 Fix segfault when calling tuple struct constructor as extern fn
Fixes #5315
2013-08-17 22:42:31 +02:00
bors
cb8a231eb8 auto merge of #8433 : brson/rust/rm-more-oldrt-crud, r=brson
Just deleting more stuff.
2013-08-17 12:51:57 -07:00
bors
7503396070 auto merge of #8441 : erickt/rust/deny-warnings, r=erickt
This patch makes sure that code is warning-free for all of the rust libraries.
2013-08-17 10:12:04 -07:00
Do Nhat Minh
4457d2b379 fix for #8088 (Cannot name a struct field new due to ancient syntax)
remove code for parsing ancient syntax
added a run-pass test
2013-08-18 00:07:14 +08:00
Erick Tryzelaar
ad5c676853 Fix warnings it tests 2013-08-17 08:42:35 -07:00
Erick Tryzelaar
e20d46056d Fix warnings in librustc and libsyntax 2013-08-17 08:41:42 -07:00
Erick Tryzelaar
be86bc81a7 Fix warnings in tests 2013-08-17 08:41:35 -07:00
bors
29a67d1dc2 auto merge of #8272 : DaGenix/rust/digest-md5-impl-not-unrolled, r=cmr
An MD5 implementation was originally included in #8097, but, since there are a couple different implementations of that digest algorithm (@alco mentioned his implementation on the mailing list just before I opened that PR), it was suggested that I remove it from that PR and open up a new PR to discuss the different implementations and the best way forward. If anyone wants to discuss a different implementation, feel free to present it here and discuss and compare it to this one. I'll just discuss my implementation and I'll leave it to others to present details of theirs.

This implementation relies on the FixedBuffer struct from cryptoutil.rs for managing the input buffer, just like the Sha1 and Sha2 digest implementations do. I tried manually unrolling the loops in the compression function, but I got slightly worse performance when I did that.

Outside of the #[test]s, I also tested the implementation by generating 1,000 inputs of up to 10MB in size and checking the MD5 digest calculated by this code against the MD5 digest calculated by Java's implementation.

On my computer, I'm getting the following performance:

```
test md5::bench::md5_10 ... bench: 52 ns/iter (+/- 1) = 192 MB/s
test md5::bench::md5_1k ... bench: 2819 ns/iter (+/- 44) = 363 MB/s
test md5::bench::md5_64k ... bench: 178566 ns/iter (+/- 4927) = 367 MB/s
```
2013-08-17 07:42:01 -07:00
bors
1942a7a3fb auto merge of #8053 : gavinb/rust/uuid_std, r=alexcrichton
Addresses part of #7104

This module adds the ability to generate UUIDs (on all Rust-supported platforms).

I reviewed the existing UUID support in libraries for a range of languages; Go, D, C#, Java and Boost++. The features were all very similar, and this patch essentially covers the union.  The implmentation is quite straightforward, and uses the underlying rng support which is assumed to be sufficiently strong for this purpose.

This patch is not complete, however I have put this up for review to gather feedback before finalising. It has tests for most features and documentation for most functions.

Outstanding issues:

* Only generates V4 (Random) UUIDs. Do we want to support the SHA-1 hash based flavour as well?
* Is it worth having the field-based struct public as well as the byte array?
* Formatting the string with '-' between groups not done yet.
* Parsing full string not done as there appears to be no regexp support yet. I can write a simple manual parser for now?
* D has a generator as well. This would be easy to add. However, given the simple interface for creating a new one, and the presence of the macro, is this useful?
* Is it worth having a separate UUID trait and specific implementation? Or should it just have a struct+impl with the same name? Currently it feels weird to have the trait (which can't be named UUID so as to conflict) a separate thing.
* Should the macro be visible at the top level scope?

As this is a first attempt, some code may not be idiomatic. Please comment below...

Thanks for all feedback!
2013-08-17 05:12:03 -07:00
bors
8ac17731eb auto merge of #8531 : brson/rust/test-waitpid-workaround, r=graydon
...er

I believe the calls to waitpid are interacting badly with the message passing that goes
on between schedulers and causing us to have very little parallelism in
the test suite. I don't fully understand the sequence of events that causes
the problem here but clearly blocking on waitpid is something that a
well-behaved task should not be doing.

Unfortunately this adds quite a bit of overhead to each test: one thread, two
tasks, three stacks, so there's a tradeoff. The time to execute run-pass on
my 4-core machine goes from ~750s to ~300s.

This should have a pretty good impact on cycle times.

cc @toddaaro
2013-08-17 00:22:05 -07:00
Palmer Cox
b00aa12374 Crypto: Add tests for add_bytes_to_bits functions. 2013-08-17 00:22:27 -04:00
Palmer Cox
6386f887a7 Crypto: update checked addition functions to use CheckedAdd intrinsic.
The shift_add_check_overflow and shift_add_check_overflow_tuple functions are
re-written to be more efficient and to make use of the CheckedAdd instrinsic
instead of manually checking for integer overflow.

* The invokation leading_zeros() is removed and replaced with simple integer
  comparison. The leading_zeros() method results in a ctpop LLVM instruction
  and it may not be efficient on all architectures; integer comparisons,
  however, are efficient on just about any architecture.
* The methods lose the ability for the caller to specify a particular shift
  value - that functionality wasn't being used and removing it allows for the
  code to be simplified.
* Finally, the methods are renamed to add_bytes_to_bits and
  add_bytes_to_bits_tuple to reflect their very specific purposes.
2013-08-17 00:22:27 -04:00
Palmer Cox
c707065325 MD5: Create an implementation of MD5. 2013-08-17 00:22:05 -04:00
Palmer Cox
a37f2844e0 Crypto: Add little-endian versions of existing functions: read_u32v_le and write_u32_le. 2013-08-17 00:22:04 -04:00
toddaaro
20213fcca4 A round of code cleaning for the primary scheduler code. Comments have been updated, a minor amount of support type restructing has happened, methods have been reordered, and some duplicate code has been purged. 2013-08-16 16:37:59 -07:00
toddaaro
f83835b0e7 Moved the logic for a pausible idle callback into a new type - PausibleIdleCallback and placed the appropriate signatures in rtio and implementation into uvio. 2013-08-16 16:37:09 -07:00
Brian Anderson
88d8baa76b std::rt: Fix a race in UvRemoteCallback's dtor that misses callbacks
Full description in comments.
2013-08-16 16:37:09 -07:00
Brian Anderson
bd382ee643 std::rt: Touch up idle logic 2013-08-16 16:37:09 -07:00
toddaaro
066ca17eaa an attempt at a singleton pausible idle callback for each scheduler. suffers from nondeterministic deadlock and also pending scheduler messages on scheduler shutdown. 2013-08-16 16:37:09 -07:00
Alex Crichton
22c7bbfd0c Delegate {} to Default instead of Poly
By using a separate trait this is overridable on a per-type basis and makes room
for the possibility of even more arguments passed in for the future.
2013-08-16 16:09:33 -07:00
Alex Crichton
109274426a Implement {:s} for ~str and @str as well 2013-08-16 16:09:33 -07:00
Kevin Ballard
0450cde37b Remove obsolete error message regarding do-blocks with internal iters
When using a `do` block to call an internal iterator, if you forgot to
return a value from the body, it would tell you

    error: Do-block body must return bool, but returns () here. Perhaps
    you meant to write a `for`-loop?

This advice no longer applies as `for` loops are now for external
iterators. Delete this message outright and let it use the default error
message

    error: mismatched types: expected `bool` but found `()`
2013-08-16 14:12:06 -07:00
Michael Woerister
80fb2f2056 debuginfo: Added test cases for static struct and enum methods. 2013-08-16 22:30:43 +02:00
Michael Woerister
5abb7c3a67 debuginfo: Test cases for [generic][default][static] methods and functions:
* closure-in-generic-function
* generic-functions-nested
* generic-method-on-generic-struct
* generic-trait-generic-static-default-method
* method-on-generic-struct
* self-in-generic-default-method
* trait-generic-static-default-method

Also, fixed an 'unused variable' warning in debuginfo.rs
2013-08-16 22:30:43 +02:00
Michael Woerister
0e7808c2e0 debuginfo: Support for combinations of Self type and type parameters. 2013-08-16 22:30:43 +02:00
Michael Woerister
024d644c68 debuginfo: Add test case for issue #8513. 2013-08-16 22:30:43 +02:00
Michael Woerister
c1734cef33 debuginfo: Implemented support for Self type parameter in trait methods with default implementation. 2013-08-16 22:30:43 +02:00
Michael Woerister
a36e53730f debuginfo: Added test cases for methods on structs, enums, traits, and tuple-structs.
Also new test cases for tuple structs and by-value parameter passing.
2013-08-16 22:30:43 +02:00
Michael Woerister
689929c51a debuginfo: Added support for self parameter in methods. 2013-08-16 22:30:42 +02:00
Michael Woerister
44557e7a33 debuginfo: Fixed crash occuring for parameterless closures. 2013-08-16 22:30:42 +02:00
Michael Woerister
5c9d7c2072 debuginfo: Added test cases for generic structs and enums.
Also, always set no_monomorphic_collapse flags if debuginfo is generated.
2013-08-16 22:30:42 +02:00
Michael Woerister
6c49c2df76 debuginfo: Properly handle monomorphization of generic functions. 2013-08-16 22:30:42 +02:00
Michael Woerister
907633b1bf debuginfo: Generate template type parameters for generic functions.
Conflicts:
	src/librustc/lib/llvm.rs
	src/librustc/middle/trans/debuginfo.rs
	src/rustllvm/RustWrapper.cpp
	src/rustllvm/rustllvm.def.in
2013-08-16 22:27:38 +02:00
Michael Woerister
1dec27bed5 debuginfo: Fixed option-like-enum test case so it does not rely on undefined behavior. 2013-08-16 22:27:38 +02:00
Kevin Ballard
418e1ebae6 Reserve 'yield' keyword
Rename task::yield() to task::deschedule().

Fixes #8494.
2013-08-16 13:26:50 -07:00
Brian Anderson
a4d171e009 rt: Remove unused uv helpers 2013-08-16 13:24:25 -07:00
Brian Anderson
5052773ad8 rt: Remove empty rust_upcall.h 2013-08-16 13:24:25 -07:00
Brian Anderson
450f16eb25 rt: Remove unused rust_clone_type_desc declaration 2013-08-16 13:24:25 -07:00
Brian Anderson
da7d79dfbe rt: Remove rust_stack 2013-08-16 13:24:25 -07:00
Brian Anderson
8861ba6159 rt: Remove rust_refcount.h 2013-08-16 13:24:25 -07:00
Brian Anderson
cb89afc64e rt: Remove unused parts of rust_log 2013-08-16 13:24:25 -07:00
Brian Anderson
085dc55e13 rt: Remove unused parts of rust_globals.h 2013-08-16 13:24:24 -07:00
Brian Anderson
1b6292aaea rt: Remove rust_signal.h 2013-08-16 13:24:24 -07:00
Brian Anderson
9c71f4f1e0 Remove the annihilate lang item 2013-08-16 13:24:24 -07:00
Brian Anderson
5923cc3745 rt: Remove rust_env 2013-08-16 13:24:24 -07:00
Kevin Ballard
e7b8524b3d Give XorShiftRng::new() a random seed
Fixes #8359.
2013-08-16 12:11:34 -07:00
bors
a1674b6150 auto merge of #8534 : huonw/rust/tls-key-macro, r=alexcrichton
This allows the internal implementation details of the TLS keys to be
changed without requiring the update of all the users. (Or, applying
changes that *have* to be applied for the keys to work correctly, e.g.
forcing LLVM to not merge these constants.)
2013-08-16 08:05:10 -07:00
bors
680eb71564 auto merge of #8532 : kballard/rust/cstr-cleanup, r=erickt
Implement interior null checking in `.to_c_str()`, among other changes.
2013-08-16 06:02:14 -07:00
Gavin Baker
328261aa54 Add UUID support to libextra
- generate random UUIDs
- convert to and from strings and bytes
- parse common string formats
- implements Zero, Clone, FromStr, ToStr, Eq, TotalEq and Rand
- unit tests and documentation
- parsing error codes and strings
- incorporate feedback from PR review
2013-08-16 23:00:35 +10:00
bors
8caf517622 auto merge of #8530 : brson/rust/rt-backtrace, r=alexcrichton
The new scheduler didn't preserve this behavior.
2013-08-16 03:59:14 -07:00
Chris Morgan
1f41140c22 Implement Clone and DeepClone for time types. 2013-08-16 20:17:27 +10:00
Chris Morgan
14885dade4 Implement DeepClone for str types. 2013-08-16 20:17:02 +10:00
bors
72b50e729d auto merge of #8526 : blake2-ppc/rust/either-result, r=catamorphism
Retry of PR #8471

Replace the remaining functions marked for issue #8228 with similar functions that are iterator-based.

Change `either::{lefts, rights}` to be iterator-filtering instead of returning a vector.

Replace `map_vec`, `map_vec2`, `iter_vec2` in std::result with three functions:

* `result::collect` gathers `Iterator<Result<V, U>>` to `Result<~[V], U>`
* `result::fold` folds `Iterator<Result<T, E>>` to `Result<V, E>`
* `result::fold_` folds `Iterator<Result<T, E>>` to `Result<(), E>`
2013-08-16 01:56:16 -07:00
bors
92af0db0a3 auto merge of #8518 : catamorphism/rust/issue-8498-workaround, r=brson
r? @brson
2013-08-15 23:56:14 -07:00
Huon Wilson
72fd02d939 doc: convert remaining uses of core:: to std::. 2013-08-16 15:54:14 +10:00
Huon Wilson
abe94f9b4d doc: correct spelling in documentation. 2013-08-16 15:41:28 +10:00
Huon Wilson
3ad23552fb syntax: add a local_data_key macro that creates a key for access to the TLS.
This allows the internal implementation details of the TLS keys to be
changed without requiring the update of all the users. (Or, applying
changes that have to be applied for the keys to work correctly, e.g.
forcing LLVM to not merge these constants.)
2013-08-16 14:37:24 +10:00
Kevin Ballard
fdaae34478 Better error message for unknown start of token
The span was fixed at some point to point to the correct character, but
the error message is still bad. Update it to emit the actual character
in question (potentially escaped).

Fixes #3747.
2013-08-15 21:16:40 -07:00
bors
253337de82 auto merge of #7917 : catamorphism/rust/resolve-and-testcases, r=catamorphism 2013-08-15 20:56:12 -07:00
Tim Chevalier
0266172eae testsuite: xfailed test cases 2013-08-15 19:22:26 -07:00
Daniel Micay
3cec67bbf2 rm obsolete test 2013-08-15 21:12:54 -04:00
Daniel Micay
486501963a vec: rm redundant is_empty implementations 2013-08-15 21:12:35 -04:00
Daniel Micay
fe047e07ba iterator: cleanup 2013-08-15 21:12:34 -04:00
Daniel Micay
45426c3b4c vec: rm obsolete zip and zip_slice
These are obsoleted by the generic iterator `zip` adaptor. Unlike
these, it does not clone the elements or allocate a new vector by
default.
2013-08-15 21:12:34 -04:00
Daniel Micay
1f89eb867a tuple: remove obsolete ExtendedTupleOps
replaced by iterators (generic composable `map` and `zip` adaptors)
2013-08-15 21:12:34 -04:00
Daniel Micay
af9ddd7563 kinds: update documentation 2013-08-15 21:12:34 -04:00