about summary refs log tree commit diff
path: root/src/librustc/util
AgeCommit message (Collapse)AuthorLines
2013-12-08Remove dead codesKiet Tran-11/+1
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-2/+2
critical enum sizes.
2013-11-28Register new snapshotsAlex Crichton-20/+20
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-2/+2
2013-11-19librustc: Change most uses of `&fn()` to `||`.Patrick Walton-5/+5
2013-11-08Rename and modernize region enum namesNiko Matsakis-47/+47
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-34/+118
2013-11-04libsyntax/librustc: Allow calling variadic foreign functions.Luqman Aden-0/+4
2013-10-31librustc: Implement `|A| -> B` syntax for closures and make bare `fn`Patrick Walton-17/+37
work
2013-10-29librustc: Implement the `proc` type as sugar for `~once fn` and `proc`Patrick Walton-9/+20
notation for closures, and disable the feature gate for `once fn` if used with the `~` sigil.
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-4/+4
Who doesn't like a massive renaming?
2013-10-05auto merge of #9250 : erickt/rust/num, r=ericktbors-1/+1
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.
2013-10-04rustc: Use static strings in a few literalsblake2-ppc-1/+1
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.
2013-10-02std: Replace num::IntConvertible with {To,From}PrimitiveErick Tryzelaar-1/+1
2013-10-01remove the `float` typeDaniel Micay-1/+0
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
2013-09-30rustc: Remove usage of fmt!Alex Crichton-65/+65
2013-09-29Remove all usage of @ast::CrateAlex Crichton-3/+3
2013-09-26Update the compiler to not use printf/printflnAlex Crichton-1/+1
2013-09-25Move the linearly-updated flag state into the Visitor.Felix S. Klock II-16/+18
2013-09-23librustc: Remove garbage-collected functions from util/common.Patrick Walton-12/+16
2013-09-16switch Drop to `&mut self`Daniel Micay-1/+1
2013-09-15debuginfo: Basic support for trait objects.Michael Woerister-1/+1
2013-09-04auto merge of #8875 : alexcrichton/rust/fix-inner-static-library-bug, r=huonwbors-1/+2
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!
2013-09-04stop treating char as an integer typeDaniel Micay-2/+2
Closes #7609
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-24/+24
2013-09-02Remove __extensions__ in names for a "pretty name"Alex Crichton-1/+2
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.
2013-09-02Renamed syntax::ast::ident -> IdentMarvin Löbel-2/+2
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-7/+7
2013-08-27librustc: Remove `&const` and `*const` from the language.Patrick Walton-1/+0
They are still present as part of the borrow check.
2013-08-20auto merge of #8519 : msullivan/rust/objects, r=catamorphismbors-2/+12
r?
2013-08-19auto merge of #8623 : pnkfelix/rust/fsk-visitor-vpar-defaults-step4, r=nmatsakisbors-25/+32
Follow up to #8619 (step 3 of 5). (See #8527, which was step 1 of 5, for the full outline.) Part of #7081.
2013-08-19Make supertrait methods callable on object types.Michael Sullivan-2/+12
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.
2013-08-19Issue #3678: Remove wrappers and call foreign functions directlyNiko Matsakis-0/+12
2013-08-15port util/common.rs from oldvisit to <V:Visitor> trait API.Felix S. Klock II-25/+32
2013-08-11typeck: Modify method resolution to use new object adjustments, andNiko Matsakis-3/+2
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.
2013-08-06auto merge of #8313 : msullivan/rust/cleanup, r=catamorphismbors-3/+7
2013-08-06Move EnumSet into libextraSangeun Kim-324/+4
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-1/+1
- 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
2013-08-05Improve debug spew in _match.Michael Sullivan-3/+7
2013-08-04rm obsolete `for` support from the compilerDaniel Micay-2/+1
2013-08-03remove obsolete `foreach` keywordDaniel Micay-5/+5
this has been replaced by `for`
2013-08-03replace all remaining `for` with `foreach` or `do`Daniel Micay-4/+6
2013-08-02librustc: Introduce a new visitor type based on traits and port syntax to it.Patrick Walton-11/+11
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`.
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-5/+5
2013-07-29New naming convention for ast::{node_id, local_crate, crate_node_id, ↵Michael Woerister-3/+3
blk_check_mode, ty_field, ty_method}
2013-07-25auto merge of #8027 : ↵bors-13/+34
nikomatsakis/rust/issue-4846-multiple-lifetime-parameters-1, r=pcwalton Small step towards #4846. r? @msullivan
2013-07-25auto merge of #8015 : msullivan/rust/default-methods, r=nikomatsakisbors-7/+0
Lots of changes to vtable resolution, handling of super/self method calls in default methods. Fix a lot of trait inheritance bugs. r? @nikomatsakis
2013-07-24Generalize the `ty::substs` struct so that it can representNiko Matsakis-13/+34
multiple lifetime parameters, and not just one. Also add an option for erasing lifetimes, which makes trans code somewhat simpler and cleaner.
2013-07-24Change 'print(fmt!(...))' to printf!/printfln! in src/lib*Birunthan Mohanathas-2/+1
2013-07-23Major rework of how calls to self and super methods work.Michael Sullivan-7/+0
Eliminates method_super, method_self, and vtable_self, merging all of them into the param cases. Cloes #4396. Closes #7301.