Commit Graph

21383 Commits

Author SHA1 Message Date
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
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
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
bors
9feaf1d023 auto merge of #8594 : bytewiseand/rust/static-fn-ptr, r=pcwalton
Fixes #8588
2013-08-21 15:51:34 -07: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
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
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
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
bors
3cd978fbc7 auto merge of #8563 : graydon/rust/2013-08-16-condition-tutorial, r=catamorphism
First cut of a tutorial on conditions.

cc: #6701
2013-08-20 15:01:55 -07:00
bors
293660d443 auto merge of #8519 : msullivan/rust/objects, r=catamorphism
r?
2013-08-20 13:32:00 -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
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
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