Commit Graph

23902 Commits

Author SHA1 Message Date
Ziad Hatahet
248cb90dfa std::ptr::read_ptr now takes *T instead of *mut T
Closes #10579
2013-11-21 11:31:58 -08:00
bors
760942d7d2 auto merge of #10576 : thestinger/rust/gc, r=pcwalton
This isn't very useful yet, but it does replace most functionality of `@T`. The `Mut<T>` type will make it unnecessary to have a `GcMut<T>` so I haven't included one. Obviously it doesn't work for trait objects but that needs to be figured out for `Rc<T>` too.
2013-11-20 14:16:23 -08:00
bors
e12bc239b4 auto merge of #10527 : eholk/rust/win64, r=alexcrichton
This was needed to access UEFI boot services in my new Boot2Rust experiment.

I also realized that Rust functions declared as extern always use the C calling convention regardless of how they were declared, so this pull request fixes that as well.
2013-11-20 11:01:34 -08:00
Daniel Micay
543cae9a46 add an initial Gc<T> stub with the API 2013-11-19 23:52:43 -05:00
bors
6a25ba374b auto merge of #10575 : sfackler/rust/non-copyable, r=huonw
The issue that required it has been fixed.
2013-11-19 20:31:21 -08:00
Steven Fackler
3e637d505e Remove NonCopyable::new
The issue that required it has been fixed.
2013-11-19 20:27:48 -08:00
bors
c159acb05d auto merge of #10568 : pcwalton/rust/more-bars, r=alexcrichton
r? @alexcrichton
2013-11-19 13:31:19 -08:00
Patrick Walton
7e3f20133a librustc: Change most uses of &fn() to ||. 2013-11-19 13:22:03 -08:00
Patrick Walton
492677ec1e libsyntax: Change all uses of &fn to ||. 2013-11-19 12:40:19 -08:00
Patrick Walton
18a30aff45 libextra: Convert uses of &fn(A)->B to |A|->B. 2013-11-19 12:40:19 -08:00
Patrick Walton
1946265e1a libstd: Change all uses of &fn(A)->B over to |A|->B in libstd 2013-11-19 12:40:19 -08:00
bors
eef913b290 auto merge of #10495 : alexcrichton/rust/more-native-io, r=brson
This implements a fair amount of the unimpl() functionality in io::native
relating to filesystem operations. I've also modified all io::fs tests to run in
both a native and uv environment (so everything is actually tested).

There are a few bits of remaining functionality which I was unable to get
working:

* truncate on windows
* change_file_times on windows
* lstat on windows

I think that change_file_times may just need a better interface, but the other
two have large implementations in libuv which I didn't want to tackle trying to
copy. I found a `chsize` function to work for truncate on windows, but it
doesn't quite seem to be working out.
2013-11-19 10:56:42 -08:00
Alex Crichton
68d5510292 Implement more native file I/O
This implements a fair amount of the unimpl() functionality in io::native
relating to filesystem operations. I've also modified all io::fs tests to run in
both a native and uv environment (so everything is actually tested).

There are a two bits of remaining functionality which I was unable to get
working:

* change_file_times on windows
* lstat on windows

I think that change_file_times may just need a better interface, but lstat has a
large implementation in libuv which I didn't want to tackle trying to copy.
2013-11-19 09:59:21 -08:00
Eric Holk
02e565a187 Don't use win64 calling convention on 32-bit machines. 2013-11-19 12:46:28 -05:00
bors
d57765d8a9 auto merge of #10558 : alexcrichton/rust/faster-stdout, r=pcwalton,pcwalton
There are issues with reading stdin when it is actually attached to a pipe, but
I have run into no problems in writing to stdout/stderr when they are attached
to pipes.
2013-11-19 05:16:24 -08:00
bors
32f6c11dfa auto merge of #10557 : huonw/rust/inline-deriving, r=pcwalton
ToStr, Encodable and Decodable are not marked as such, since they're
already expensive, and lead to large methods, so inlining will bloat the
metadata & the binaries.

This means that something like

    #[deriving(Eq)]
    struct A { x: int }

creates an instance like

    #[doc = "Automatically derived."]
    impl ::std::cmp::Eq for A {
        #[inline]
        fn eq(&self, __arg_0: &A) -> ::bool {
            match *__arg_0 {
                A{x: ref __self_1_0} =>
                match *self {
                    A{x: ref __self_0_0} => true && __self_0_0.eq(__self_1_0)
                }
            }
        }
        #[inline]
        fn ne(&self, __arg_0: &A) -> ::bool {
            match *__arg_0 {
                A{x: ref __self_1_0} =>
                match *self {
                    A{x: ref __self_0_0} => false || __self_0_0.ne(__self_1_0)
                }
            }
        }
    }

(The change being the `#[inline]` attributes.)
2013-11-19 04:06:25 -08:00
bors
c4e28ae068 auto merge of #10542 : huonw/rust/open01, r=alexcrichton
Provide `Closed01` and `Open01` that generate directly from the
closed/open intervals from 0 to 1, in contrast to the plain impls for
f32 and f64 which generate the half-open [0,1).

Fixes #7755.
2013-11-19 00:26:27 -08:00
bors
f4c22f75d4 auto merge of #10561 : pcwalton/rust/procify, r=alexcrichton
r? @alexcrichton
2013-11-18 23:06:29 -08:00
bors
f5f5d5aac7 auto merge of #10479 : alexcrichton/rust/native-mutex.rs, r=cmr
This adds a new `std::unstable::mutex` module which contains bindings to the platform-provided mutexes. This module is pretty much entirely unsafe to use, but is critical for the runtime and dropping our C++ dependency.

The actual implementation is to do a compare-and-swap on an initially uninitialized pointer. Pthreads does allow for static initialization, so this wouldn't be necessary if we had all the proper headers and whatnot, but windows it looks like will always require some sort of compare-and-swap operation. For now, I didn't want to have to define all the pthreads headers, so I continue to just malloc the pthreads lock/cvar.

After this, there's only one remaining C++ component of rust, and that's unwinding.
2013-11-18 21:51:31 -08:00
Alex Crichton
508b7b996e Move runtime files to C instead of C++
Explicitly have the only C++ portion of the runtime be one file with exception
handling. All other runtime files must now live in C and be fully defined in C.
2013-11-18 21:45:58 -08:00
Alex Crichton
e8bf078802 Remove the C++ lock_and_signal type
A the same time this purges all runtime support needed for statically
initialized mutexes, moving all users over to the new Mutex type instead.
2013-11-18 20:06:40 -08:00
Alex Crichton
24eb1b445d Implement a native mutex type
This mutex is built on top of pthreads for unix and the related windows apis on
windows. This is a straight port of the lock_and_signal type from C++ to rust.
Almost all operations on the type are unsafe, and it's definitely not
recommended for general use.

Closes #9105
2013-11-18 20:06:39 -08:00
bors
ab7fe9dd06 auto merge of #10458 : yichoi/rust/make_check_pass_android2, r=brson
To enable test on android bot #9120

 workcache::test disabled and run-pass/core-run-destroy.rs fixed on android
2013-11-18 18:56:31 -08:00
Patrick Walton
f977bedafd libsyntax: Remove ~fn() from the language 2013-11-18 18:28:10 -08:00
Patrick Walton
ba739b2135 librustc: Convert ~fn() to proc() everywhere. 2013-11-18 18:27:31 -08:00
Patrick Walton
77f621bff4 librustc: Remove the one use of ~fn() 2013-11-18 18:27:30 -08:00
Patrick Walton
6a5736d704 libextra: Remove ~fn() from libextra. 2013-11-18 18:27:30 -08:00
Patrick Walton
500a8f15c9 libstd: Change all ~fn()s to procs in the standard library.
This makes `Cell`s no longer necessary in most cases.
2013-11-18 18:27:30 -08:00
bors
2a984c92a8 auto merge of #10440 : brson/rust/cnamespace, r=bstrie 2013-11-18 17:46:32 -08:00
bors
7fc3e82aae auto merge of #10366 : brson/rust/ignore-patterns, r=alexcrichton
This replaces `*` with `..` in enums, `_` with `..` in structs, and `.._` with `..` in vectors. It adds obsolete syntax warnings for the old forms but doesn't turn them on yet because we need a snapshot.

#5830
2013-11-18 16:36:33 -08:00
Alex Crichton
10b956a012 Allow piped stdout/stderr use uv_tty_t
There are issues with reading stdin when it is actually attached to a pipe, but
I have run into no problems in writing to stdout/stderr when they are attached
to pipes.
2013-11-18 16:29:41 -08:00
Eric Holk
5b534e4a22 Use the correct calling convention for extern rust functions. 2013-11-18 19:20:09 -05:00
Eric Holk
50fb4be1cc Add Win64 calling convention. 2013-11-18 19:20:09 -05:00
Brian Anderson
85f107d8cb Use '..' as slice wildcard in vectors 2013-11-18 16:19:48 -08:00
Brian Anderson
35e6c02524 Use '..' as multi-field wildcard in enums and structs. 2013-11-18 16:19:46 -08:00
Huon Wilson
df0f50381c Mark some derived methods as #[inline].
ToStr, Encodable and Decodable are not marked as such, since they're
already expensive, and lead to large methods, so inlining will bloat the
metadata & the binaries.

This means that something like

    #[deriving(Eq)]
    struct A { x: int }

creates an instance like

    #[doc = "Automatically derived."]
    impl ::std::cmp::Eq for A {
        #[inline]
        fn eq(&self, __arg_0: &A) -> ::bool {
            match *__arg_0 {
                A{x: ref __self_1_0} =>
                match *self {
                    A{x: ref __self_0_0} => true && __self_0_0.eq(__self_1_0)
                }
            }
        }
        #[inline]
        fn ne(&self, __arg_0: &A) -> ::bool {
            match *__arg_0 {
                A{x: ref __self_1_0} =>
                match *self {
                    A{x: ref __self_0_0} => false || __self_0_0.ne(__self_1_0)
                }
            }
        }
    }

(The change being the `#[inline]` attributes.)
2013-11-19 11:18:34 +11:00
Brian Anderson
f4c222f7a3 rt: Namespace all C functions under rust_ 2013-11-18 16:17:43 -08:00
Young-il Choi
68024eb4eb android support added to test case 2013-11-19 09:08:47 +09:00
Young-il Choi
093757ca80 add path environments 2013-11-19 09:08:47 +09:00
Young-il Choi
c45870b85e fix #10450 2013-11-19 09:08:47 +09:00
Young-il Choi
88831383b4 temporarily disable tests on android and tagging issue number #10455 2013-11-19 09:08:47 +09:00
bors
9062988610 auto merge of #10552 : michaelwoerister/rust/ifstepping, r=brson
This PR improves the single-stepping experience for if-expression (no more jumping into the *else* branch before entering the *then* branch, no more jumping to the end of the *else* branch after finishing the *then* branch). Unfortunately I don't know of a straight-forward way of writing automated tests for this. Suggestions welcome!
2013-11-18 15:26:29 -08:00
bors
3d569df41d auto merge of #10555 : TeXitoi/rust/pidigits-resurected, r=alexcrichton
Changes:
* default value when no args
* license
* removed libc printing
* use extra::bigint instead of handmade gmp binding

The drawback is that it's 2 order of magnitude slower, the good news is that there is a good bench for extra::bigint.
2013-11-18 13:46:55 -08:00
Guillaume Pinot
ec27c09bdf pidigits resurected
Changes:
* default value when no args
* license
* removed libc printing
* use extra::bigint instead of handmade gmp binding
2013-11-18 22:23:38 +01:00
bors
6c8b702cf7 auto merge of #10539 : alexcrichton/rust/external-linkage, r=pcwalton
If a function is marked as external, then it's likely desired for use with some
native library, so we're not really accomplishing a whole lot by internalizing
all of these symbols.
2013-11-18 10:26:49 -08:00
Alex Crichton
4ddeef35e5 Don't mark reachable extern fns as internal
If a function is marked as external, then it's likely desired for use with some
native library, so we're not really accomplishing a whole lot by internalizing
all of these symbols.
2013-11-18 10:21:58 -08:00
Michael Woerister
d0872eb692 debuginfo: Improved stepping for if-expressions 2013-11-18 16:56:44 +01:00
Huon Wilson
e6fb622af1 std::rand: wrappers for floats from [0,1] and (0,1).
Provide `Closed01` and `Open01` that generate directly from the
closed/open intervals from 0 to 1, in contrast to the plain impls for
f32 and f64 which generate the half-open [0,1).

Fixes #7755.
2013-11-18 23:12:01 +11:00
bors
4dded4345f auto merge of #10508 : chris-morgan/rust/tags-improvements, r=cmr
Largely, this is just being more specific about where tags get searched
for to remove external dependencies like src/llvm, which reduces the
number of tags *enormously* and significantly increases the usefulness
of the tags file as it is then focusing on 240K lines of Rust code
and 4.5K of C++ rather than just shy of 1M lines of C++ code (mostly
from LLVM) and another 100K lines of Rust tests and a diverse collection
of other languages.

src/rustllvm/RustWrapper.cpp and src/rustllvm/PassWrapper.cpp are
getting tags made, but I'm not sure if that's desirable or not. At
worst, it's not a significant wrong.

A future, desirable step is producing tags for just libstd and libextra
for the use of people using Rust-the-language rather than working on
Rust itself.
2013-11-17 23:41:25 -08:00
bors
8eda5d8315 auto merge of #10443 : alexcrichton/rust/meaninless-pub-priv, r=cmr
Closes #10111
2013-11-17 22:21:23 -08:00