]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agomk: Get rid of redundant LIBUV_FLAGS.
Luqman Aden [Wed, 20 Nov 2013 11:00:49 +0000 (06:00 -0500)]
mk: Get rid of redundant LIBUV_FLAGS.

10 years agoFix up mingw64 target.
Luqman Aden [Wed, 20 Nov 2013 06:30:51 +0000 (01:30 -0500)]
Fix up mingw64 target.

10 years agoauto merge of #10583 : alexcrichton/rust/privacy-reexport, r=pcwalton
bors [Fri, 22 Nov 2013 18:06:35 +0000 (10:06 -0800)]
auto merge of #10583 : alexcrichton/rust/privacy-reexport, r=pcwalton

I added a test case which does not compile today, and required changes on
privacy's side of things to get right. Additionally, this moves a good bit of
logic which did not belong in reachability into privacy.

All of reachability should solely be responsible for determining what the
reachable surface area of a crate is given the exported surface area (where the
exported surface area is that which is usable by external crates).

Privacy will now correctly figure out what's exported by deeply looking
through reexports. Previously if a module were reexported under another name,
nothing in the module would actually get exported in the executable. I also
consolidated the phases of privacy to be clearer about what's an input to what.
The privacy checking pass no longer uses the notion of an "all public" path, and
the embargo visitor is no longer an input to the checking pass.

Currently the embargo visitor is built as a saturating analysis because it's
unknown what portions of the AST are going to get re-exported.

This also cracks down on exported methods from impl blocks and trait blocks. If you implement a private trait, none of the symbols are exported, and if you have an impl for a private type none of the symbols are exported either. On the other hand, if you implement a public trait for a private type, the symbols are still exported. I'm unclear on whether this last part is correct, but librustc will fail to link unless it's in place.

10 years agoMove more of the exportation burden into privacy
Alex Crichton [Wed, 20 Nov 2013 23:15:34 +0000 (15:15 -0800)]
Move more of the exportation burden into privacy

I added a test case which does not compile today, and required changes on
privacy's side of things to get right. Additionally, this moves a good bit of
logic which did not belong in reachability into privacy.

All of reachability should solely be responsible for determining what the
reachable surface area of a crate is given the exported surface area (where the
exported surface area is that which is usable by external crates).

Privacy will now correctly figure out what's exported by deeply looking
through reexports. Previously if a module were reexported under another name,
nothing in the module would actually get exported in the executable. I also
consolidated the phases of privacy to be clearer about what's an input to what.
The privacy checking pass no longer uses the notion of an "all public" path, and
the embargo visitor is no longer an input to the checking pass.

Currently the embargo visitor is built as a saturating analysis because it's
unknown what portions of the AST are going to get re-exported.

10 years agoauto merge of #10610 : thestinger/rust/breakpoint, r=pnkfelix
bors [Fri, 22 Nov 2013 15:31:35 +0000 (07:31 -0800)]
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.

10 years agoadd a breakpoint intrinsic for debugging
Daniel Micay [Fri, 22 Nov 2013 15:12:56 +0000 (10:12 -0500)]
add a breakpoint intrinsic for debugging

This can be used to grab the attention of a debugger, and unlike
`abort` execution can be resumed.

10 years agoauto merge of #10608 : thestinger/rust/managed, r=huonw
bors [Fri, 22 Nov 2013 13:52:01 +0000 (05:52 -0800)]
auto merge of #10608 : thestinger/rust/managed, r=huonw

10 years agoauto merge of #10606 : huonw/rust/lint-unsafe-in-macro, r=thestinger
bors [Fri, 22 Nov 2013 12:41:33 +0000 (04:41 -0800)]
auto merge of #10606 : huonw/rust/lint-unsafe-in-macro, r=thestinger

Add a test for the case I mentioned on #10599.

10 years agominor rewording in the tutorial's `Rc` coverage
Daniel Micay [Fri, 22 Nov 2013 12:03:11 +0000 (07:03 -0500)]
minor rewording in the tutorial's `Rc` coverage

10 years agomention `Gc` in the managed box feature gate
Daniel Micay [Fri, 22 Nov 2013 11:54:33 +0000 (06:54 -0500)]
mention `Gc` in the managed box feature gate

10 years agoauto merge of #10582 : g3xzh/rust/master, r=cmr
bors [Fri, 22 Nov 2013 11:31:37 +0000 (03:31 -0800)]
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.

10 years agoAdd more benchmark tests to vec.rs
g3xzh [Wed, 20 Nov 2013 21:19:48 +0000 (23:19 +0200)]
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`

10 years agotest: test that the `unsafe_block` lint picks up `unsafe` blocks in
Huon Wilson [Fri, 22 Nov 2013 11:23:04 +0000 (22:23 +1100)]
test: test that the `unsafe_block` lint picks up `unsafe` blocks in
macros.

10 years agoauto merge of #10588 : huonw/rust/un@mutilate-task_rng, r=alexcrichton
bors [Fri, 22 Nov 2013 05:51:26 +0000 (21:51 -0800)]
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.

10 years agostd::rand: move TaskRng off @mut.
Huon Wilson [Thu, 21 Nov 2013 08:46:29 +0000 (19:46 +1100)]
std::rand: move TaskRng off @mut.

Replace with some unsafe code by storing a pointer into TLS-owned heap
data.

10 years agoauto merge of #10599 : thestinger/rust/unsafe, r=cmr
bors [Fri, 22 Nov 2013 01:26:31 +0000 (17:26 -0800)]
auto merge of #10599 : thestinger/rust/unsafe, r=cmr

This is just meant to be for containing usage of `unsafe`, much like `heap_memory`.

10 years agoauto merge of #10589 : thestinger/rust/doc, r=pcwalton
bors [Fri, 22 Nov 2013 00:06:32 +0000 (16:06 -0800)]
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.

10 years agotutorial: alternatives to ownership
Daniel Micay [Thu, 21 Nov 2013 10:52:33 +0000 (05:52 -0500)]
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.

10 years agoadd lint for `unsafe` blocks
Daniel Micay [Thu, 21 Nov 2013 22:36:54 +0000 (17:36 -0500)]
add lint for `unsafe` blocks

10 years agoauto merge of #10598 : alexcrichton/rust/rustdoc, r=thestinger
bors [Thu, 21 Nov 2013 22:56:37 +0000 (14:56 -0800)]
auto merge of #10598 : alexcrichton/rust/rustdoc, r=thestinger

This prevents an assertion from being tripped because the generics weren't
categorized.

Closes #10597

10 years agoProcess ffi generics in rustdoc
Alex Crichton [Thu, 21 Nov 2013 21:17:46 +0000 (13:17 -0800)]
Process ffi generics in rustdoc

This prevents an assertion from being tripped because the generics weren't
categorized.

Closes #10597

10 years agoauto merge of #10595 : hatahet/rust/master, r=thestinger
bors [Thu, 21 Nov 2013 20:56:44 +0000 (12:56 -0800)]
auto merge of #10595 : hatahet/rust/master, r=thestinger

Closes #10579

10 years ago`std::ptr::read_ptr` now takes `*T` instead of `*mut T`
Ziad Hatahet [Thu, 21 Nov 2013 19:31:58 +0000 (11:31 -0800)]
`std::ptr::read_ptr` now takes `*T` instead of `*mut T`

Closes #10579

10 years agoauto merge of #10587 : thestinger/rust/stack, r=pcwalton
bors [Thu, 21 Nov 2013 18:21:37 +0000 (10:21 -0800)]
auto merge of #10587 : thestinger/rust/stack, r=pcwalton

10 years agoremove segmented stacks from the manual
Daniel Micay [Thu, 21 Nov 2013 08:39:15 +0000 (03:39 -0500)]
remove segmented stacks from the manual

10 years agoauto merge of #10584 : klutzy/rust/local-rust-root, r=alexcrichton
bors [Thu, 21 Nov 2013 16:26:50 +0000 (08:26 -0800)]
auto merge of #10584 : klutzy/rust/local-rust-root, r=alexcrichton

Fixes #8756.

10 years agoauto merge of #10590 : sanxiyn/rust/ty-mac, r=thestinger
bors [Thu, 21 Nov 2013 14:16:49 +0000 (06:16 -0800)]
auto merge of #10590 : sanxiyn/rust/ty-mac, r=thestinger

10 years agoRemove ty_mac
Seo Sanghyeon [Thu, 21 Nov 2013 13:59:56 +0000 (22:59 +0900)]
Remove ty_mac

10 years agoauto merge of #10567 : sanxiyn/rust/bytepos, r=alexcrichton
bors [Thu, 21 Nov 2013 07:31:27 +0000 (23:31 -0800)]
auto merge of #10567 : sanxiyn/rust/bytepos, r=alexcrichton

10 years agoauto merge of #10585 : idupree/rust/master, r=catamorphism
bors [Thu, 21 Nov 2013 04:56:27 +0000 (20:56 -0800)]
auto merge of #10585 : idupree/rust/master, r=catamorphism

10 years agoupdate manual to reflect &'lifetime syntax
Isaac Dupree [Thu, 21 Nov 2013 04:50:10 +0000 (23:50 -0500)]
update manual to reflect &'lifetime syntax

10 years agoFix --local-rust-root option on Windows
klutzy [Thu, 21 Nov 2013 03:29:40 +0000 (12:29 +0900)]
Fix --local-rust-root option on Windows

10 years agoauto merge of #10576 : thestinger/rust/gc, r=pcwalton
bors [Wed, 20 Nov 2013 22:16:23 +0000 (14:16 -0800)]
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.

10 years agoauto merge of #10527 : eholk/rust/win64, r=alexcrichton
bors [Wed, 20 Nov 2013 19:01:34 +0000 (11:01 -0800)]
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.

10 years agoFix parsing tests
Seo Sanghyeon [Wed, 20 Nov 2013 16:32:29 +0000 (01:32 +0900)]
Fix parsing tests

10 years agoMake BytePos 32-bit
Seo Sanghyeon [Tue, 19 Nov 2013 17:15:49 +0000 (02:15 +0900)]
Make BytePos 32-bit

10 years agoadd an initial `Gc<T>` stub with the API
Daniel Micay [Wed, 20 Nov 2013 04:20:06 +0000 (23:20 -0500)]
add an initial `Gc<T>` stub with the API

10 years agoauto merge of #10575 : sfackler/rust/non-copyable, r=huonw
bors [Wed, 20 Nov 2013 04:31:21 +0000 (20:31 -0800)]
auto merge of #10575 : sfackler/rust/non-copyable, r=huonw

The issue that required it has been fixed.

10 years agoRemove NonCopyable::new
Steven Fackler [Wed, 20 Nov 2013 04:19:05 +0000 (20:19 -0800)]
Remove NonCopyable::new

The issue that required it has been fixed.

10 years agoauto merge of #10568 : pcwalton/rust/more-bars, r=alexcrichton
bors [Tue, 19 Nov 2013 21:31:19 +0000 (13:31 -0800)]
auto merge of #10568 : pcwalton/rust/more-bars, r=alexcrichton

r? @alexcrichton

10 years agolibrustc: Change most uses of `&fn()` to `||`.
Patrick Walton [Tue, 19 Nov 2013 21:22:03 +0000 (13:22 -0800)]
librustc: Change most uses of `&fn()` to `||`.

10 years agolibsyntax: Change all uses of `&fn` to `||`.
Patrick Walton [Tue, 19 Nov 2013 20:21:21 +0000 (12:21 -0800)]
libsyntax: Change all uses of `&fn` to `||`.

10 years agolibextra: Convert uses of `&fn(A)->B` to `|A|->B`.
Patrick Walton [Tue, 19 Nov 2013 05:54:13 +0000 (21:54 -0800)]
libextra: Convert uses of `&fn(A)->B` to `|A|->B`.

10 years agolibstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstd
Patrick Walton [Tue, 19 Nov 2013 05:15:42 +0000 (21:15 -0800)]
libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstd

10 years agoauto merge of #10495 : alexcrichton/rust/more-native-io, r=brson
bors [Tue, 19 Nov 2013 18:56:42 +0000 (10:56 -0800)]
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.

10 years agoImplement more native file I/O
Alex Crichton [Wed, 13 Nov 2013 22:48:45 +0000 (14:48 -0800)]
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.

10 years agoDon't use win64 calling convention on 32-bit machines.
Eric Holk [Tue, 19 Nov 2013 17:46:28 +0000 (12:46 -0500)]
Don't use win64 calling convention on 32-bit machines.

10 years agoauto merge of #10558 : alexcrichton/rust/faster-stdout, r=pcwalton,pcwalton
bors [Tue, 19 Nov 2013 13:16:24 +0000 (05:16 -0800)]
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.

10 years agoauto merge of #10557 : huonw/rust/inline-deriving, r=pcwalton
bors [Tue, 19 Nov 2013 12:06:25 +0000 (04:06 -0800)]
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.)

10 years agoauto merge of #10542 : huonw/rust/open01, r=alexcrichton
bors [Tue, 19 Nov 2013 08:26:27 +0000 (00:26 -0800)]
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.

10 years agoauto merge of #10561 : pcwalton/rust/procify, r=alexcrichton
bors [Tue, 19 Nov 2013 07:06:29 +0000 (23:06 -0800)]
auto merge of #10561 : pcwalton/rust/procify, r=alexcrichton

r? @alexcrichton

10 years agoauto merge of #10479 : alexcrichton/rust/native-mutex.rs, r=cmr
bors [Tue, 19 Nov 2013 05:51:31 +0000 (21:51 -0800)]
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.

10 years agoMove runtime files to C instead of C++
Alex Crichton [Thu, 14 Nov 2013 18:04:55 +0000 (10:04 -0800)]
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.

10 years agoRemove the C++ lock_and_signal type
Alex Crichton [Thu, 14 Nov 2013 08:21:43 +0000 (00:21 -0800)]
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.

10 years agoImplement a native mutex type
Alex Crichton [Thu, 14 Nov 2013 07:17:18 +0000 (23:17 -0800)]
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

10 years agoauto merge of #10458 : yichoi/rust/make_check_pass_android2, r=brson
bors [Tue, 19 Nov 2013 02:56:31 +0000 (18:56 -0800)]
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

10 years agolibsyntax: Remove `~fn()` from the language
Patrick Walton [Tue, 19 Nov 2013 02:25:25 +0000 (18:25 -0800)]
libsyntax: Remove `~fn()` from the language

10 years agolibrustc: Convert `~fn()` to `proc()` everywhere.
Patrick Walton [Tue, 19 Nov 2013 01:40:54 +0000 (17:40 -0800)]
librustc: Convert `~fn()` to `proc()` everywhere.

10 years agolibrustc: Remove the one use of `~fn()`
Patrick Walton [Mon, 18 Nov 2013 23:40:29 +0000 (15:40 -0800)]
librustc: Remove the one use of `~fn()`

10 years agolibextra: Remove `~fn()` from libextra.
Patrick Walton [Mon, 18 Nov 2013 23:39:02 +0000 (15:39 -0800)]
libextra: Remove `~fn()` from libextra.

10 years agolibstd: Change all `~fn()`s to `proc`s in the standard library.
Patrick Walton [Mon, 18 Nov 2013 21:25:09 +0000 (13:25 -0800)]
libstd: Change all `~fn()`s to `proc`s in the standard library.

This makes `Cell`s no longer necessary in most cases.

10 years agoauto merge of #10440 : brson/rust/cnamespace, r=bstrie
bors [Tue, 19 Nov 2013 01:46:32 +0000 (17:46 -0800)]
auto merge of #10440 : brson/rust/cnamespace, r=bstrie

10 years agoauto merge of #10366 : brson/rust/ignore-patterns, r=alexcrichton
bors [Tue, 19 Nov 2013 00:36:33 +0000 (16:36 -0800)]
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

10 years agoAllow piped stdout/stderr use uv_tty_t
Alex Crichton [Tue, 19 Nov 2013 00:26:03 +0000 (16:26 -0800)]
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.

10 years agoUse the correct calling convention for extern rust functions.
Eric Holk [Sun, 17 Nov 2013 00:59:08 +0000 (19:59 -0500)]
Use the correct calling convention for extern rust functions.

10 years agoAdd Win64 calling convention.
Eric Holk [Sat, 16 Nov 2013 23:25:56 +0000 (18:25 -0500)]
Add Win64 calling convention.

10 years agoUse '..' as slice wildcard in vectors
Brian Anderson [Fri, 8 Nov 2013 03:25:39 +0000 (19:25 -0800)]
Use '..' as slice wildcard in vectors

10 years agoUse '..' as multi-field wildcard in enums and structs.
Brian Anderson [Sat, 2 Nov 2013 01:02:30 +0000 (18:02 -0700)]
Use '..' as multi-field wildcard in enums and structs.

10 years agoMark some derived methods as #[inline].
Huon Wilson [Tue, 19 Nov 2013 00:13:34 +0000 (11:13 +1100)]
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.)

10 years agort: Namespace all C functions under rust_
Brian Anderson [Tue, 12 Nov 2013 14:21:17 +0000 (06:21 -0800)]
rt: Namespace all C functions under rust_

10 years agoandroid support added to test case
Young-il Choi [Mon, 18 Nov 2013 08:47:25 +0000 (17:47 +0900)]
android support added to test case

10 years agoadd path environments
Young-il Choi [Fri, 15 Nov 2013 03:31:58 +0000 (12:31 +0900)]
add path environments

10 years agofix #10450
Young-il Choi [Thu, 14 Nov 2013 23:34:54 +0000 (08:34 +0900)]
fix #10450

10 years agotemporarily disable tests on android and tagging issue number #10455
Young-il Choi [Thu, 14 Nov 2013 08:11:11 +0000 (17:11 +0900)]
temporarily disable tests on android and tagging issue number #10455

10 years agoauto merge of #10552 : michaelwoerister/rust/ifstepping, r=brson
bors [Mon, 18 Nov 2013 23:26:29 +0000 (15:26 -0800)]
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!

10 years agoauto merge of #10555 : TeXitoi/rust/pidigits-resurected, r=alexcrichton
bors [Mon, 18 Nov 2013 21:46:55 +0000 (13:46 -0800)]
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.

10 years agopidigits resurected
Guillaume Pinot [Mon, 18 Nov 2013 21:23:38 +0000 (22:23 +0100)]
pidigits resurected

Changes:
* default value when no args
* license
* removed libc printing
* use extra::bigint instead of handmade gmp binding

10 years agoauto merge of #10539 : alexcrichton/rust/external-linkage, r=pcwalton
bors [Mon, 18 Nov 2013 18:26:49 +0000 (10:26 -0800)]
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.

10 years agoDon't mark reachable extern fns as internal
Alex Crichton [Mon, 18 Nov 2013 07:19:44 +0000 (23:19 -0800)]
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.

10 years agodebuginfo: Improved stepping for if-expressions
Michael Woerister [Mon, 18 Nov 2013 15:56:44 +0000 (16:56 +0100)]
debuginfo: Improved stepping for if-expressions

10 years agostd::rand: wrappers for floats from [0,1] and (0,1).
Huon Wilson [Mon, 18 Nov 2013 11:27:48 +0000 (22:27 +1100)]
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.

10 years agoauto merge of #10508 : chris-morgan/rust/tags-improvements, r=cmr
bors [Mon, 18 Nov 2013 07:41:25 +0000 (23:41 -0800)]
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.

10 years agoauto merge of #10443 : alexcrichton/rust/meaninless-pub-priv, r=cmr
bors [Mon, 18 Nov 2013 06:21:23 +0000 (22:21 -0800)]
auto merge of #10443 : alexcrichton/rust/meaninless-pub-priv, r=cmr

Closes #10111

10 years agoForbid privacy in inner functions
Alex Crichton [Wed, 6 Nov 2013 02:06:27 +0000 (18:06 -0800)]
Forbid privacy in inner functions

Closes #10111

10 years agoauto merge of #10526 : itdaniher/rust/master, r=pcwalton
bors [Mon, 18 Nov 2013 05:11:24 +0000 (21:11 -0800)]
auto merge of #10526 : itdaniher/rust/master, r=pcwalton

This commit fixes issue #10468.

It propagate optimization level from PkgSrc to compile_crate as a rustc::driver::session::OptLevel enum.

The 'opt' argument to compile_crate was previously hardcoded as boolean false, such that calls to session::options would always result in the session::No flag being used.

10 years agoauto merge of #10363 : astrieanna/rust/fix-x86stdcall, r=huonw
bors [Mon, 18 Nov 2013 04:01:34 +0000 (20:01 -0800)]
auto merge of #10363 : astrieanna/rust/fix-x86stdcall, r=huonw

* moved `extern` inside module
* changed `extern "stdcall"` to `extern "system"`
* changed `cfg(target_os="win32")` to `cfg(windows)`
* only run on Windows && x86, (not x86_64)
* updated copyright dates

10 years agoFix XFailed test x86stdcall
Leah Hanson [Fri, 8 Nov 2013 16:59:37 +0000 (10:59 -0600)]
Fix XFailed test x86stdcall

There was a syntax error because the `extern "stdcall"` was outside the module instead of inside it.

* moved `extern` inside module
* change `extern "stdcall"` to `extern "system"`
* change `cfg(target_os="win32")` to `cfg(windows)`
* updated copyright dates
* changed log(error, ...) => info!(....)
* added `pub` keyword to kernel32 functions

10 years agoauto merge of #10533 : tautologico/rust/fixdocs, r=huonw
bors [Mon, 18 Nov 2013 02:51:30 +0000 (18:51 -0800)]
auto merge of #10533 : tautologico/rust/fixdocs, r=huonw

This fixes a number of bugs in the doc comments for a bunch of functions in libstd/iter.rs, mostly updating to use unwrap() instead of get() on options. Also fixes the docs for advance() (trait Iterator) which was not making sense, though if it is not useful anymore maybe it should be removed.

10 years agoFixed docs for advance() in Iterator trait
Andrei Formiga [Sun, 17 Nov 2013 18:37:00 +0000 (15:37 -0300)]
Fixed docs for advance() in Iterator trait

10 years agoFixed uses of get() to unwrap() in doc examples in std::iter
Andrei Formiga [Sun, 17 Nov 2013 18:31:50 +0000 (15:31 -0300)]
Fixed uses of get() to unwrap() in doc examples in std::iter

10 years agoauto merge of #10511 : cmr/rust/addtests, r=huonw
bors [Mon, 18 Nov 2013 00:21:32 +0000 (16:21 -0800)]
auto merge of #10511 : cmr/rust/addtests, r=huonw

Commit messages have all

10 years agoBetter error message when using vectors in statics
Corey Richardson [Sat, 16 Nov 2013 06:58:51 +0000 (01:58 -0500)]
Better error message when using vectors in statics

Closes #10487

10 years agoAdd a test for #6976
Corey Richardson [Sat, 16 Nov 2013 06:34:52 +0000 (01:34 -0500)]
Add a test for #6976

Closes #6976

10 years agoauto merge of #10532 : dhodder/rust/master, r=alexcrichton
bors [Sun, 17 Nov 2013 23:11:41 +0000 (15:11 -0800)]
auto merge of #10532 : dhodder/rust/master, r=alexcrichton

Hello.  This is just a tiny doc update -- I'm new here, so apologies if I'm doing it wrong.

10 years agoauto merge of #10531 : TeXitoi/rust/mandelbrot-resurected, r=cmr
bors [Sun, 17 Nov 2013 22:01:58 +0000 (14:01 -0800)]
auto merge of #10531 : TeXitoi/rust/mandelbrot-resurected, r=cmr

Changes:
* add licence;
* remove usage of libc and unsafe;
* use BufferedWriter to improve performance;
* use a DummyWriter to cancel binary output in test.

10 years agoAdd doc comment for extra::url::query_to_str
Dave Hodder [Sun, 17 Nov 2013 16:52:14 +0000 (16:52 +0000)]
Add doc comment for extra::url::query_to_str

10 years agoauto merge of #10523 : huonw/rust/10522, r=cmr
bors [Sun, 17 Nov 2013 15:32:13 +0000 (07:32 -0800)]
auto merge of #10523 : huonw/rust/10522, r=cmr

If any of the digits was one past the maximum (e.g. 10**9 for base 10),
then this wasn't detected correctly and so the length of the digit was
one more than expected, causing a very large allocation.

Fixes #10522.
Fixes #10288.

10 years agoauto merge of #10518 : huonw/rust/6911, r=alexcrichton
bors [Sun, 17 Nov 2013 14:21:47 +0000 (06:21 -0800)]
auto merge of #10518 : huonw/rust/6911, r=alexcrichton

Bringing it into line with the unused-variable one,

    fn main() {
        let mut _a = 1;
    }

will not warn that `_a` is never used mutably.

Fixes #6911.

10 years agoauto merge of #10510 : chris-morgan/rust/fix-num_lit-grammar-in-the-reference-manaul...
bors [Sun, 17 Nov 2013 12:26:37 +0000 (04:26 -0800)]
auto merge of #10510 : chris-morgan/rust/fix-num_lit-grammar-in-the-reference-manaul, r=cmr

- Cause `0` to be considered a valid integer literal (it is).
- Add octal literals (missed from #10243).

I have *not* modified doc/po/rust.md.pot or doc/po/ja/rust.md.po at all;
they already seem to be out of date so it's easier to ignore them for
myself. I can update them if desired, of course.

10 years agoPrettier long string breaking.
Guillaume Pinot [Sun, 17 Nov 2013 12:09:56 +0000 (13:09 +0100)]
Prettier long string breaking.