Commit Graph

24032 Commits

Author SHA1 Message Date
bors
d3cb24b1fe auto merge of #10610 : thestinger/rust/breakpoint, r=pnkfelix
This can be used to grab the attention of a debugger, and unlike
`abort` execution can be resumed.
2013-11-22 07:31:35 -08:00
Daniel Micay
bf61641e9f add a breakpoint intrinsic for debugging
This can be used to grab the attention of a debugger, and unlike
`abort` execution can be resumed.
2013-11-22 10:29:04 -05:00
bors
cad1f89bb5 auto merge of #10608 : thestinger/rust/managed, r=huonw 2013-11-22 05:52:01 -08:00
bors
a9b1dcf24a auto merge of #10606 : huonw/rust/lint-unsafe-in-macro, r=thestinger
Add a test for the case I mentioned on #10599.
2013-11-22 04:41:33 -08:00
Huon Wilson
efe9d744f9 syntax: add a visit_ident method to the Visitor. 2013-11-22 23:24:49 +11:00
Daniel Micay
7d9fd62300 minor rewording in the tutorial's Rc coverage 2013-11-22 07:03:11 -05:00
Daniel Micay
d97ce15c14 mention Gc in the managed box feature gate 2013-11-22 07:02:56 -05:00
bors
8d87e9da21 auto merge of #10582 : g3xzh/rust/master, r=cmr
More new benchmark tests. some of them are benchmarking `starts_with` and `ends_with`.
Let me know if I am missing something.
Thanks in advance.
2013-11-22 03:31:37 -08:00
g3xzh
80dff18641 Add more benchmark tests to vec.rs
New benchmark tests in vec.rs:
`push`, `starts_with_same_vector`, `starts_with_single_element`,
`starts_with_diff_one_element_end`, `ends_with_same_vector`,
`ends_with_single_element`, `ends_with_diff_one_element_beginning` and
`contains_last_element`
2013-11-22 13:24:16 +02:00
Huon Wilson
971d306fe2 test: test that the unsafe_block lint picks up unsafe blocks in
macros.
2013-11-22 22:23:04 +11:00
bors
747213a280 auto merge of #10588 : huonw/rust/un@mutilate-task_rng, r=alexcrichton
Replace with some unsafe code by storing a pointer into TLS-owned heap
data.
2013-11-21 21:51:26 -08:00
Huon Wilson
020126ef75 std::rand: move TaskRng off @mut.
Replace with some unsafe code by storing a pointer into TLS-owned heap
data.
2013-11-22 16:47:01 +11:00
bors
1dea21f41d auto merge of #10599 : thestinger/rust/unsafe, r=cmr
This is just meant to be for containing usage of `unsafe`, much like `heap_memory`.
2013-11-21 17:26:31 -08:00
bors
6143400aaa auto merge of #10589 : thestinger/rust/doc, r=pcwalton
This replaces the old section on managed pointers because the syntax is
going to be removed and it's currently feature gated so the examples
don't work out-of-the-box. Dynamic mutability coverage can be added
after the `Mut<T>` work has landed.
2013-11-21 16:06:32 -08:00
Daniel Micay
c06ce4c9bf tutorial: alternatives to ownership
This replaces the old section on managed pointers because the syntax is
going to be removed and it's currently feature gated so the examples
don't work out-of-the-box. Dynamic mutability coverage can be added
after the `Mut<T>` work has landed.
2013-11-21 18:00:31 -05:00
Daniel Micay
a1afe9cc0a add lint for unsafe blocks 2013-11-21 17:58:49 -05:00
bors
76d4848050 auto merge of #10598 : alexcrichton/rust/rustdoc, r=thestinger
This prevents an assertion from being tripped because the generics weren't
categorized.

Closes #10597
2013-11-21 14:56:37 -08:00
Alex Crichton
0036f7bbba Process ffi generics in rustdoc
This prevents an assertion from being tripped because the generics weren't
categorized.

Closes #10597
2013-11-21 13:18:40 -08:00
bors
61e07d6792 auto merge of #10595 : hatahet/rust/master, r=thestinger
Closes #10579
2013-11-21 12:56:44 -08:00
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
97aaf42462 auto merge of #10587 : thestinger/rust/stack, r=pcwalton 2013-11-21 10:21:37 -08:00
Daniel Micay
1de47cb842 remove segmented stacks from the manual 2013-11-21 12:55:46 -05:00
bors
8464004c76 auto merge of #10584 : klutzy/rust/local-rust-root, r=alexcrichton
Fixes #8756.
2013-11-21 08:26:50 -08:00
bors
85a1eff3a9 auto merge of #10590 : sanxiyn/rust/ty-mac, r=thestinger 2013-11-21 06:16:49 -08:00
Seo Sanghyeon
8470639319 Remove ty_mac 2013-11-21 22:59:56 +09:00
bors
ea5d1dfb1c auto merge of #10567 : sanxiyn/rust/bytepos, r=alexcrichton 2013-11-20 23:31:27 -08:00
bors
f804bd94d5 auto merge of #10585 : idupree/rust/master, r=catamorphism 2013-11-20 20:56:27 -08:00
Isaac Dupree
aa9efa1f7a update manual to reflect &'lifetime syntax 2013-11-20 23:50:10 -05:00
klutzy
11b6aed4a5 Fix --local-rust-root option on Windows 2013-11-21 12:32:03 +09: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
Seo Sanghyeon
f4c1f49049 Fix parsing tests 2013-11-21 01:32:29 +09:00
Seo Sanghyeon
5e1e487624 Make BytePos 32-bit 2013-11-20 16:51:25 +09: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