| Age | Commit message (Collapse) | Author | Lines |
|
|
|
critical enum sizes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
work
|
|
notation for closures, and disable the feature gate for `once fn` if
used with the `~` sigil.
|
|
Who doesn't like a massive renaming?
|
|
This PR solves one of the pain points with c-style enums. Simplifies writing a fn to convert from an int/uint to an enum. It does this through a `#[deriving(FromPrimitive)]` syntax extension.
Before this is committed though, we need to discuss if `ToPrimitive`/`FromPrimitive` has the right design (cc #4819). I've changed all the `.to_int()` and `from_int()` style functions to return `Option<int>` so we can handle partial functions. For this PR though only enums and `extra::num::bigint::*` take advantage of returning None for unrepresentable values. In the long run it'd be better if `i64.to_i8()` returned `None` if the value was too large, but I'll save this for a future PR.
Closes #3868.
|
|
Avoid allocating extra copies of strings by using "" instead of ~"" for
the debug options list and for the `time` function. This is a small
change, but it is in a path that's always executed.
|
|
|
|
It is simply defined as `f64` across every platform right now.
A use case hasn't been presented for a `float` type defined as the
highest precision floating point type implemented in hardware on the
platform. Performance-wise, using the smallest precision correct for the
use case greatly saves on cache space and allows for fitting more
numbers into SSE/AVX registers.
If there was a use case, this could be implemented as simply a type
alias or a struct thanks to `#[cfg(...)]`.
Closes #6592
The mailing list thread, for reference:
https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These commits fix bugs related to identically named statics in functions of implementations in various situations. The commit messages have most of the information about what bugs are being fixed and why.
As a bonus, while I was messing around with name mangling, I improved the backtraces we'll get in gdb by removing `__extensions__` for the trait/type being implemented and by adding the method name as well. Yay!
|
|
Closes #7609
|
|
|
|
As with the previous commit, this is targeted at removing the possibility of
collisions between statics. The main use case here is when there's a
type-parametric function with an inner static that's compiled as a library.
Before this commit, any impl would generate a path item of "__extensions__".
This changes this identifier to be a "pretty name", which is either the last
element of the path of the trait implemented or the last element of the type's
path that's being implemented. That doesn't quite cut it though, so the (trait,
type) pair is hashed and again used to append information to the symbol.
Essentially, __extensions__ was removed for something nicer for debugging, and
then some more information was added to symbol name by including a hash of the
trait being implemented and type it's being implemented for. This should prevent
colliding names for inner statics in regular functions with similar names.
|
|
|
|
|
|
They are still present as part of the borrow check.
|
|
r?
|
|
Follow up to #8619 (step 3 of 5).
(See #8527, which was step 1 of 5, for the full outline.)
Part of #7081.
|
|
This requires changes to method search and to codegen. We now emit a
vtable for objects that includes methods from all supertraits.
Closes #4100.
Also, actually populate the cache for vtables, and also key it by type
so that it actually works.
|
|
|
|
|
|
to favor inherent methods over extension methods.
The reason to favor inherent methods is that otherwise an impl
like
impl Foo for @Foo { fn method(&self) { self.method() } }
causes infinite recursion. The current change to favor inherent methods is
rather hacky; the method resolution code is in need of a refactoring.
|
|
|
|
|
|
- Made naming schemes consistent between Option, Result and Either
- Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None)
- Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
|
|
|
|
|
|
this has been replaced by `for`
|
|
|
|
This is preparation for removing `@fn`.
This does *not* use default methods yet, because I don't know
whether they work. If they do, a forthcoming PR will use them.
This also changes the precedence of `as`.
|
|
|
|
blk_check_mode, ty_field, ty_method}
|
|
nikomatsakis/rust/issue-4846-multiple-lifetime-parameters-1, r=pcwalton
Small step towards #4846. r? @msullivan
|
|
Lots of changes to vtable resolution, handling of super/self method calls in default methods. Fix a lot of trait inheritance bugs.
r? @nikomatsakis
|
|
multiple lifetime parameters, and not just one. Also add an option
for erasing lifetimes, which makes trans code somewhat simpler
and cleaner.
|
|
|
|
Eliminates method_super, method_self, and vtable_self, merging all of
them into the param cases.
Cloes #4396. Closes #7301.
|