]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #10840 : cmr/rust/any_docs2, r=huonw
bors [Mon, 9 Dec 2013 13:51:29 +0000 (05:51 -0800)]
auto merge of #10840 : cmr/rust/any_docs2, r=huonw

10 years agoAdd some Any docs.
Corey Richardson [Fri, 6 Dec 2013 17:33:08 +0000 (12:33 -0500)]
Add some Any docs.

10 years agoauto merge of #10859 : huonw/rust/helper-dists, r=cmr
bors [Mon, 9 Dec 2013 11:41:27 +0000 (03:41 -0800)]
auto merge of #10859 : huonw/rust/helper-dists, r=cmr

This moves `std::rand::distribitions::{Normal, StandardNormal}` to `...::distributions::normal`, reexporting `Normal` from `distributions` (and similarly for `Exp` and Exp1`), and adds:
- Log-normal
- Chi-squared
- F
- Student T

all of which are implemented in C++11's random library. Tests in https://github.com/huonw/random-tests/commit/0424b8aded5e608ae386c1f917934a726d9cac6a. Note that these are approximately half documentation & half implementation (of which a significant portion is boilerplate `}`'s and so on).

10 years agoauto merge of #10874 : vadimcn/rust/integrated-as, r=alexcrichton
bors [Mon, 9 Dec 2013 09:01:43 +0000 (01:01 -0800)]
auto merge of #10874 : vadimcn/rust/integrated-as, r=alexcrichton

Last LLVM update seems to have fixed whatever prevented LLVM integrated assembler from generating correct unwind tables on Windows.   This PR switches Windows builds to use internal assembler by default.
Compilation via external assembler can still be requested via the newly added `-Z no-integrated-as` option.

Closes #8809

10 years agoauto merge of #10867 : sfackler/rust/unsugared-doc, r=huonw
bors [Mon, 9 Dec 2013 06:06:25 +0000 (22:06 -0800)]
auto merge of #10867 : sfackler/rust/unsugared-doc, r=huonw

Closes #10853

10 years agoDisable failing test.
Vadim Chugunov [Mon, 9 Dec 2013 05:19:55 +0000 (21:19 -0800)]
Disable failing test.

10 years agoUse LLVM integrated assembler on Windows too.
Vadim Chugunov [Mon, 9 Dec 2013 04:13:10 +0000 (20:13 -0800)]
Use LLVM integrated assembler on Windows too.

10 years agoAccept unsugared docs in missing-doc lint
Steven Fackler [Mon, 9 Dec 2013 02:41:24 +0000 (18:41 -0800)]
Accept unsugared docs in missing-doc lint

Closes #10853

10 years agoauto merge of #10866 : ktt3ja/rust/edit-doc, r=huonw
bors [Mon, 9 Dec 2013 03:26:23 +0000 (19:26 -0800)]
auto merge of #10866 : ktt3ja/rust/edit-doc, r=huonw

A comment that I previously added to ast::DefStruct is incorrect. Here's the modification.

10 years agoFix comment on ast::DefStruct
Kiet Tran [Mon, 9 Dec 2013 02:18:56 +0000 (21:18 -0500)]
Fix comment on ast::DefStruct

10 years agoauto merge of #10813 : dwrensha/rust/xcrate-lifetime-param, r=huonw
bors [Mon, 9 Dec 2013 00:06:22 +0000 (16:06 -0800)]
auto merge of #10813 : dwrensha/rust/xcrate-lifetime-param, r=huonw

Before applying this patch, the included testcase fails with:
```
src/test/run-pass/xcrate-trait-lifetime-param.rs:20:10: 20:28 error: wrong number of lifetime parameters: expected 0 but found 1
src/test/run-pass/xcrate-trait-lifetime-param.rs:20 impl <'a> other::FromBuf<'a> for Reader<'a> {
                                                              ^~~~~~~~~~~~~~~~~~
```

There's another example in my comments to #10506.

10 years agoencode trait lifetime params in metadata to allow cross-crate usage
David Renshaw [Thu, 5 Dec 2013 02:13:31 +0000 (21:13 -0500)]
encode trait lifetime params in metadata to allow cross-crate usage

10 years agoauto merge of #10477 : ktt3ja/rust/dead-code, r=alexcrichton
bors [Sun, 8 Dec 2013 19:51:22 +0000 (11:51 -0800)]
auto merge of #10477 : ktt3ja/rust/dead-code, r=alexcrichton

PR for issue #1749 mainly to get some feedback and suggestion. This adds a pass that warns if a function, struct, enum, or static item is never used. For the following code,

```rust
pub static pub_static: int = 0;
static priv_static: int = 0;
static used_static: int = 0;

pub fn pub_fn() { used_fn(); }
fn priv_fn() { let unused_struct = PrivStruct; }
fn used_fn() {}

pub struct PubStruct();
struct PrivStruct();
struct UsedStruct1 { x: int }
struct UsedStruct2(int);
struct UsedStruct3();

pub enum pub_enum { foo1, bar1 }
enum priv_enum { foo2, bar2 }
enum used_enum { foo3, bar3 }

fn foo() {
bar();
let unused_enum = foo2;
}

fn bar() {
foo();
}

fn main() {
let used_struct1 = UsedStruct1 { x: 1 };
let used_struct2 = UsedStruct2(1);
let used_struct3 = UsedStruct3;
let t = used_static;
let e = foo3;
}
```

it would add the following warnings:

```rust
/home/ktt3ja/test.rs:2:0: 2:28 warning: code is never used: `priv_static`, #[warn(dead_code)] on by default
/home/ktt3ja/test.rs:2 static priv_static: int = 0;
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ktt3ja/test.rs:6:0: 6:48 warning: code is never used: `priv_fn`, #[warn(dead_code)] on by default
/home/ktt3ja/test.rs:6 fn priv_fn() { let unused_struct = PrivStruct; }
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ktt3ja/test.rs:10:0: 10:20 warning: code is never used: `PrivStruct`, #[warn(dead_code)] on by default
/home/ktt3ja/test.rs:10 struct PrivStruct();
                        ^~~~~~~~~~~~~~~~~~~~
/home/ktt3ja/test.rs:16:0: 16:29 warning: code is never used: `priv_enum`, #[warn(dead_code)] on by default
/home/ktt3ja/test.rs:16 enum priv_enum { foo2, bar2 }
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ktt3ja/test.rs:19:0: 22:1 warning: code is never used: `foo`, #[warn(dead_code)] on by default
/home/ktt3ja/test.rs:19 fn foo() {
/home/ktt3ja/test.rs:20  bar();
/home/ktt3ja/test.rs:21  let unused_enum = foo2;
/home/ktt3ja/test.rs:22 }
/home/ktt3ja/test.rs:24:0: 26:1 warning: code is never used: `bar`, #[warn(dead_code)] on by default
/home/ktt3ja/test.rs:24 fn bar() {
/home/ktt3ja/test.rs:25  foo();
/home/ktt3ja/test.rs:26 }
```

Furthermore, I would like to solicit some test cases since I haven't tested extensively and I'm still unclear about some of the things in here. For example, I'm not sure how reexports would affect this and just assumed that LiveContext (which is a copy of reachable::ReachableContext) does enough work to handle it. Also, the test case above doesn't include any impl or methods, etc.

10 years agoauto merge of #10855 : alexcrichton/rust/snapshots, r=pcwalton
bors [Sun, 8 Dec 2013 18:31:32 +0000 (10:31 -0800)]
auto merge of #10855 : alexcrichton/rust/snapshots, r=pcwalton

This transitions the snapshot dependency process to understand that our
snapshots are now a single static binary rather than an array of files.

10 years agostd::rand: implement the student t distribution.
Huon Wilson [Sat, 7 Dec 2013 12:39:34 +0000 (23:39 +1100)]
std::rand: implement the student t distribution.

10 years agostd::rand: implement the F distribution.
Huon Wilson [Sat, 7 Dec 2013 12:13:37 +0000 (23:13 +1100)]
std::rand: implement the F distribution.

10 years agostd::rand: implement the chi-squared distribution.
Huon Wilson [Sat, 7 Dec 2013 11:51:08 +0000 (22:51 +1100)]
std::rand: implement the chi-squared distribution.

10 years agoRemove dead codes
Kiet Tran [Sun, 8 Dec 2013 07:55:28 +0000 (02:55 -0500)]
Remove dead codes

10 years agoAdd dead-code warning pass
Kiet Tran [Sun, 8 Dec 2013 07:55:27 +0000 (02:55 -0500)]
Add dead-code warning pass

10 years agoRegister new snapshots
Alex Crichton [Sun, 8 Dec 2013 07:02:39 +0000 (23:02 -0800)]
Register new snapshots

This transitions the snapshot dependency process to understand that our
snapshots are now a single static binary rather than an array of files.

10 years agoauto merge of #10850 : alexcrichton/rust/fix-target, r=pcwalton
bors [Sat, 7 Dec 2013 18:51:12 +0000 (10:51 -0800)]
auto merge of #10850 : alexcrichton/rust/fix-target, r=pcwalton

Right now multiple targets/hosts is broken because the libdir passed for all of
the LLVM libraries is for the wrong architecture. By using the right arch
(target, not host), everything is linked and assembled just fine.

10 years agoFix the linked targets for rustc
Alex Crichton [Sat, 7 Dec 2013 18:38:32 +0000 (10:38 -0800)]
Fix the linked targets for rustc

Right now multiple targets/hosts is broken because the libdir passed for all of
the LLVM libraries is for the wrong architecture. By using the right arch
(target, not host), everything is linked and assembled just fine.

10 years agoauto merge of #10844 : huonw/rust/deriving-expn-info, r=alexcrichton
bors [Sat, 7 Dec 2013 13:11:10 +0000 (05:11 -0800)]
auto merge of #10844 : huonw/rust/deriving-expn-info, r=alexcrichton

Previously something like

    struct NotEq;

    #[deriving(Eq)]
    struct Error {
        foo: NotEq
    }

would just point to the `foo` field, with no mention of the
`deriving(Eq)`. With this patch, the compiler creates a note saying "in
expansion of #[deriving(Eq)]" pointing to the Eq.

(includes some cleanup/preparation; the commit view might be nicer, to filter out the noise of the first one.)

10 years agoauto merge of #10831 : luqmana/rust/9382, r=nikomatsakis
bors [Sat, 7 Dec 2013 11:41:12 +0000 (03:41 -0800)]
auto merge of #10831 : luqmana/rust/9382, r=nikomatsakis

Fixes #9382.

r? @nikomatsakis

10 years agostd::rand: implement the log-normal distribution.
Huon Wilson [Sat, 7 Dec 2013 11:22:55 +0000 (22:22 +1100)]
std::rand: implement the log-normal distribution.

10 years agostd::rand: move normal and exponential to their own file.
Huon Wilson [Sat, 7 Dec 2013 11:14:20 +0000 (22:14 +1100)]
std::rand: move normal and exponential to their own file.

10 years agoauto merge of #10824 : huonw/rust/str-doc, r=alexcrichton
bors [Sat, 7 Dec 2013 09:36:17 +0000 (01:36 -0800)]
auto merge of #10824 : huonw/rust/str-doc, r=alexcrichton

Fixes #10819.

10 years agoauto merge of #10797 : pradeep90/rust/rust-mode-changes, r=brson
bors [Sat, 7 Dec 2013 07:46:20 +0000 (23:46 -0800)]
auto merge of #10797 : pradeep90/rust/rust-mode-changes, r=brson

+ Delete trailing whitespace.

10 years agoauto merge of #10364 : Kimundi/rust/result_compose, r=alexcrichton
bors [Sat, 7 Dec 2013 06:21:18 +0000 (22:21 -0800)]
auto merge of #10364 : Kimundi/rust/result_compose, r=alexcrichton

This implements parts of the changes to `Result` and `Option` I proposed and discussed in this thread: https://mail.mozilla.org/pipermail/rust-dev/2013-November/006254.html

This PR includes:
- Adding `ok()` and `err()` option adapters for both `Result` variants.
- Removing `get_ref`, `expect` and iterator constructors for `Result`, as they are reachable with the variant adapters.
- Removing `Result`s `ToStr` bound on the error type because of composability issues. (See https://mail.mozilla.org/pipermail/rust-dev/2013-November/006283.html)
- Some warning cleanups

10 years agoauto merge of #10809 : alexcrichton/rust/static-snapshot, r=alexcrichton
bors [Sat, 7 Dec 2013 05:01:32 +0000 (21:01 -0800)]
auto merge of #10809 : alexcrichton/rust/static-snapshot, r=alexcrichton

Now that we have the necessary logic in rustc for windows, this is possible to land.

10 years agoLink rustllvm statically, and distribute a static snapshot
Alex Crichton [Sun, 1 Dec 2013 04:52:21 +0000 (20:52 -0800)]
Link rustllvm statically, and distribute a static snapshot

In order to keep up to date with changes to the libraries that `llvm-config`
spits out, the dependencies to the LLVM are a dynamically generated rust file.
This file is now automatically updated whenever LLVM is updated to get kept
up-to-date.

At the same time, this cleans out some old cruft which isn't necessary in the
makefiles in terms of dependencies.

Closes #10745
Closes #10744

10 years agostd::str: Add examples to the StrSlice trait.
Huon Wilson [Thu, 5 Dec 2013 11:49:34 +0000 (22:49 +1100)]
std::str: Add examples to the StrSlice trait.

Fixes #10819.

10 years agosyntax::deriving: indicate from which trait type errors (etc) arise
Huon Wilson [Sat, 7 Dec 2013 02:43:22 +0000 (13:43 +1100)]
syntax::deriving: indicate from which trait type errors (etc) arise
using the expansion info.

Previously something like

    struct NotEq;

    #[deriving(Eq)]
    struct Error {
        foo: NotEq
    }

would just point to the `foo` field, with no mention of the
`deriving(Eq)`. With this patch, the compiler creates a note saying "in
expansion of #[deriving(Eq)]" pointing to the Eq.

10 years agosyntax: print expansion info from #[attribute] macros in the correct
Huon Wilson [Sat, 7 Dec 2013 02:41:11 +0000 (13:41 +1100)]
syntax: print expansion info from #[attribute] macros in the correct
format.

Previously, any attempt to use this information from inside something
like #[deriving(Foo)] would result in it printing like `deriving(Foo)!`.

10 years agosyntax::deriving: add the cx and span to the TraitDef to reduce duplication.
Huon Wilson [Sat, 7 Dec 2013 00:57:44 +0000 (11:57 +1100)]
syntax::deriving: add the cx and span to the TraitDef to reduce duplication.

10 years agoMade Results API more composable
Marvin Löbel [Fri, 6 Dec 2013 21:23:23 +0000 (22:23 +0100)]
Made Results API more composable

10 years agolibrustc: Pass the correct type when adding cleanups.
Luqman Aden [Fri, 6 Dec 2013 03:13:46 +0000 (22:13 -0500)]
librustc: Pass the correct type when adding cleanups.

10 years agoauto merge of #10832 : chris-morgan/rust/let's-lop-lang-item-line-count, r=alexcrichton
bors [Fri, 6 Dec 2013 09:11:18 +0000 (01:11 -0800)]
auto merge of #10832 : chris-morgan/rust/let's-lop-lang-item-line-count, r=alexcrichton

This should make maintenance of lang items simpler and also reduces the
line count by about 201 lines.

10 years agoauto merge of #10665 : cmr/rust/doc_lint, r=alexcrichton
bors [Fri, 6 Dec 2013 07:41:19 +0000 (23:41 -0800)]
auto merge of #10665 : cmr/rust/doc_lint, r=alexcrichton

Because the root module isn't actually an item, we need to do some hackish
handling of it.

Closes #10656.

10 years agoCheck crate root for docs in missing_doc lint.
Corey Richardson [Tue, 26 Nov 2013 06:12:14 +0000 (01:12 -0500)]
Check crate root for docs in missing_doc lint.

Because the root module isn't actually an item, we need to do some hackish
handling of it.

Closes #10656.

10 years agoauto merge of #10758 : alexcrichton/rust/upgrade-llvm, r=alexcrichton
bors [Fri, 6 Dec 2013 05:26:19 +0000 (21:26 -0800)]
auto merge of #10758 : alexcrichton/rust/upgrade-llvm, r=alexcrichton

This upgrades LLVM in order to make progress on #10708, and it's also been awhile since we last upgraded!

The contentious point of this upgrade is that all JIT support has been removed because LLVM is changing it and we're not keeping up with it.

10 years agoUse a macro in lang_items to remove duplication.
Chris Morgan [Fri, 6 Dec 2013 04:24:25 +0000 (15:24 +1100)]
Use a macro in lang_items to remove duplication.

This should make maintenance of lang items simpler and also reduces the
line count by about 201 lines.

10 years agoauto merge of #10721 : osa1/rust/intermediatestr, r=brson
bors [Fri, 6 Dec 2013 02:56:19 +0000 (18:56 -0800)]
auto merge of #10721 : osa1/rust/intermediatestr, r=brson

as recommended by @huonw on this PR https://github.com/mozilla/rust/pull/10711 , I removed intermediate step that generates a string instead of directly writing to Writer without generating intermediate string.

10 years agoauto merge of #10675 : LeoTestard/rust/lifetimes-no-keywords, r=brson
bors [Fri, 6 Dec 2013 01:41:18 +0000 (17:41 -0800)]
auto merge of #10675 : LeoTestard/rust/lifetimes-no-keywords, r=brson

Fixes #10565.

`'self` is still allowed for the moment, as it is used everywhere in the codebase. And I'm not sure if it still has a special meaning currently or not.

10 years agoRemove unused upcalls
Alex Crichton [Thu, 28 Nov 2013 22:16:17 +0000 (14:16 -0800)]
Remove unused upcalls

The main one removed is rust_upcall_reset_stack_limit (continuation of #10156),
and this also removes the upcall_trace function. The was hidden behind a
`-Z trace` flag, but if you attempt to use this now you'll get a linker error
because there is no implementation of the 'upcall_trace' function. Due to this
no longer working, I decided to remove it entirely from the compiler (I'm also a
little unsure on what it did in the first place).

10 years agoauto merge of #10506 : nikomatsakis/rust/issue-10391-ICE-with-lifetimes, r=pnkfelix
bors [Fri, 6 Dec 2013 00:26:20 +0000 (16:26 -0800)]
auto merge of #10506 : nikomatsakis/rust/issue-10391-ICE-with-lifetimes, r=pnkfelix

Make trait lifetime parameters early bound in static fn type. Reasoning for this change is (hopefully) explained well enough in the comment, so I'll not duplicate it here. Fixes #10391.

r? @pnkfelix

10 years agoFix test for #10391 to have pub main
Niko Matsakis [Thu, 5 Dec 2013 23:25:01 +0000 (18:25 -0500)]
Fix test for #10391 to have pub main

10 years agoauto merge of #10562 : ongardie/rust/master, r=brson
bors [Thu, 5 Dec 2013 23:16:27 +0000 (15:16 -0800)]
auto merge of #10562 : ongardie/rust/master, r=brson

It's useful to allow users to get at the internal std::rc::comm::Port,
and other such fields, since they implement important traits like
Select.

See [rust-dev] "select on std::comm::Port and different types" at https://mail.mozilla.org/pipermail/rust-dev/2013-November/006735.html for background.

10 years agoauto merge of #10817 : alexcrichton/rust/sched-fix, r=brson
bors [Thu, 5 Dec 2013 22:01:46 +0000 (14:01 -0800)]
auto merge of #10817 : alexcrichton/rust/sched-fix, r=brson

Right now, as pointed out in #8132, it is very easy to introduce a subtle race
in the runtime. I believe that this is the cause of the current flakiness on the
bots.

I have taken the last idea mentioned in that issue which is to use a lock around
descheduling and context switching in order to solve this race.

Closes #8132

10 years agoauto merge of #10211 : ktt3ja/rust/add-lrucache, r=brson
bors [Thu, 5 Dec 2013 20:32:12 +0000 (12:32 -0800)]
auto merge of #10211 : ktt3ja/rust/add-lrucache, r=brson

There's an open issue ([Issue #4988](https://github.com/mozilla/rust/issues/4988?source=cc)) for adding an LRU Cache to the standard library. I'm new to this so I hope I didn't miss anything I'm supposed to do.

10 years agoForbid keywords as lifetime parameters names.
Léo Testard [Tue, 26 Nov 2013 15:35:12 +0000 (16:35 +0100)]
Forbid keywords as lifetime parameters names.

10 years agoauto merge of #10825 : octurion/rust/master, r=alexcrichton
bors [Thu, 5 Dec 2013 17:46:29 +0000 (09:46 -0800)]
auto merge of #10825 : octurion/rust/master, r=alexcrichton

10 years agoSolve some nasty deschedulinging races with a lock
Alex Crichton [Thu, 5 Dec 2013 03:51:29 +0000 (19:51 -0800)]
Solve some nasty deschedulinging races with a lock

Right now, as pointed out in #8132, it is very easy to introduce a subtle race
in the runtime. I believe that this is the cause of the current flakiness on the
bots.

I have taken the last idea mentioned in that issue which is to use a lock around
descheduling and context switching in order to solve this race.

Closes #8132

10 years agoUpdate LLVM and jettison jit support
Alex Crichton [Sun, 1 Dec 2013 22:37:15 +0000 (14:37 -0800)]
Update LLVM and jettison jit support

LLVM's JIT has been updated numerous times, and we haven't been tracking it at
all. The existing LLVM glue code no longer compiles, and the JIT isn't used for
anything currently.

This also rebases out the FixedStackSegment support which we have added to LLVM.
None of this is still in use by the compiler, and there's no need to keep this
functionality around inside of LLVM.

This is needed to unblock #10708 (where we're tripping an LLVM assertion).

10 years agoFix documentation typo (divison operator is not backslash)
Alexandros Tasos [Thu, 5 Dec 2013 14:24:48 +0000 (16:24 +0200)]
Fix documentation typo (divison operator is not backslash)

10 years agoauto merge of #10796 : kballard/rust/revert-new-naming, r=alexcrichton
bors [Thu, 5 Dec 2013 07:26:19 +0000 (23:26 -0800)]
auto merge of #10796 : kballard/rust/revert-new-naming, r=alexcrichton

Rename the `*::init()` functions back to `*::new()`, since `new` is not
going to become a keyword.

10 years agoRename std::rt::deque::*::init() to *::new()
Kevin Ballard [Wed, 4 Dec 2013 03:37:57 +0000 (19:37 -0800)]
Rename std::rt::deque::*::init() to *::new()

10 years agoRename extra::json::*::init() constructors to *::new()
Kevin Ballard [Wed, 4 Dec 2013 03:18:35 +0000 (19:18 -0800)]
Rename extra::json::*::init() constructors to *::new()

10 years agoRevert "libstd: Change `Path::new` to `Path::init`."
Kevin Ballard [Wed, 4 Dec 2013 03:15:12 +0000 (19:15 -0800)]
Revert "libstd: Change `Path::new` to `Path::init`."

This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b.

Leave the #[ignores] in that were added to rustpkg tests.

Conflicts:
src/librustc/driver/driver.rs
src/librustc/metadata/creader.rs

10 years agoauto merge of #10804 : alexcrichton/rust/less-dup, r=pcwalton
bors [Thu, 5 Dec 2013 06:11:22 +0000 (22:11 -0800)]
auto merge of #10804 : alexcrichton/rust/less-dup, r=pcwalton

This is just an implementation detail of using libuv, so move the libuv-specific
logic into librustuv.

10 years agoauto merge of #10799 : TeXitoi/rust/shootout-reverse-complement-resurected, r=alexcri...
bors [Thu, 5 Dec 2013 04:46:23 +0000 (20:46 -0800)]
auto merge of #10799 : TeXitoi/rust/shootout-reverse-complement-resurected, r=alexcrichton

This version is inspired by the best version in C by Mr Ledrug,
but without the parallelisation.

10 years agoauto merge of #10803 : vmx/rust/integer-decode, r=cmr
bors [Thu, 5 Dec 2013 02:46:21 +0000 (18:46 -0800)]
auto merge of #10803 : vmx/rust/integer-decode, r=cmr

The `integer_decode()` function decodes a float (f32/f64)
into integers containing the mantissa, exponent and sign.

It's needed for `rationalize()` implementation of #9838.

The code got ported from ABCL [1].

[1] http://abcl.org/trac/browser/trunk/abcl/src/org/armedbear/lisp/FloatFunctions.java?rev=14465#L94

I got the permission to use this code for Rust from Peter Graves (the ABCL copyright holder) . If there's any further IP clearance needed, let me know.

10 years agoauto merge of #10690 : thestinger/rust/doc, r=alexcrichton
bors [Thu, 5 Dec 2013 00:51:23 +0000 (16:51 -0800)]
auto merge of #10690 : thestinger/rust/doc, r=alexcrichton

This begins a rewrite of some sections the tutorial as an introduction
to concepts through the implementation of a simple data structure. I
think this would be a good way to introduce references, generics, traits
and many other concepts too. For example, the section introducing
alternatives to ownership can demonstrate a persistent list.

10 years agorewrite part of the tutorial
Daniel Micay [Wed, 27 Nov 2013 07:43:52 +0000 (02:43 -0500)]
rewrite part of the tutorial

This begins a rewrite of some sections the tutorial as an introduction
to concepts through the implementation of a simple data structure. I
think this would be a good way to introduce references, traits and many
other concepts too. For example, the section introducing alternatives to
ownership can demonstrate a persistent list.

10 years agoauto merge of #10792 : kballard/rust/parse_sugary_call_expr-comments, r=alexcrichton
bors [Wed, 4 Dec 2013 21:31:45 +0000 (13:31 -0800)]
auto merge of #10792 : kballard/rust/parse_sugary_call_expr-comments, r=alexcrichton

The comments on this function date back from when it was used for `for`
expressions in addition to `do` expressions.

10 years agoauto merge of #10701 : huonw/rust/rm-from_utf8, r=brson
bors [Wed, 4 Dec 2013 19:32:23 +0000 (11:32 -0800)]
auto merge of #10701 : huonw/rust/rm-from_utf8, r=brson

This function had type &[u8] -> ~str, i.e. it allocates a string
internally, even though the non-allocating version that take &[u8] ->
&str and ~[u8] -> ~str are all that is necessary in most circumstances.

10 years agorewrite of shootout-reverse-complement.rs
Guillaume Pinot [Wed, 4 Dec 2013 08:03:55 +0000 (09:03 +0100)]
rewrite of shootout-reverse-complement.rs

This version is inspired by the best version in C by Mr Ledrug,
but without the parallelisation.

10 years agoDon't dup the stdio file descriptors.
Alex Crichton [Wed, 4 Dec 2013 16:51:47 +0000 (08:51 -0800)]
Don't dup the stdio file descriptors.

This is just an implementation detail of using libuv, so move the libuv-specific
logic into librustuv.

10 years agoauto merge of #10788 : alexcrichton/rust/fixes, r=pcwalton
bors [Wed, 4 Dec 2013 16:12:11 +0000 (08:12 -0800)]
auto merge of #10788 : alexcrichton/rust/fixes, r=pcwalton

I used the wrong condition where I was looking for "is this method public or is
this implementation a trait" rather than what was being checked.

10 years agoDecode a float into integers
Volker Mische [Sun, 1 Dec 2013 23:47:19 +0000 (00:47 +0100)]
Decode a float into integers

The `integer_decode()` function decodes a float (f32/f64)
into integers containing the mantissa, exponent and sign.

It's needed for `rationalize()` implementation of #9838.

The code got ported from ABCL [1].

[1] http://abcl.org/trac/browser/trunk/abcl/src/org/armedbear/lisp/FloatFunctions.java?rev=14465#L94

10 years agoauto merge of #10794 : alexcrichton/rust/issue-10790, r=alexcrichton
bors [Wed, 4 Dec 2013 13:26:35 +0000 (05:26 -0800)]
auto merge of #10794 : alexcrichton/rust/issue-10790, r=alexcrichton

Note entirely sure how this is passing at all today, but regardless this fixes
the problems seen in #10790

Closes #10790

10 years agoauto merge of #10793 : chris-morgan/rust/2013-12-04-vim-updates, r=Aatch
bors [Wed, 4 Dec 2013 12:11:26 +0000 (04:11 -0800)]
auto merge of #10793 : chris-morgan/rust/2013-12-04-vim-updates, r=Aatch

- Implement comment nesting (the implementation is quite ugly at present
  and is not quite correct; note the big comment in that area).

- Highlight invalid escape sequences as errors.

- Fix up various inconsistencies and incorrectnesses in number
  highlighting.

- Update prelude items (``std::io::{Buffer, Writer, Reader, Seek}``).

- Highlight the ``proc`` keyword.

- Remove %-formatting sequence highlighting (a relic of old formatting).

- Don't highlight TODO in strings (it's unconventional).

10 years agostd::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter.
Huon Wilson [Sun, 1 Dec 2013 13:33:04 +0000 (00:33 +1100)]
std::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter.

10 years agostd::str: remove from_utf8.
Huon Wilson [Thu, 28 Nov 2013 12:52:11 +0000 (23:52 +1100)]
std::str: remove from_utf8.

This function had type &[u8] -> ~str, i.e. it allocates a string
internally, even though the non-allocating version that take &[u8] ->
&str and ~[u8] -> ~str are all that is necessary in most circumstances.

10 years agoAdd Imenu support for rust-mode.
S Pradeep Kumar [Wed, 4 Dec 2013 05:59:03 +0000 (14:59 +0900)]
Add Imenu support for rust-mode.

+ Delete trailing whitespace.

10 years agoauto merge of #10783 : sfackler/rust/drop, r=alexcrichton
bors [Wed, 4 Dec 2013 09:36:29 +0000 (01:36 -0800)]
auto merge of #10783 : sfackler/rust/drop, r=alexcrichton

It's a more fitting name for the most common use case of this function.

10 years agoauto merge of #10776 : alexcrichton/rust/issue-9725, r=pcwalton
bors [Wed, 4 Dec 2013 07:56:25 +0000 (23:56 -0800)]
auto merge of #10776 : alexcrichton/rust/issue-9725, r=pcwalton

Closes #9725

10 years agoauto merge of #10785 : alexcrichton/rust/omg-i-hate-windows, r=pcwalton
bors [Wed, 4 Dec 2013 05:11:26 +0000 (21:11 -0800)]
auto merge of #10785 : alexcrichton/rust/omg-i-hate-windows, r=pcwalton

Turns out LLVM only builds libfoo.a libraries, so we're going to need this logic
to statically link librustc

10 years agoMove std::util::ignore to std::prelude::drop
Steven Fackler [Tue, 3 Dec 2013 06:37:26 +0000 (22:37 -0800)]
Move std::util::ignore to std::prelude::drop

It's a more fitting name for the most common use case of this function.

10 years agoDon't infinitely recurse in a process test
Alex Crichton [Wed, 4 Dec 2013 03:17:45 +0000 (19:17 -0800)]
Don't infinitely recurse in a process test

Note entirely sure how this is passing at all today, but regardless this fixes
the problems seen in #10790

10 years agoauto merge of #10752 : dhodder/rust/master, r=pcwalton
bors [Wed, 4 Dec 2013 02:31:36 +0000 (18:31 -0800)]
auto merge of #10752 : dhodder/rust/master, r=pcwalton

10 years agoImprove various Vim syntax highlighting things.
Chris Morgan [Wed, 4 Dec 2013 01:41:56 +0000 (12:41 +1100)]
Improve various Vim syntax highlighting things.

- Implement comment nesting (the implementation is quite ugly at present
  and is not quite correct; note the big comment in that area).

- Highlight invalid escape sequences as errors.

- Fix up various inconsistencies and incorrectnesses in number
  highlighting.

- Update prelude items (``std::io::{Buffer, Writer, Reader, Seek}``).

- Highlight the ``proc`` keyword.

- Remove %-formatting sequence highlighting (a relic of old formatting).

- Don't highlight TODO in strings (it's unconventional).

10 years agoFix the comments for libsyntax::parse::parser::parse_sugary_call_expr
Kevin Ballard [Wed, 4 Dec 2013 00:55:00 +0000 (16:55 -0800)]
Fix the comments for libsyntax::parse::parser::parse_sugary_call_expr

The comments on this function date back from when it was used for `for`
expressions in addition to `do` expressions.

10 years agoMake trait lifetime parameters early bound in static fn type. This is related
Niko Matsakis [Fri, 15 Nov 2013 22:04:01 +0000 (17:04 -0500)]
Make trait lifetime parameters early bound in static fn type.  This is related
to #5121.

Fixes #10391.

10 years agoFix a bug in exporting trait implementations
Alex Crichton [Tue, 3 Dec 2013 23:15:17 +0000 (15:15 -0800)]
Fix a bug in exporting trait implementations

I used the wrong condition where I was looking for "is this method public or is
this implementation a trait" rather than what was being checked.

10 years agoauto merge of #10747 : alexcrichton/rust/snapshots, r=cmr
bors [Tue, 3 Dec 2013 22:36:59 +0000 (14:36 -0800)]
auto merge of #10747 : alexcrichton/rust/snapshots, r=cmr

This registers new snapshots after the landing of #10528, and then goes on to tweak the build process to build a monolithic `rustc` binary for use in future snapshots. This mainly involved dropping the dynamic dependency on `librustllvm`, so that's now built as a static library (with a dynamically generated rust file listing LLVM dependencies).

This currently doesn't actually make the snapshot any smaller (24MB => 23MB), but I noticed that the executable has 11MB of metadata so once progress is made on #10740 we should have a much smaller snapshot.

There's not really a super-compelling reason to distribute just a binary because we have all the infrastructure for dealing with a directory structure, but to me it seems "more correct" that a snapshot compiler is just a `rustc` binary.

10 years agoRegister new snapshots
Alex Crichton [Sun, 1 Dec 2013 00:38:07 +0000 (16:38 -0800)]
Register new snapshots

10 years agoauto merge of #10768 : Blei/rust/logging-enabled-macros, r=alexcrichton
bors [Tue, 3 Dec 2013 20:11:25 +0000 (12:11 -0800)]
auto merge of #10768 : Blei/rust/logging-enabled-macros, r=alexcrichton

This is useful when the information that is needed to do useful logging
is expensive to produce.

10 years agoauto merge of #10757 : TeXitoi/rust/mut-split-iter, r=alexcrichton
bors [Tue, 3 Dec 2013 18:11:25 +0000 (10:11 -0800)]
auto merge of #10757 : TeXitoi/rust/mut-split-iter, r=alexcrichton

I've renamed `MutableVector::mut_split(at)` to `MutableVector::mut_split_at(at)` to be coherent with ImmutableVector.  As specified in the commit log, The `size_hint` method is not optimal because of #9629.

10 years agoSearch for libfoo.a on windows as well as foo.lib
Alex Crichton [Tue, 3 Dec 2013 16:59:09 +0000 (08:59 -0800)]
Search for libfoo.a on windows as well as foo.lib

Turns out LLVM only builds libfoo.a libraries, so we're going to need this logic
to statically link librustc

10 years agoadd MutableVector::mut_split(self, pred) -> DoubleEndedIterator<&mut [T]>
Guillaume Pinot [Sun, 1 Dec 2013 17:50:34 +0000 (18:50 +0100)]
add MutableVector::mut_split(self, pred) -> DoubleEndedIterator<&mut [T]>

This method is the mutable version of ImmutableVector::split.  It is
a DoubleEndedIterator, making mut_rsplit irrelevent.  The size_hint
method is not optimal because of #9629.

At the same time, clarify *split* iterator doc.

10 years agoauto merge of #10777 : alexcrichton/rust/issue-10743, r=luqmana
bors [Tue, 3 Dec 2013 16:21:26 +0000 (08:21 -0800)]
auto merge of #10777 : alexcrichton/rust/issue-10743, r=luqmana

Commit messages have the fun details, the focus of this is closing #10743 though

10 years agoResume propagation of linking to native dylibs
Alex Crichton [Mon, 2 Dec 2013 22:37:30 +0000 (14:37 -0800)]
Resume propagation of linking to native dylibs

The reasons for this are outlined in issue #10743 as well as the comment I have
now placed in the code.

Closes #10743

10 years agoTidy up a few problems with run-make tests
Alex Crichton [Mon, 2 Dec 2013 22:51:47 +0000 (14:51 -0800)]
Tidy up a few problems with run-make tests

Use the correct set of dependencies as well as CFG_PYTHON instead of assuming
'python' is the right one.

10 years agoContinue tightening holes in reachability
Alex Crichton [Mon, 2 Dec 2013 01:56:55 +0000 (17:56 -0800)]
Continue tightening holes in reachability

* Don't flag any address_insignificant statics as reachable because the whole
  point of the address_insignificant optimization is that the static is not
  reachable. Additionally, there's no need for it to be reachable because LLVM
  optimizes it away.

* Be sure to not leak external node ids into our reachable set, this can
  spuriously cause local items to be considered reachable if the node ids just
  happen to line up

10 years agoauto merge of #10782 : alexcrichton/rust/rustdoc-lib, r=thestinger
bors [Tue, 3 Dec 2013 09:51:26 +0000 (01:51 -0800)]
auto merge of #10782 : alexcrichton/rust/rustdoc-lib, r=thestinger

This makes sure that when generating documentation we don't waste time doing
things like looking for a main function.

10 years agoauto merge of #10773 : jvns/rust/patch-1, r=cmr
bors [Tue, 3 Dec 2013 07:32:33 +0000 (23:32 -0800)]
auto merge of #10773 : jvns/rust/patch-1, r=cmr

The section on closure types was missing, so I added one. I'm new to Rust, so there are probably important things to say about closure types that I'm missing here.

I tested the example with the latest Rust nightly.

10 years agoAdd test to check for debug logging disabled at compile time
Philipp Brüschweiler [Tue, 3 Dec 2013 06:09:48 +0000 (07:09 +0100)]
Add test to check for debug logging disabled at compile time

10 years agoauto merge of #10772 : alexcrichton/rust/issue-3053, r=alexcrichton
bors [Tue, 3 Dec 2013 05:32:38 +0000 (21:32 -0800)]
auto merge of #10772 : alexcrichton/rust/issue-3053, r=alexcrichton

Rebasing #10446 with a `pub fn main`

10 years agorustdoc: Tell rustc we're building a library
Alex Crichton [Tue, 3 Dec 2013 05:26:40 +0000 (21:26 -0800)]
rustdoc: Tell rustc we're building a library

This makes sure that when generating documentation we don't waste time doing
things like looking for a main function.