about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2013-04-29auto merge of #6110 : bjz/rust/numeric-traits, r=pcwaltonbors-258/+380
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`.
2013-04-29auto merge of #6099 : danluu/rust/xfail_clone, r=catamorphismbors-31/+20
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`
2013-04-29Revert "Merge Exponential and Hyperbolic traits"Brendan Zabarauskas-5/+11
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.
2013-04-29Merge Exponential and Hyperbolic traitsBrendan Zabarauskas-11/+5
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.
2013-04-29auto merge of #6083 : jbclements/rust/parser-cleanup, r=jbclementsbors-545/+889
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.
2013-04-29Rename 'divisible_by' method to 'is_multiple_of', add tests for 'is_odd' and ↵Brendan Zabarauskas-7/+69
'is_even'
2013-04-28add test case for enum disambiguationJohn Clements-0/+16
2013-04-28fix typo in librstpkg tests, allowed by old parserJohn Clements-1/+1
2013-04-29Implement Fractional for RatioBrendan Zabarauskas-0/+18
2013-04-29Move appropriate functions out of Real and into separate Algebraic, ↵Brendan Zabarauskas-251/+293
Trigonometric, Exponential and Hyperbolic traits
2013-04-28make way for a new iter moduleDaniel Micay-517/+625
2013-04-28auto merge of #5646 : Aatch/rust/unwind-fix, r=brsonbors-41/+7
This fixes issue #5641
2013-04-28auto merge of #6092 : gifnksm/rust/impl-integer-bigint, r=graydonbors-144/+383
This is a follow-up commit for #6041 (and depending on #6048). Also adding `#[inline(always)]` for almost every methods in `std::bigint`.
2013-04-28Updated spawn / loop thread to work with current syntaxDan Luu-9/+8
2013-04-28Remove test for any type -> match type, which doesn't seem to exist anymoreDan Luu-14/+0
2013-04-28Update old xfailing spawn/bind/join testDan Luu-8/+12
2013-04-28parser commentsJohn Clements-12/+82
2013-04-28s/one_tuple/trailing_comma (more accurate name)John Clements-3/+3
2013-04-28removed unneeded argument to parse_recordJohn Clements-4/+5
2013-04-28s/parse_purity/parse_unsafetyJohn Clements-3/+4
2013-04-28remove 3-line used-once functionJohn Clements-8/+4
2013-04-28rename parse_instance_var to parse_name_and_tyJohn Clements-3/+3
the name no longer made sense. perhaps this could just be inlined.
2013-04-28remove obsolete semicolon from list of suggestionsJohn Clements-1/+1
2013-04-28rename parse_single_class_item as wellJohn Clements-5/+6
2013-04-28rename parse_class_item to parse_struct_decl_fieldJohn Clements-3/+4
two problems with the old name: they're not called classes any more, and the word "item" has a specific connotation in the parser
2013-04-28needs_comma was always trueJohn Clements-3/+2
2013-04-28fix for parsing x() as identifier patternJohn Clements-17/+14
2013-04-28hard to read the implied double negativeJohn Clements-4/+4
2013-04-28remove unused functions, fix tiny lexing bugJohn Clements-10/+1
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.
2013-04-28remove unused flag to parse_local fnJohn Clements-5/+4
2013-04-28remove unused RESTRICT_NO_CALL_EXPRS restrictionJohn Clements-7/+2
2013-04-28undo abstraction over whether to parse attrs in a blockJohn Clements-32/+19
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.
2013-04-28refactoring to split foreign_items from itemsJohn Clements-164/+169
2013-04-28parser commentsJohn Clements-6/+20
parser comments
2013-04-28get rid of prec.rsJohn Clements-58/+34
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
2013-04-28reindent in parserJohn Clements-4/+4
2013-04-28remove unnecessary functionJohn Clements-7/+1
2013-04-28simplify, based on invariant that items_allowed != foreign_items_allowedJohn Clements-13/+7
2013-04-28adding parse_pathJohn Clements-19/+34
2013-04-28comments, helper function for tests, more informative error messageJohn Clements-2/+17
2013-04-28refactor parse_fn_declJohn Clements-5/+6
2013-04-28parser comments onlyJohn Clements-0/+6
2013-04-28refactoring mod.rsJohn Clements-163/+437
2013-04-28change stage1,stage2,stage2 into not(stage0)John Clements-6/+2
With luck, this will allow rust to compile itself without --cfg flags again...
2013-04-28rand: Fix infinite recursionPhilipp Brüschweiler-1/+1
`self` has type `&@Rand`, so `*self` will be of type `@Rand` which causes this same impl to be called again.
2013-04-28libstd: inlining almost every methods in bigint module.gifnksm-1/+86
2013-04-28libstd: impl Integer for BigUint/BigInt.gifnksm-143/+297
Also remove abs() method from the non-trait impl for BigInt/BigUint. That method is provided in the Signed trait.
2013-04-27only use #[no_core] in libcoreDaniel Micay-810/+6
2013-04-27auto merge of #6082 : catamorphism/rust/mkdir_recursive, r=brsonbors-39/+40
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.)
2013-04-27auto merge of #6081 : brson/rust/out-of-stack, r=thestingerbors-86/+3
People hit the recursion depth limit too often, it's not possible to unwind reliably from out-of-stack. Issues #3555, #3695