Commit Graph

22126 Commits

Author SHA1 Message Date
blake2-ppc
15bb9b4e1a extra::dlist: Fix bug in Eq::ne 2013-08-29 17:11:11 +02:00
blake2-ppc
479aefb670 std::str: Fix bug in .slice_chars()
`s.slice_chars(a, b)` did not allow the case where `a == s.len()`, this
is a bug I introduced last time I touched the method; add a test for
this case.
2013-08-29 17:11:11 +02:00
blake2-ppc
d8801ceabc std::str: Use CharIterator in NormalizationIterator
Just to simplify and not have the iteration logic repeated in multiple places.
2013-08-29 17:11:11 +02:00
blake2-ppc
b656bfaaa9 std::str: Remove functions count_chars, count_bytes
These are very easy to replace with methods on string slices, basically
`.char_len()` and `.len()`.

These are the replacement implementations I did to clean these
functions up, but seeing this I propose removal:

/// ...
pub fn count_chars(s: &str, begin: uint, end: uint) -> uint {
    // .slice() checks the char boundaries
    s.slice(begin, end).char_len()
}

/// Counts the number of bytes taken by the first `n` chars in `s`
/// starting from byte index `begin`.
///
/// Fails if there are less than `n` chars past `begin`
pub fn count_bytes<'b>(s: &'b str, begin: uint, n: uint) -> uint {
    s.slice_from(begin).slice_chars(0, n).len()
}
2013-08-29 15:51:39 +02:00
bors
2b035d908b auto merge of #8838 : brson/rust/rvfpelim, r=alexcrichton
This reverts commit 2c0f9bd354, reversing
changes made to f8c4f0ea9c.

Conflicts:
	src/rustllvm/RustWrapper.cpp

Fixes #8833
2013-08-29 06:00:48 -07:00
Huon Wilson
4fea236a85 extra: error message should reflact that RUST_TEST_TASKS should be strictly positive (zero is illegal). 2013-08-29 22:58:27 +10:00
Huon Wilson
e835c6b042 rt: remove a series of unfortunate casts. 2013-08-29 22:55:59 +10:00
Huon Wilson
440f1e2dad rt: use sugary functions rather than manual range loops. 2013-08-29 22:55:59 +10:00
Huon Wilson
54e7bdc48e rt: Handle non-integer RUST_THREADS (slightly) more gracefully.
Previously it would call Option.unwrap(), which calls `fail!` on None,
which doesn't work without the runtime (e.g. when initialising it).
2013-08-29 22:55:59 +10:00
bors
33d6572036 auto merge of #8823 : huonw/rust/6233, r=brson
Fixes #7335.
2013-08-29 04:50:43 -07:00
bors
518bd073b4 auto merge of #8830 : andersk/rust/indent-4, r=catamorphism
`default-tab-width` is standardly 8, but most programmers and style guides prefer an indentation width smaller than that.  Rust itself uses 4 space indents.  Most other Emacs modes define the indentation width as 4 or 2 spaces, independently of the width of a Tab character.  Depending on `default-tab-width` makes especially little sense for rust-mode because it sets `indent-tabs-mode` to `nil`.
2013-08-29 03:10:42 -07:00
Ilyong Cho
4cf8671d20 mk: Fix libuv makefile generation on android 2013-08-29 17:44:23 +09:00
Alex Crichton
97f61e7bbe Remove @io::Writer from sys/repr/reflect
At the same time, this updates the TyVisitor to use a mutable self because it's
probably going to be mutating state as it goes along anyway.
2013-08-28 23:00:46 -07:00
Jason Fager
dc30005ad8 Remove the iter module.
Moves the Times trait to num while the question of whether it should
exist at all gets hashed out as a completely separate question.
2013-08-29 01:27:24 -04:00
Alex Crichton
d02496d6d3 Enable segmented stacks for llvm on mingw-64
cc #8488
2013-08-28 20:44:46 -07:00
Alex Crichton
3beb7adf1a Update libuv to rebase on top of joyent/master
Closes #8829
2013-08-28 20:44:46 -07:00
bors
89d04009c1 auto merge of #8800 : fhahn/rust/ticket_5239, r=alexcrichton
I've added a test for the second example mentioned in #5239. The first example does not compile with a reasonable error message. Should I add a compile-fail test for that example as well?

    /rust/src/test/run-pass/issue-5239.rs:15:45: 15:51 error: binary operation + cannot be applied to type `&int`
    rust/src/test/run-pass/issue-5239.rs:15     let _f = |ref x: int| { x += 1};
                                                                                         ^~~~~~

    error: aborting due to previous error
2013-08-28 20:30:36 -07:00
Brian Anderson
3801534d10 Revert "auto merge of #8695 : thestinger/rust/build, r=pcwalton"
This reverts commit 2c0f9bd354, reversing
changes made to f8c4f0ea9c.

Conflicts:
	src/rustllvm/RustWrapper.cpp
2013-08-28 19:59:52 -07:00
Huon Wilson
3f791acf4d Make the unit-test framework check RUST_TEST_TASKS over RUST_THREADS.
Fixes #7335.
2013-08-29 11:17:09 +10:00
bors
26e925a1f0 auto merge of #8832 : alexcrichton/rust/fix-libuv-build, r=pcwalton
It turns out that gyp (libuv's new build system) wants x64 for a 64-bit x86
architecture and ia32 for a 32-bit architecture, so this performs the relevant
mapping and then invokes libuv's configure script with the appropriate target
architecture.

This can be verified by running make with VERBOSE=1 and seeing that beforehand
on a 64-bit build libuv was passed "-arch i386" and now it's passed
"-arch x86_64"

Closes #8826
2013-08-28 17:35:35 -07:00
Alex Crichton
188a9dd210 Fix compilation issues with libuv on OSX
It turns out that gyp (libuv's new build system) wants x64 for a 64-bit x86
architecture and ia32 for a 32-bit architecture, so this performs the relevant
mapping and then invokes libuv's configure script with the appropriate target
architecture.

This can be verified by running make with VERBOSE=1 and seeing that beforehand
on a 64-bit build libuv was passed "-arch i386" and now it's passed
"-arch x86_64"

Closes #8826
2013-08-28 17:32:27 -07:00
bors
7971c46c44 auto merge of #8718 : bblum/rust/typeof, r=pcwalton
r? anybody
2013-08-28 15:30:38 -07:00
Anders Kaseorg
60e84809f0 rust-mode: Default rust-indent-offset to 4, not default-tab-width
default-tab-width is standardly 8, but most programmers and style
guides prefer an indentation width smaller than that.  Rust itself
uses 4 space indents.  Most other Emacs modes define the indentation
width as 4 or 2 spaces, independently of the width of a Tab character.
Depending on default-tab-width makes especially little sense for
rust-mode because it sets indent-tabs-mode to nil.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-08-28 18:09:02 -04:00
bors
da96b3ec6a auto merge of #8447 : alexcrichton/rust/local-data-merge, r=brson
This moves all local_data stuff into the `local_data` module and only that
module alone. It also removes a fair amount of "super-unsafe" code in favor of
just vanilla code generated by the compiler at the same time.

Closes #8113
2013-08-28 14:15:37 -07:00
bors
9c33ef5a7c auto merge of #8828 : brson/rust/randomness, r=thestinger
The new scheduler is not currently that random.
2013-08-28 12:30:52 -07:00
Brian Anderson
d923f75d79 doc: Remove statement about scheduling randomness
The new scheduler is not currently that random.
2013-08-28 11:23:32 -07:00
bors
64ed3721f7 auto merge of #8807 : alexcrichton/rust/remove-two-offsets, r=thestinger
Everything that we do is actually inbounds, so there's no reason for us to be exposing two of these functions
2013-08-28 11:00:41 -07:00
bors
9708ef03a6 auto merge of #8806 : klutzy/rust/winmain, r=cmr
Fixes #8510.
2013-08-28 07:25:42 -07:00
Seo Sanghyeon
97b542bd84 Android: Pass the environment when running tests 2013-08-28 21:44:55 +09:00
Seo Sanghyeon
fcce7e82db Remove --newrt option 2013-08-28 21:25:12 +09:00
Corey Richardson
43f851d2cb Teach the makefile to use multiple src-base's 2013-08-28 08:16:21 -04:00
Corey Richardson
8a07f57081 Teach compiletest to use multiple --src-base's 2013-08-28 08:16:19 -04:00
Corey Richardson
14cdc26e8a src/test/bench: restructure 2013-08-28 08:14:59 -04:00
bors
9bfdd42703 auto merge of #8821 : alexcrichton/rust/fix-libuv-build, r=huonw
The syntax of the script requires python < 3, and so does our build system so we
can just use CFG_PYTHON to run the script. This prevents build failures where
`python` is actually python3 or later.
2013-08-28 03:40:40 -07:00
Alex Crichton
66a07b0550 Run gyp_uv with CFG_PYTHON instead of directly
The syntax of the script requires python < 3, and so does our build system so we
can just use CFG_PYTHON to run the script. This prevents build failures where
`python` is actually python3 or later.
2013-08-28 02:17:13 -07:00
Vadim Chugunov
653825889e Turned off libstd unit tests that currently fail on Windows. 2013-08-28 01:44:25 -07:00
Vadim Chugunov
6828428cad Disabled failing parts of abs_sub() and frexp() unit tests on Windows. 2013-08-28 01:44:12 -07:00
Vadim Chugunov
99345d8d17 Fixed MemoryMap on Windows. 2013-08-28 01:44:12 -07:00
Vadim Chugunov
546e2ae850 Added libstd and libextra unit tests to check-fast target. 2013-08-28 01:44:12 -07:00
Florian Hahn
8557219cd8 Add tests for ref in closure parameter list, closes #5239 2013-08-28 10:12:28 +02:00
Alex Crichton
e3662b1880 Remove offset_inbounds for an unsafe offset function 2013-08-27 23:22:52 -07:00
bors
78c5f97a09 auto merge of #8805 : jfager/rust/remove-hashutil, r=alexcrichton 2013-08-27 23:05:35 -07:00
bors
b8d1fa3994 auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, r=brson
This overhauls `std::run` to instead run on top of libuv. This is *not* in a mergeable state, I've been attempting to diagnose failures in the compiletest suite. I've managed to find a fair number of bugs so far, but I still  don't seem to be done yet.

Notable changes:
* This requires upgrading libuv. From the discussion on #6567, I took libuv master from a few days ago, applied one patch to fix process spawning with multiple event loops in libuv, and pushed to my own fork
* The build system for libuv has changed since we last used it. There's some extra checkout from a google build system which apparently does all the magic if you don't want to require autotools, and the google system just requires python. I updated the Makefile to get this build system and build libuv with it instead. This is untested on windows and arm, and both will probably need to see some improvement.
* This required adding some pipe bindings to libuv as well. Currently the support is pretty simple and probably completely unsafe for pipes, but you at least get read/write methods. This is necessary for capturing output of processes.
* I didn't redesign `std::run` at all, I simply tried to reimplement all the existing functionality on top of libuv. Some functions ended up dying, but nothing major. All uses of `std::run` in the compiler still work just fine.

I'm not quite sure how the rest of the runtime deals with this, but I marked process structures as `no_send` because the waiting/waking up has to happen in the same event loop right now. If processes start migrating between event loops then very bad things can happen. This may be what threadsafe I/O would fix, and I would be more than willing to rebase on that if it lands first.

Anyway, for now I wanted to put this up for review, I'm still investigating the corruption/deadlock bugs, but this is in an *almost* workable state. Once I find the bugs I'll also rebase on the current master.
2013-08-27 21:55:42 -07:00
klutzy
eaa565829d rustc: Use "main" entry point on Windows
Fixes #8510.
2013-08-28 13:43:11 +09:00
Alex Crichton
06a7195e9e Consolidate local_data implementations, and cleanup
This moves all local_data stuff into the `local_data` module and only that
module alone. It also removes a fair amount of "super-unsafe" code in favor of
just vanilla code generated by the compiler at the same time.

Closes #8113
2013-08-27 21:29:11 -07:00
Alex Crichton
4635644746 Fix merge fallout 2013-08-27 20:53:26 -07:00
Alex Crichton
2ad05ae014 Fix various issues associated with building on windows 2013-08-27 20:46:43 -07:00
Alex Crichton
b89e1c000e Implement process bindings to libuv
Closes #6436
2013-08-27 20:46:43 -07:00
Alex Crichton
ed204257a0 Upgrade libuv to the current master + our patches
There were two main differences with the old libuv and the master version:

1. The uv_last_error function is now gone. The error code returned by each
   function is the "last error" so now a UvError is just a wrapper around a
   c_int.
2. The repo no longer includes a makefile, and the build system has change.
   According to the build directions on joyent/libuv, this now downloads a `gyp`
   program into the `libuv/build` directory and builds using that. This
   shouldn't add any dependences on autotools or anything like that.

Closes #8407
Closes #6567
Closes #6315
2013-08-27 20:46:17 -07:00
bors
f22b4b1698 auto merge of #8697 : kballard/rust/rustpkg-no-args, r=catamorphism
`rustpkg build` et al were only checking one directory up to see if it
was in a dir named "src". Ditch that entirely and instead check if the
cwd is descended from any of the workspace paths. Besides being more
intelligent about whether or not something is a workspace, this also
allows for package ids composed of multiple path components.

r? @catamorphism
2013-08-27 20:45:40 -07:00