Commit Graph

22646 Commits

Author SHA1 Message Date
blake2-ppc
6212729315 std::vec: Change fn unzip to take an iterator argument
Remove unzip_slice since it's redundant. Old unzip is equivalent to the
`|x| unzip(x.move_iter())`
2013-09-10 05:39:59 +02:00
bors
8c7c0b41d7 auto merge of #9034 : catamorphism/rust/rustpkg-workcache, r=metajack
r? @metajack or @brson - This pull request makes rustpkg use the workcache library to avoid recompilation.
2013-09-09 20:16:02 -07:00
bors
af259a651d auto merge of #9086 : pcwalton/rust/writeback-port, r=brson
r? @brson or @pnkfelix
2013-09-09 19:06:02 -07:00
bors
d41b558792 auto merge of #9089 : anasazi/rust/fix-acceptor-iterator, r=cmr
The iterator over incoming connections has no natural end, so it should always return Some(_).
Currently, if an incoming connection fails, the iterator returns None.
Trying to accept another connection afterwards enters the realm of undefined behavior (due to the iterator protocol being silent on the issue).

This PR changes wraps the underlying accept call in Some, so the iterator never finishes.
2013-09-09 16:26:03 -07:00
bors
ed695d470b auto merge of #9083 : dcrewi/rust/biguint-bit-ops, r=brson 2013-09-09 14:10:58 -07:00
Patrick Walton
2a0dd97675 librustc: Port writeback to the new API. 2013-09-09 14:10:58 -07:00
bors
54ae2800ff auto merge of #9071 : thestinger/rust/noalias, r=alexcrichton
This also removes a FIXME I added referring to a now closed issue.
2013-09-09 13:01:02 -07:00
bors
60a0dbc095 auto merge of #9033 : alexcrichton/rust/libuv-makefile-dep, r=brson
This way the rule isn't always built whenever you fire off a new build
2013-09-09 11:51:03 -07:00
Daniel Micay
889e1b9731 add noalias attribute to ~ return values 2013-09-09 13:48:54 -04:00
bors
059cbaadfa auto merge of #9005 : alexcrichton/rust/rusty-log, r=brson
Also redefine all of the standard logging macros to use more rust code instead
of custom LLVM translation code. This makes them a bit easier to understand, but
also more flexibile for future types of logging.

Additionally, this commit removes the LogType language item in preparation for
changing how logging is performed.
2013-09-09 10:41:05 -07:00
David Creswick
c3d0fc23d4 Implement bitwise operations on BigUint 2013-09-09 12:15:19 -05:00
David Creswick
4946e0ea5e Merge RandBigUint and RandBigInt into single trait 2013-09-09 11:31:40 -05:00
David Creswick
9bee3d7e5b Convert between BigInts, BigUints, ints, and uints
Previously, conversion to ints, uints, and BigUints clamped the value
within the range of that datatype. With this commit, conversion
overflows fail the task. To handle overflows gracefully, use the new
to_*_opt() methods.
2013-09-09 11:15:03 -05:00
blake2-ppc
5ecd3b4053 Add test for issue #8587, about calling nested functions of the same name 2013-09-09 16:01:42 +02:00
bors
fd2488bf5a auto merge of #9051 : bjz/rust/master, r=huonw 2013-09-09 06:06:04 -07:00
bors
7e2827b99d auto merge of #9059 : Kimundi/rust/master, r=huonw
- Marked a unsafe helper function as unsafe, added a second helper function
- Added moving implementations
2013-09-09 04:51:05 -07:00
Marvin Löbel
3a3934244c Some work on std::ascii: Marked unsafe function unsafe, added moving implementations 2013-09-09 15:07:22 +02:00
bors
fd49f6dce1 auto merge of #9073 : alexcrichton/rust/remove-local-data-hax, r=huonw
These compiler bugs have since been fixed (one less layer of indirection)
2013-09-09 02:36:06 -07:00
Alex Crichton
500077f637 Remove hacks around issues in local_data
These compiler bugs have since been fixed (one less layer of indirection)
2013-09-09 01:01:23 -07:00
bors
d09f569aac auto merge of #9065 : thestinger/rust/iter, r=alexcrichton
The trait will keep the `Iterator` naming, but a more concise module
name makes using the free functions less verbose. The module will define
iterables in addition to iterators, as it deals with iteration in
general.
2013-09-09 00:26:07 -07:00
Daniel Micay
6919cf5fe1 rename std::iterator to std::iter
The trait will keep the `Iterator` naming, but a more concise module
name makes using the free functions less verbose. The module will define
iterables in addition to iterators, as it deals with iteration in
general.
2013-09-09 03:21:46 -04:00
bors
eae327032c auto merge of #9066 : thestinger/rust/repr, r=alexcrichton 2013-09-08 22:16:07 -07:00
Tim Chevalier
a8194edef8 rustpkg: Address review comments from Jack 2013-09-08 22:00:49 -07:00
Tim Chevalier
ed4859ea78 extra: Address review comments from Jack 2013-09-08 22:00:13 -07:00
Daniel Micay
db4720bdfa repr: update for removal of const 2013-09-08 23:17:19 -04:00
Daniel Micay
ec7cd77bd0 repr: write the mutability qualifier for slices 2013-09-08 23:14:46 -04:00
Tim Chevalier
02a0fb94ee rustpkg: Use workcache
rustpkg now uses the workcache library to avoid recompilation.
Hooray!
2013-09-08 20:05:12 -07:00
Tim Chevalier
bb30f047f6 workcache: Add the ability to save and load the database...
...as well as the ability to discover inputs and outputs.
2013-09-08 20:05:11 -07:00
Jakub
7173b9d1b8 Fix pretty-printing of empty impl items 2013-09-08 22:44:24 +00:00
bors
dd5c7379e9 auto merge of #8988 : cmr/rust/fromstr_fn, r=brson
It just calls out to the associated function on the trait.
2013-09-08 12:05:55 -07:00
Corey Richardson
e0e5523552 Fix import order which caused the wrong from_str to be in scope 2013-09-08 15:00:00 -04:00
Brendan Zabarauskas
2c31053d20 Fix unused import warnings on 32bit systems 2013-09-09 03:51:29 +10:00
bors
d36612d65b auto merge of #9054 : huonw/rust/labelled-for, r=thestinger
The following parses and works as expected with this change:

```rust
'foo: for i in range(0, 10) {
    for j in range(0, 10) {
        if i + j == 15 { break 'foo; }
    }
}
```
2013-09-08 07:45:57 -07:00
Huon Wilson
14183114e1 syntax: aesthetic improvements to the for desugaring. 2013-09-08 23:00:05 +10:00
Huon Wilson
07351b44c6 syntax: implement labelled breaks for for.
`for` desugars to `loop` so it is trivial to just desugar to `loop` while
retaining any label.
2013-09-08 22:08:01 +10:00
bors
b609d022c4 auto merge of #9035 : alexcrichton/rust/fewer-clownshoes, r=huonw
This removes another large chunk of this odd 'clownshoes' identifier showing up
in symbol names. These all originated from external crates because the encoded
items were encoded independently of the paths calculated in ast_map. The
encoding of these paths now uses the helper function in ast_map to calculate the
"pretty name" for an impl block.

Unfortunately there is still no information about generics in the symbol name,
but it's certainly vastly better than before

    hash::__extensions__::write::_version::v0.8

becomes

    hash::Writer$SipState::write::hversion::v0.8

This also fixes bugs in which lots of methods would show up as `meth_XXX`, they
now only show up as `meth` and throw some extra characters onto the version
string.
2013-09-08 01:05:59 -07:00
Brendan Zabarauskas
8445009a84 Add Clone and DeepClone constraints to Primitive trait 2013-09-08 13:48:46 +10:00
Brendan Zabarauskas
0fcb85997d Moved checked trait impls out of std::num
This follows the same pattern as the other numeric trait impls, and reduces the clutter in std::num.
2013-09-08 13:48:15 +10:00
bors
5591dce52e auto merge of #9050 : huonw/rust/unfoldnor, r=thestinger
The `r` is not relevant, since there is only one direction of folding
(unlike Haskell).
2013-09-07 18:10:59 -07:00
Huon Wilson
4c2b480aae std: Rename Unfoldr to Unfold.
The `r` is not relevant, since there is only one direction of folding
(unlike Haskell).
2013-09-08 10:52:19 +10:00
bors
b3d50fc2c0 auto merge of #9015 : MicahChalmer/rust/emacs-fixes-round-2, r=nikomatsakis
Here are fixes for more problems mentioned in #8787.  I think I've addressed everything mentioned there except for @nikomatsakis's comment about match/patterns now.  (This also fixes the bug in struct alignment that @pnkfelix mentioned from my earlier pull request #8872.)

The biggest change here is to make fill-paragraph (M-q) and auto-fill-mode work inside different variations of multi-line and doc comments.  Because of the way emacs paragraph fills work (callbacks interacting with global regexp variables that are used in odd ways) there were quite a few edge cases that I had to work around.

The only way I was able to keep it all straight was to create some regression tests.  They use the emacs lisp regression testing tool ERT, and are included as the last commit here.  I added a few tests for indentation as well.  I have not attempted to integrate the tests into the overall rust compiler build process, since I can't imagine anyone would want the compiler build to have a dependency on emacs.  Maybe at some point tools like this get their own repositories?  Just a thought.

One other thought related to the tests: should there be a place to put these types of style samples that isn't specific to one text editor?  Maybe as part of an official rust style guide, but in a form that would allow tools like this to pull out the samples and use them for tests?
2013-09-07 16:10:58 -07:00
bors
f6b36c676e auto merge of #9046 : thestinger/rust/repr, r=alexcrichton
Closes #8743
2013-09-07 15:01:02 -07:00
bors
7f8ada9acf auto merge of #9043 : sfackler/rust/uuid-from-bytes, r=alexcrichton
This method doesn't deal with utf8. I guess it got caught in a mass
rename.
2013-09-07 13:51:02 -07:00
bors
82b6ef66c2 auto merge of #9041 : alexcrichton/rust/use-python-2, r=thestinger
This is required for systems where /usr/bin/python is actually python 3

I already did this before, but forgot to re-port it once libuv was re-upgraded
2013-09-07 12:41:02 -07:00
Daniel Micay
f87578d9fb fix repr of strings/chars with quotes
Closes #8743
2013-09-07 15:31:48 -04:00
bors
79e78c4b0c auto merge of #8906 : novalis/rust/master, r=alexcrichton
This is a patch to fix #6031.  I didn't see any tests for the C++ library code, so I didn't write a test for my changes.  Did I miss something, or are there really no tests?
2013-09-07 11:31:06 -07:00
Steven Fackler
3eaf750a0d Renamed Uuid::from_utf8 to Uuid::from_bytes
This method doesn't deal with utf8. I guess it got caught in a mass
rename.
2013-09-07 11:05:48 -07:00
Alex Crichton
594531a1c8 Give the libuv makefile generation a dependency
This way the rule isn't always built whenever you fire off a new build
2013-09-07 10:46:47 -07:00
Alex Crichton
75afcffc2f Run gyp with CFG_PYTHON which is python < 3
This is required for systems where /usr/bin/python is actually python 3
2013-09-07 10:22:36 -07:00
bors
aa1d4ef55a auto merge of #9032 : alexcrichton/rust/inline-repr, r=thestinger
This allows cross-crate inlining which is *very* good because this is called a
lot throughout libstd (even when libstd is inlined across crates).

In one of my projects, I have a test case with the following performance characteristics

commit | optimization level | runtime (seconds)
----|------|----
before | O2  | 22s
before | O3  | 107s
after | O2  | 13s
after | O3  | 12s

I'm a bit disturbed by the 107s runtime from O3 before this commit. The performance characteristics of this test involve doing an absurd amount of small operations. A huge portion of this is creating hashmaps which involves allocating vectors.

The worst portions of the profile are:
![screen shot 2013-09-06 at 10 32 15 pm](https://f.cloud.github.com/assets/64996/1100723/e5e8744c-177e-11e3-83fc-ddc5f18c60f9.png)

Which as you can see looks like some *serious* problems with inlining. I would expect the hash map methods to be high up in the profile, but the top 9 callers of `cast::transmute_copy` were `Repr::repr`'s various monomorphized instances.

I wish there we a better way to detect things like this in the future, and it's unfortunate that this is required for performance in the first place. I suppose I'm not entirely sure why this is needed because all of the methods should have been generated in-crate (monomorphized versions of library functions), so they should have gotten inlined? It also could just be that by modifying LLVM's idea of the inline cost of this function it was able to inline it in many more locations.
2013-09-07 09:31:12 -07:00