]> git.lizzy.rs Git - rust.git/log
rust.git
11 years agocore: Wire up the unwinder to newsched again
Brian Anderson [Fri, 3 May 2013 02:13:56 +0000 (19:13 -0700)]
core: Wire up the unwinder to newsched again

This was some merge fallout

11 years agorustc: Drop the visitor object from the visitor glue
Brian Anderson [Fri, 3 May 2013 01:42:07 +0000 (18:42 -0700)]
rustc: Drop the visitor object from the visitor glue

Recent demoding makes the visitor glue leak. It hasn't shown up in tests
because the box annihilator deletes the leaked boxes. This affects the
new scheduler though which does not yet have a box annihilator.

I don't think there's any great way to test this besides setting up
a task that doesn't run the box annihilator and I don't know that that's
a capability we want tasks to have.

11 years agomk: Fix pdf build
Brian Anderson [Wed, 1 May 2013 00:45:08 +0000 (17:45 -0700)]
mk: Fix pdf build

11 years agoMerge remote-tracking branch 'brson/io'
Brian Anderson [Tue, 30 Apr 2013 01:28:01 +0000 (18:28 -0700)]
Merge remote-tracking branch 'brson/io'

Conflicts:
src/libcore/task/local_data_priv.rs

11 years agocore: Turn off the local heap in newsched in stage0 to work around windows bustage
Brian Anderson [Mon, 29 Apr 2013 23:44:21 +0000 (16:44 -0700)]
core: Turn off the local heap in newsched in stage0 to work around windows bustage

core won't compile in stage0 without.

11 years agoauto merge of #6080 : pcwalton/rust/demode-everything, r=pcwalton
bors [Mon, 29 Apr 2013 21:33:37 +0000 (14:33 -0700)]
auto merge of #6080 : pcwalton/rust/demode-everything, r=pcwalton

r? @brson

11 years agolibstd: Fix merge fallout.
Patrick Walton [Mon, 29 Apr 2013 17:47:26 +0000 (10:47 -0700)]
libstd: Fix merge fallout.

11 years agodoc: XFAIL mysterious failure on bots
Patrick Walton [Mon, 29 Apr 2013 17:17:20 +0000 (10:17 -0700)]
doc: XFAIL mysterious failure on bots

11 years agolibrustc: Fix merge fallout.
Patrick Walton [Sun, 28 Apr 2013 17:53:42 +0000 (10:53 -0700)]
librustc: Fix merge fallout.

11 years agotest: Fix more tests.
Patrick Walton [Sun, 28 Apr 2013 05:05:39 +0000 (22:05 -0700)]
test: Fix more tests.

11 years agolibrustc: Forbid type implementations on typedefs.
Patrick Walton [Sat, 27 Apr 2013 01:52:15 +0000 (18:52 -0700)]
librustc: Forbid type implementations on typedefs.

11 years agolibrustc: Change labels to use the lifetime notation `'`.
Patrick Walton [Fri, 26 Apr 2013 23:19:26 +0000 (16:19 -0700)]
librustc: Change labels to use the lifetime notation `'`.

11 years agotest: Fix tests.
Patrick Walton [Fri, 26 Apr 2013 21:04:39 +0000 (14:04 -0700)]
test: Fix tests.

11 years agolibrustc: Remove the concept of modes from the compiler.
Patrick Walton [Wed, 24 Apr 2013 08:29:46 +0000 (01:29 -0700)]
librustc: Remove the concept of modes from the compiler.

This commit does not remove `ty::arg`, although that should be
possible to do now.

11 years agolibrustc: Make `&fn` by-copy by default and remove the mode from `frame_address`.
Patrick Walton [Tue, 23 Apr 2013 04:54:29 +0000 (21:54 -0700)]
librustc: Make `&fn` by-copy by default and remove the mode from `frame_address`.

11 years agotest: Remove #[legacy_modes] from the test suite.
Patrick Walton [Tue, 23 Apr 2013 04:19:58 +0000 (21:19 -0700)]
test: Remove #[legacy_modes] from the test suite.

11 years agolibfuzzer: De-mode the fuzzer.
Patrick Walton [Tue, 23 Apr 2013 03:13:17 +0000 (20:13 -0700)]
libfuzzer: De-mode the fuzzer.

11 years agolibrustc: Remove the legacy mode in the type visitor intrinsic.
Patrick Walton [Tue, 23 Apr 2013 01:08:24 +0000 (18:08 -0700)]
librustc: Remove the legacy mode in the type visitor intrinsic.

11 years agolibrustc: Rename `reinterpret_cast` to `transmute_copy` and remove the intrinsic
Patrick Walton [Tue, 23 Apr 2013 00:34:42 +0000 (17:34 -0700)]
librustc: Rename `reinterpret_cast` to `transmute_copy` and remove the intrinsic

11 years agolibrustc: Implement `reinterpret_cast` in terms of `transmute`.
Patrick Walton [Mon, 22 Apr 2013 23:22:36 +0000 (16:22 -0700)]
librustc: Implement `reinterpret_cast` in terms of `transmute`.

11 years agolibrustc: Remove `ptr::addr_of`.
Patrick Walton [Mon, 22 Apr 2013 21:27:30 +0000 (14:27 -0700)]
librustc: Remove `ptr::addr_of`.

11 years agoRevert "libcore: remove unnecessary deref"
Tim Chevalier [Thu, 25 Apr 2013 21:49:14 +0000 (14:49 -0700)]
Revert "libcore: remove unnecessary deref"

This reverts commit 9860fe10a19cc4997e58861df905f8dbe4de3c5b.

11 years agoauto merge of #6110 : bjz/rust/numeric-traits, r=pcwalton
bors [Mon, 29 Apr 2013 20:39:37 +0000 (13:39 -0700)]
auto merge of #6110 : bjz/rust/numeric-traits, r=pcwalton

As discussed on issue #4819, I have created four new traits: `Algebraic`, `Trigonometric`, `Exponential` and `Hyperbolic`, and moved the appropriate methods into them from `Real`.

~~~rust
pub trait Algebraic {
    fn pow(&self, n: Self) -> Self;
    fn sqrt(&self) -> Self;
    fn rsqrt(&self) -> Self;
    fn cbrt(&self) -> Self;
    fn hypot(&self, other: Self) -> Self;
}

pub trait Trigonometric {
    fn sin(&self) -> Self;
    fn cos(&self) -> Self;
    fn tan(&self) -> Self;
    fn asin(&self) -> Self;
    fn acos(&self) -> Self;
    fn atan(&self) -> Self;
    fn atan2(&self, other: Self) -> Self;
}

pub trait Exponential {
    fn exp(&self) -> Self;
    fn exp2(&self) -> Self;
    fn expm1(&self) -> Self;
    fn log(&self) -> Self;
    fn log2(&self) -> Self;
    fn log10(&self) -> Self;
}

pub trait Hyperbolic: Exponential {
    fn sinh(&self) -> Self;
    fn cosh(&self) -> Self;
    fn tanh(&self) -> Self;
}
~~~

There was some discussion over whether we should shorten the names, for example `Trig` and `Exp`. No abbreviations have been agreed on yet, but this could be considered in the future.

Additionally, `Integer::divisible_by` has been renamed to `Integer::is_multiple_of`.

11 years agoauto merge of #6099 : danluu/rust/xfail_clone, r=catamorphism
bors [Mon, 29 Apr 2013 18:57:40 +0000 (11:57 -0700)]
auto merge of #6099 : danluu/rust/xfail_clone, r=catamorphism

One of the tests seems to have no current equivalent that's similar. Please let me know if that's incorrect, and I'll try fixing it instead of deleting it. I suppose a struct could be used instead of `any` and `match type`, but it seems like the original intent of the test was to exercise `match type`

11 years agoRevert "Merge Exponential and Hyperbolic traits"
Brendan Zabarauskas [Mon, 29 Apr 2013 13:38:58 +0000 (23:38 +1000)]
Revert "Merge Exponential and Hyperbolic traits"

After discussions on IRC and #4819, we have decided to revert this change. This is due to the traits expressing different ideas and because hyperbolic functions are not trivially implementable from exponential functions for floating-point types.

11 years agoMerge Exponential and Hyperbolic traits
Brendan Zabarauskas [Mon, 29 Apr 2013 12:15:58 +0000 (22:15 +1000)]
Merge Exponential and Hyperbolic traits

The Hyperbolic Functions are trivially implemented in terms of `exp`, so it's  simpler to group them the Exponential trait. In the future these would have default implementations.

11 years agotutorial: Fix 'self' to 'Self'
ILYONG CHO [Mon, 29 Apr 2013 09:03:11 +0000 (18:03 +0900)]
tutorial: Fix 'self' to 'Self'

11 years agotutorial: Fix 'self' to 'Self'
ILYONG CHO [Mon, 29 Apr 2013 08:59:25 +0000 (17:59 +0900)]
tutorial: Fix 'self' to 'Self'

11 years agoauto merge of #6083 : jbclements/rust/parser-cleanup, r=jbclements
bors [Mon, 29 Apr 2013 07:12:37 +0000 (00:12 -0700)]
auto merge of #6083 : jbclements/rust/parser-cleanup, r=jbclements

r? @pcwalton

A month's worth of parser cleanup here. Much of this is new comments and renaming. A number of these commits also remove unneeded code.  Probably the biggest refactor here is splitting "parse_item_or_view_item" into two functions; it turns out that the only overlap between items in foreign modules and items in regular modules was macros, so this refactor should make things substantially easier for future maintenance.

11 years agoRename 'divisible_by' method to 'is_multiple_of', add tests for 'is_odd' and 'is_even'
Brendan Zabarauskas [Mon, 29 Apr 2013 06:02:43 +0000 (16:02 +1000)]
Rename 'divisible_by' method to 'is_multiple_of', add tests for 'is_odd' and 'is_even'

11 years agoadd test case for enum disambiguation
John Clements [Mon, 29 Apr 2013 06:00:01 +0000 (23:00 -0700)]
add test case for enum disambiguation

11 years agofix typo in librstpkg tests, allowed by old parser
John Clements [Mon, 29 Apr 2013 06:00:48 +0000 (23:00 -0700)]
fix typo in librstpkg tests, allowed by old parser

11 years agoImplement Fractional for Ratio
Brendan Zabarauskas [Mon, 29 Apr 2013 06:00:27 +0000 (16:00 +1000)]
Implement Fractional for Ratio

11 years agoMove appropriate functions out of Real and into separate Algebraic, Trigonometric...
Brendan Zabarauskas [Mon, 29 Apr 2013 05:33:55 +0000 (15:33 +1000)]
Move appropriate functions out of Real and into separate Algebraic, Trigonometric, Exponential and Hyperbolic traits

11 years agoauto merge of #6056 : thestinger/rust/iter, r=catamorphism
bors [Mon, 29 Apr 2013 02:36:36 +0000 (19:36 -0700)]
auto merge of #6056 : thestinger/rust/iter, r=catamorphism

The existing adaptors like `map` in the `iter` module are very flawed because they only work for `BaseIter` implementations. There are many internal iterator implementations in the standard library like the set methods (`difference`, `symmetric_difference`, `intersection`, `union`) and the `range` functions that only share the `for` loop protocol in common.

The internal iterator adaptors should be implemented to work on any implementation of that protocol, rather than just a method called `each` taking `&self`.

This just moves `iter.rs` to `old_iter.rs` and begins work on documenting and implementing a nicer module.

11 years agomake way for a new iter module
Daniel Micay [Thu, 25 Apr 2013 00:35:49 +0000 (20:35 -0400)]
make way for a new iter module

11 years agoauto merge of #5646 : Aatch/rust/unwind-fix, r=brson
bors [Sun, 28 Apr 2013 22:36:35 +0000 (15:36 -0700)]
auto merge of #5646 : Aatch/rust/unwind-fix, r=brson

This fixes issue #5641

11 years agoauto merge of #6092 : gifnksm/rust/impl-integer-bigint, r=graydon
bors [Sun, 28 Apr 2013 19:51:35 +0000 (12:51 -0700)]
auto merge of #6092 : gifnksm/rust/impl-integer-bigint, r=graydon

This is a follow-up commit for #6041 (and depending on #6048).
Also adding `#[inline(always)]` for almost every methods in `std::bigint`.

11 years agoUpdated spawn / loop thread to work with current syntax
Dan Luu [Sun, 28 Apr 2013 19:33:41 +0000 (15:33 -0400)]
Updated spawn / loop thread to work with current syntax

11 years agoRemove test for any type -> match type, which doesn't seem to exist anymore
Dan Luu [Sun, 28 Apr 2013 19:02:15 +0000 (15:02 -0400)]
Remove test for any type -> match type, which doesn't seem to exist anymore

11 years agoUpdate old xfailing spawn/bind/join test
Dan Luu [Sun, 28 Apr 2013 18:50:04 +0000 (14:50 -0400)]
Update old xfailing spawn/bind/join test

11 years agoparser comments
John Clements [Tue, 2 Apr 2013 23:44:01 +0000 (16:44 -0700)]
parser comments

11 years agos/one_tuple/trailing_comma (more accurate name)
John Clements [Mon, 22 Apr 2013 00:27:19 +0000 (17:27 -0700)]
s/one_tuple/trailing_comma (more accurate name)

11 years agoremoved unneeded argument to parse_record
John Clements [Mon, 22 Apr 2013 00:26:41 +0000 (17:26 -0700)]
removed unneeded argument to parse_record

11 years agos/parse_purity/parse_unsafety
John Clements [Fri, 19 Apr 2013 22:48:02 +0000 (15:48 -0700)]
s/parse_purity/parse_unsafety

11 years agoremove 3-line used-once function
John Clements [Fri, 19 Apr 2013 18:19:37 +0000 (11:19 -0700)]
remove 3-line used-once function

11 years agorename parse_instance_var to parse_name_and_ty
John Clements [Fri, 19 Apr 2013 17:49:02 +0000 (10:49 -0700)]
rename parse_instance_var to parse_name_and_ty

the name no longer made sense. perhaps this could just be inlined.

11 years agoremove obsolete semicolon from list of suggestions
John Clements [Fri, 19 Apr 2013 17:44:41 +0000 (10:44 -0700)]
remove obsolete semicolon from list of suggestions

11 years agorename parse_single_class_item as well
John Clements [Fri, 19 Apr 2013 17:41:59 +0000 (10:41 -0700)]
rename parse_single_class_item as well

11 years agorename parse_class_item to parse_struct_decl_field
John Clements [Fri, 19 Apr 2013 17:36:21 +0000 (10:36 -0700)]
rename parse_class_item to parse_struct_decl_field

two problems with the old name: they're not called classes any more, and
the word "item" has a specific connotation in the parser

11 years agoneeds_comma was always true
John Clements [Fri, 19 Apr 2013 16:45:02 +0000 (09:45 -0700)]
needs_comma was always true

11 years agofix for parsing x() as identifier pattern
John Clements [Fri, 19 Apr 2013 15:45:25 +0000 (08:45 -0700)]
fix for parsing x() as identifier pattern

11 years agohard to read the implied double negative
John Clements [Fri, 19 Apr 2013 15:44:47 +0000 (08:44 -0700)]
hard to read the implied double negative

11 years agoremove unused functions, fix tiny lexing bug
John Clements [Wed, 17 Apr 2013 19:24:49 +0000 (12:24 -0700)]
remove unused functions, fix tiny lexing bug

before this change, the parser would parse 14.a() as a method call, but
would parse 14.ø() as the floating-point number 14. followed by a function
call. This is because it was checking is_alpha, rather than ident_start,
and was therefore wrong with respect to unicode.

11 years agoremove unused flag to parse_local fn
John Clements [Mon, 15 Apr 2013 23:31:57 +0000 (16:31 -0700)]
remove unused flag to parse_local fn

11 years agoremove unused RESTRICT_NO_CALL_EXPRS restriction
John Clements [Thu, 11 Apr 2013 20:10:06 +0000 (13:10 -0700)]
remove unused RESTRICT_NO_CALL_EXPRS restriction

11 years agoundo abstraction over whether to parse attrs in a block
John Clements [Sat, 6 Apr 2013 00:31:52 +0000 (17:31 -0700)]
undo abstraction over whether to parse attrs in a block

In principle, it seems like a nice idea to abstract over the two
functions that parse blocks (one with inner attrs allowed, one not).
However, the existing one wound up making things more complex than
just having two separate functions, especially after the obsolete
syntax is (will be) removed.

11 years agorefactoring to split foreign_items from items
John Clements [Mon, 1 Apr 2013 22:50:58 +0000 (15:50 -0700)]
refactoring to split foreign_items from items

11 years agoparser comments
John Clements [Fri, 29 Mar 2013 19:51:10 +0000 (12:51 -0700)]
parser comments

parser comments

11 years agoget rid of prec.rs
John Clements [Fri, 29 Mar 2013 17:04:48 +0000 (10:04 -0700)]
get rid of prec.rs

prec.rs no longer had much to do with precedence; the token->binop
function fits better in token.rs, and the one-liner defining the
precedence of 'as' can go next to the other precedence stuff in
ast_util.rs

11 years agoreindent in parser
John Clements [Thu, 28 Mar 2013 23:31:12 +0000 (16:31 -0700)]
reindent in parser

11 years agoremove unnecessary function
John Clements [Thu, 28 Mar 2013 22:45:09 +0000 (15:45 -0700)]
remove unnecessary function

11 years agosimplify, based on invariant that items_allowed != foreign_items_allowed
John Clements [Wed, 10 Apr 2013 16:44:48 +0000 (09:44 -0700)]
simplify, based on invariant that items_allowed != foreign_items_allowed

11 years agoadding parse_path
John Clements [Wed, 27 Mar 2013 19:36:10 +0000 (12:36 -0700)]
adding parse_path

11 years agocomments, helper function for tests, more informative error message
John Clements [Tue, 23 Apr 2013 23:47:47 +0000 (16:47 -0700)]
comments, helper function for tests, more informative error message

11 years agorefactor parse_fn_decl
John Clements [Thu, 4 Apr 2013 21:30:43 +0000 (14:30 -0700)]
refactor parse_fn_decl

11 years agoparser comments only
John Clements [Thu, 4 Apr 2013 21:30:11 +0000 (14:30 -0700)]
parser comments only

11 years agorefactoring mod.rs
John Clements [Tue, 23 Apr 2013 17:57:41 +0000 (10:57 -0700)]
refactoring mod.rs

11 years agochange stage1,stage2,stage2 into not(stage0)
John Clements [Tue, 23 Apr 2013 17:51:57 +0000 (10:51 -0700)]
change stage1,stage2,stage2 into not(stage0)

With luck, this will allow rust to compile itself without --cfg flags again...

11 years agoauto merge of #6097 : Blei/rust/fix-rand, r=pnkfelix
bors [Sun, 28 Apr 2013 11:48:35 +0000 (04:48 -0700)]
auto merge of #6097 : Blei/rust/fix-rand, r=pnkfelix

`self` has type `&@Rand`, so `*self` will be of type `@Rand` which causes
this same impl to be called again.

Fixes #6061

11 years agorand: Fix infinite recursion
Philipp Brüschweiler [Sun, 28 Apr 2013 11:31:49 +0000 (13:31 +0200)]
rand: Fix infinite recursion

`self` has type `&@Rand`, so `*self` will be of type `@Rand` which causes
this same impl to be called again.

11 years agoauto merge of #6075 : thestinger/rust/no-no_core, r=brson
bors [Sun, 28 Apr 2013 02:18:33 +0000 (19:18 -0700)]
auto merge of #6075 : thestinger/rust/no-no_core, r=brson

core injection works fine now

11 years agolibstd: inlining almost every methods in bigint module.
gifnksm [Sun, 28 Apr 2013 01:58:19 +0000 (10:58 +0900)]
libstd: inlining almost every methods in bigint module.

11 years agolibstd: impl Integer for BigUint/BigInt.
gifnksm [Sun, 28 Apr 2013 01:08:54 +0000 (10:08 +0900)]
libstd: impl Integer for BigUint/BigInt.

Also remove abs() method from the non-trait impl for BigInt/BigUint.
That method is provided in the Signed trait.

11 years agoonly use #[no_core] in libcore
Daniel Micay [Fri, 26 Apr 2013 16:24:15 +0000 (12:24 -0400)]
only use #[no_core] in libcore

11 years agoauto merge of #6082 : catamorphism/rust/mkdir_recursive, r=brson
bors [Sun, 28 Apr 2013 00:24:33 +0000 (17:24 -0700)]
auto merge of #6082 : catamorphism/rust/mkdir_recursive, r=brson

r? @brson mkdir_recursive creates a directory as well as any of its
parent directories that don't exist already. Seems like a useful
thing to have in core.

(Or r? anyone who gets to it first.)

11 years agoauto merge of #6081 : brson/rust/out-of-stack, r=thestinger
bors [Sat, 27 Apr 2013 23:24:34 +0000 (16:24 -0700)]
auto merge of #6081 : brson/rust/out-of-stack, r=thestinger

People hit the recursion depth limit too often, it's not possible
to unwind reliably from out-of-stack.

Issues #3555, #3695

11 years agoauto merge of #6072 : cmr/rust/better_import_error, r=graydon
bors [Sat, 27 Apr 2013 21:24:36 +0000 (14:24 -0700)]
auto merge of #6072 : cmr/rust/better_import_error, r=graydon

11 years agoauto merge of #6071 : bjz/rust/numeric-traits, r=graydon
bors [Sat, 27 Apr 2013 20:09:35 +0000 (13:09 -0700)]
auto merge of #6071 : bjz/rust/numeric-traits, r=graydon

As part of the numeric trait reform (see issue #4819), I have added the following traits to `core::num` and implemented them for Rust's primitive numeric types:

~~~rust
pub trait Bitwise: Not<Self>
                 + BitAnd<Self,Self>
                 + BitOr<Self,Self>
                 + BitXor<Self,Self>
                 + Shl<Self,Self>
                 + Shr<Self,Self> {}

pub trait BitCount {
    fn population_count(&self) -> Self;
    fn leading_zeros(&self) -> Self;
    fn trailing_zeros(&self) -> Self;
}

pub trait Bounded {
    fn min_value() -> Self;
    fn max_value() -> Self;
}

pub trait Primitive: Num
                   + NumCast
                   + Bounded
                   + Neg<Self>
                   + Add<Self,Self>
                   + Sub<Self,Self>
                   + Mul<Self,Self>
                   + Quot<Self,Self>
                   + Rem<Self,Self> {
    fn bits() -> uint;
    fn bytes() -> uint;
}

pub trait Int: Integer
             + Primitive
             + Bitwise
             + BitCount {}

pub trait Float: Real
               + Signed
               + Primitive {
    fn NaN() -> Self;
    fn infinity() -> Self;
    fn neg_infinity() -> Self;
    fn neg_zero() -> Self;

    fn is_NaN(&self) -> bool;
    fn is_infinite(&self) -> bool;
    fn is_finite(&self) -> bool;

    fn mantissa_digits() -> uint;
    fn digits() -> uint;
    fn epsilon() -> Self;
    fn min_exp() -> int;
    fn max_exp() -> int;
    fn min_10_exp() -> int;
    fn max_10_exp() -> int;

    fn mul_add(&self, a: Self, b: Self) -> Self;
    fn next_after(&self, other: Self) -> Self;
}
~~~
Note: I'm not sure my implementation for `BitCount::trailing_zeros` and `BitCount::leading_zeros` is correct for uints. I also need some assistance creating appropriate unit tests for them.

More work needs to be done in implementing specialized primitive floating-point and integer methods, but I'm beginning to reach the limits of my knowledge. Please leave your suggestions/critiques/ideas on #4819 if you have them – I'd very much appreciate hearing them.

I have also added an `Orderable` trait:

~~~rust
pub trait Orderable: Ord {
    fn min(&self, other: &Self) -> Self;
    fn max(&self, other: &Self) -> Self;
    fn clamp(&self, mn: &Self, mx: &Self) -> Self;
}
~~~

This is a temporary trait until we have default methods. We don't want to encumber all implementors of Ord by requiring them to implement these functions, but at the same time we want to be able to take advantage of the speed of the specific numeric functions (like the `fmin` and `fmax` intrinsics).

11 years agoauto merge of #6070 : thestinger/rust/tutorial, r=pcwalton
bors [Sat, 27 Apr 2013 19:09:35 +0000 (12:09 -0700)]
auto merge of #6070 : thestinger/rust/tutorial, r=pcwalton

11 years agoauto merge of #6066 : djui/rust/patch-1, r=graydon
bors [Sat, 27 Apr 2013 17:24:35 +0000 (10:24 -0700)]
auto merge of #6066 : djui/rust/patch-1, r=graydon

11 years agoauto merge of #6064 : thestinger/rust/char, r=catamorphism
bors [Sat, 27 Apr 2013 16:27:36 +0000 (09:27 -0700)]
auto merge of #6064 : thestinger/rust/char, r=catamorphism

11 years agoauto merge of #6059 : Kimundi/rust/nice-fail, r=pcwalton
bors [Sat, 27 Apr 2013 05:45:36 +0000 (22:45 -0700)]
auto merge of #6059 : Kimundi/rust/nice-fail, r=pcwalton

r? @brson

Unwinding through macros now happens as a call to the trait function `FailWithCause::fail_with()`, which consumes self, allowing to use a more generic failure object in the future.

11 years agoauto merge of #6058 : huonw/rust/rt-isaac-update, r=graydon
bors [Sat, 27 Apr 2013 04:57:35 +0000 (21:57 -0700)]
auto merge of #6058 : huonw/rust/rt-isaac-update, r=graydon

The "unsigned 4 byte" `ub4`s are actually 8 bytes on 64-bit platforms
which mean that some bits > 2**32 were retained in calculations, these
would then "reappear" after a right shift and so the stream of random numbers
would differ on 32 bit vs 64 bit platforms.

http://burtleburtle.net/bob/c/randport.c

11 years agoPropagate NaNs for Orderable methods impled on floating-point primitives
Brendan Zabarauskas [Sat, 27 Apr 2013 03:13:28 +0000 (13:13 +1000)]
Propagate NaNs for Orderable methods impled on floating-point primitives

11 years agoFix copy-paste mistakes
Brendan Zabarauskas [Sat, 27 Apr 2013 02:42:34 +0000 (12:42 +1000)]
Fix copy-paste mistakes

11 years agoauto merge of #6057 : cmr/rust/map_zip, r=graydon
bors [Sat, 27 Apr 2013 00:42:36 +0000 (17:42 -0700)]
auto merge of #6057 : cmr/rust/map_zip, r=graydon

I think the name is more clear, and fits with filter_map etc.

11 years agoRemove unnecessary fallbacks
Brendan Zabarauskas [Sat, 27 Apr 2013 00:34:29 +0000 (10:34 +1000)]
Remove unnecessary fallbacks

The `target_word_size` attribute is always available at compile time, so there is no need for a fallback.

11 years agoRename `nextafter` to `next_after` to match method name in Float
Brendan Zabarauskas [Sat, 27 Apr 2013 00:16:09 +0000 (10:16 +1000)]
Rename `nextafter` to `next_after` to match method name in Float

11 years agoauto merge of #6077 : brson/rust/valgrind, r=brson
bors [Fri, 26 Apr 2013 23:54:35 +0000 (16:54 -0700)]
auto merge of #6077 : brson/rust/valgrind, r=brson

11 years agoAdd additional constants to primitive floating point numbers
Brendan Zabarauskas [Fri, 26 Apr 2013 23:07:40 +0000 (09:07 +1000)]
Add additional constants to primitive floating point numbers

These follow the values defined in the C99 standard

11 years agocore: Move mkdir_recursive from rustpkg into core::os
Tim Chevalier [Fri, 26 Apr 2013 00:18:25 +0000 (17:18 -0700)]
core: Move mkdir_recursive from rustpkg into core::os

mkdir_recursive creates a directory as well as any of its
parent directories that don't exist already. Seems like a useful
thing to have in core.

11 years agort: Set the stack depth limit to 1GB. Abort on error.
Brian Anderson [Fri, 26 Apr 2013 22:36:19 +0000 (15:36 -0700)]
rt: Set the stack depth limit to 1GB. Abort on error.

People hit the recursion depth limit too often, it's not possible
to unwind reliably from out-of-stack.

Issues #3555, #3695

11 years agoSuppress all 'cond' errors in valgrind. #5856
Brian Anderson [Fri, 26 Apr 2013 20:35:01 +0000 (13:35 -0700)]
Suppress all 'cond' errors in valgrind. #5856

11 years agotutorial-ffi: add example of a custom destructor
Daniel Micay [Fri, 26 Apr 2013 02:08:29 +0000 (22:08 -0400)]
tutorial-ffi: add example of a custom destructor

11 years agotutorial: rework the section on destructors
Daniel Micay [Fri, 26 Apr 2013 01:36:02 +0000 (21:36 -0400)]
tutorial: rework the section on destructors

This removes the comparison to manual memory management examples,
because it requires too much existing knowledge. Implementing custom
destructors can be covered in the FFI tutorial, where `unsafe` is
already well explained.

11 years agoAdd mul_add and next_after methods to Float
Brendan Zabarauskas [Fri, 26 Apr 2013 15:02:30 +0000 (01:02 +1000)]
Add mul_add and next_after methods to Float

11 years agoAdd Orderable trait
Brendan Zabarauskas [Fri, 26 Apr 2013 15:01:53 +0000 (01:01 +1000)]
Add Orderable trait

This is a temporary trait until we have default methods. We don't want to encumber all implementors of Ord by requiring them to implement these functions, but at the same time we want to be able to take advantage of the speed of the specific numeric functions (like the `fmin` and `fmax` intrinsics).

11 years agort: use the [u]int[nn]_t types in the RNG.
Huon Wilson [Fri, 26 Apr 2013 12:13:24 +0000 (22:13 +1000)]
rt: use the [u]int[nn]_t types in the RNG.

This means that `ub4`s are always 4 bytes, rather than being 8 bytes on
x64. (Suggested but not implemented by upstream: "Porting it to a 64-bit
machine [...] may just need an adjustment of the definition of ub4")

11 years agoFix typo
Uwe Dauernheim [Fri, 26 Apr 2013 11:47:15 +0000 (14:47 +0300)]
Fix typo