- 29 4月, 2013 18 次提交
-
-
由 John Clements 提交于
-
由 John Clements 提交于
-
由 John Clements 提交于
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.
-
由 John Clements 提交于
-
由 John Clements 提交于
-
由 John Clements 提交于
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.
-
由 John Clements 提交于
-
由 John Clements 提交于
parser comments
-
由 John Clements 提交于
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
-
由 John Clements 提交于
-
由 John Clements 提交于
-
由 John Clements 提交于
-
由 John Clements 提交于
-
由 John Clements 提交于
-
由 John Clements 提交于
-
由 John Clements 提交于
-
由 John Clements 提交于
-
由 John Clements 提交于
With luck, this will allow rust to compile itself without --cfg flags again...
-
- 28 4月, 2013 11 次提交
-
-
由 bors 提交于
`self` has type `&@Rand`, so `*self` will be of type `@Rand` which causes this same impl to be called again. Fixes #6061
-
由 Philipp Brüschweiler 提交于
`self` has type `&@Rand`, so `*self` will be of type `@Rand` which causes this same impl to be called again.
-
由 bors 提交于
core injection works fine now
-
由 Daniel Micay 提交于
-
由 bors 提交于
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.)
-
由 bors 提交于
People hit the recursion depth limit too often, it's not possible to unwind reliably from out-of-stack. Issues #3555, #3695
-
由 bors 提交于
-
由 bors 提交于
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).
-
由 bors 提交于
-
由 bors 提交于
-
由 bors 提交于
-
- 27 4月, 2013 11 次提交
-
-
由 bors 提交于
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.
-
由 bors 提交于
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
-
由 Brendan Zabarauskas 提交于
-
由 Brendan Zabarauskas 提交于
-
由 bors 提交于
I think the name is more clear, and fits with filter_map etc.
-
由 Brendan Zabarauskas 提交于
The `target_word_size` attribute is always available at compile time, so there is no need for a fallback.
-
由 Brendan Zabarauskas 提交于
-
由 bors 提交于
-
由 Brendan Zabarauskas 提交于
These follow the values defined in the C99 standard
-
由 Tim Chevalier 提交于
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.
-
由 Brian Anderson 提交于
People hit the recursion depth limit too often, it's not possible to unwind reliably from out-of-stack. Issues #3555, #3695
-