summary refs log tree commit diff
path: root/src/libsyntax/util
AgeCommit message (Collapse)AuthorLines
2014-03-30Rename `from_iterator` to `from_iter` for consistency.Brian Anderson-2/+2
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-1/+1
2014-03-25Changed `iter::Extendable` and `iter::FromIterator` to take a `Iterator` by ↵Marvin Löbel-6/+4
value
2014-03-23std: remove the `equals` method from `TotalEq`.Huon Wilson-5/+1
`TotalEq` is now just an assertion about the `Eq` impl of a type (i.e. `==` is a total equality if a type implements `TotalEq`) so the extra method is just confusing. Also, a new method magically appeared as a hack to allow deriving to assert that the contents of a struct/enum are also TotalEq, because the deriving infrastructure makes it very hard to do anything but create a trait method. (You didn't hear about this horrible work-around from me :(.)
2014-03-23use TotalEq for HashMapDaniel Micay-1/+1
Closes #5283
2014-03-22syntax: Fix fallout of removing get()Alex Crichton-30/+25
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-6/+0
It's now in the prelude.
2014-03-20auto merge of #12686 : FlaPer87/rust/shared, r=nikomatsakisbors-1/+1
`Share` implies that all *reachable* content is *threadsafe*. Threadsafe is defined as "exposing no operation that permits a data race if multiple threads have access to a &T pointer simultaneously". (NB: the type system should guarantee that if you have access to memory via a &T pointer, the only other way to gain access to that memory is through another &T pointer)... Fixes #11781 cc #12577 What this PR will do ================ - [x] Add Share kind and - [x] Replace usages of Freeze with Share in bounds. - [x] Add Unsafe<T> #12577 - [x] Forbid taking the address of a immutable static item with `Unsafe<T>` interior What's left to do in a separate PR (after the snapshot)? =========================================== - Remove `Freeze` completely
2014-03-20Relax interner's Share boundFlavio Percoco-4/+1
The interner uses `RefCell` internally which opted out from Share.
2014-03-20Replace Freeze bounds with Share boundsFlavio Percoco-1/+4
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-6/+6
Closes #12771
2014-03-19Discard MTWT & interner tables from TLD after they stop being useful.Eduard Burtescu-0/+10
2014-03-17Fix rustdoc and tests.Eduard Burtescu-1/+2
2014-03-17De-@ ParseSess uses.Eduard Burtescu-26/+7
2014-03-13Remove Rc's borrow method to avoid conflicts with RefCell's borrow in ↵Eduard Burtescu-2/+2
Rc<RefCell<T>>.
2014-03-04Expand nested items within a backtrace.Nick Cameron-0/+8
Fixes a regression from #4913 which causes items to be exanded with spans lacking expn_info from the context's current backtrace.
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-7/+14
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-22/+22
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-0/+8
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-24std: minor whitespace cleanupErick Tryzelaar-4/+2
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-5/+5
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-1/+1
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-21std: rewrite Hash to make it more genericErick Tryzelaar-0/+1
This patch merges IterBytes and Hash traits, which clears up the confusion of using `#[deriving(IterBytes)]` to support hashing. Instead, it now is much easier to use the new `#[deriving(Hash)]` for making a type hashable with a stream hash. Furthermore, it supports custom non-stream-based hashers, such as if a value's hash was cached in a database. This does not yet replace the old IterBytes-hash with this new version.
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-1/+7
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-14Expand ItemDecorator extensions in all contextsSteven Fackler-1/+7
Now that fold_item can return multiple items, this is pretty trivial. It also recursively expands generated items so ItemDecorators can generate items that are tagged with ItemDecorators! Closes #4913
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-9/+9
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-4/+4
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-08Fixed error starting with uppercasemr.Shu-1/+1
Error messages cleaned in librustc/middle Error messages cleaned in libsyntax Error messages cleaned in libsyntax more agressively Error messages cleaned in librustc more aggressively Fixed affected tests Fixed other failing tests Last failing tests fixed
2014-02-07Removed @self and @Trait.Eduard Burtescu-2/+2
2014-02-03syntax: Remove usage of io_error in testsAlex Crichton-9/+9
2014-02-02librustc: Remove `@str` from the languagePatrick Walton-1/+1
2014-02-02libsyntax: Remove `@str` from the internerPatrick Walton-37/+80
2014-02-02libsyntax: Fix tests.Patrick Walton-2/+2
2014-02-02librustc: Stop using `@str` for source.Patrick Walton-11/+11
2014-02-02libsyntax: Introduce an `InternedString` type to reduce `@str` in thePatrick Walton-0/+11
compiler and use it for attributes
2014-01-21Remove unnecessary parentheses.Huon Wilson-1/+1
2014-01-18Rename iterators for consistencyPalmer Cox-5/+5
Rename existing iterators to get rid of the Iterator suffix and to give them names that better describe the things being iterated over.
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-5/+5
2014-01-07'borrowed pointer' -> 'reference'Brian Anderson-1/+1
2014-01-03libsyntax: De-`@mut` `Interner::vect`Patrick Walton-19/+31
2014-01-03libsyntax: De-`@mut` the interner mapPatrick Walton-10/+15
2014-01-03librustc: De-`@mut` the parse sessionPatrick Walton-3/+3
2014-01-02libsyntax: Fix test and merge fallout.Patrick Walton-1/+1
2013-12-08Remove dead codesKiet Tran-1/+1
2013-11-28Register new snapshotsAlex Crichton-4/+4
2013-11-26auto merge of #10670 : eddyb/rust/node-u32, r=alexcrichtonbors-18/+20
### Rationale There is no reason to support more than 2³² nodes or names at this moment, as compiling something that big (even without considering the quadratic space usage of some analysis passes) would take at least **64GB**. Meanwhile, some can't (or barely can) compile rustc because it requires almost **1.5GB**. ### Potential problems Can someone confirm this doesn't affect metadata (de)serialization? I can't tell myself, I know nothing about it. ### Results Some structures have a size reduction of 25% to 50%: [before](https://gist.github.com/luqmana/3a82a51fa9c86d9191fa) - [after](https://gist.github.com/eddyb/5a75f8973d3d8018afd3). Sadly, there isn't a massive change in the memory used for compiling stage2 librustc (it doesn't go over **1.4GB** as [before](http://huonw.github.io/isrustfastyet/mem/), but I can barely see the difference). However, my own testcase (previously peaking at **1.6GB** in typeck) shows a reduction of **200**-**400MB**.
2013-11-27Shink NodeId, CrateNum, Name and Mrk down to 32 bits on x64.Eduard Burtescu-18/+20
2013-11-26Clean up SmallVector use a bitSteven Fackler-79/+27
2013-11-26Support multiple item macrosSteven Fackler-0/+28
Closes #4375
2013-11-26Add SmallVector to libsyntaxSteven Fackler-0/+213