about summary refs log tree commit diff
path: root/src/libsyntax/util
AgeCommit message (Collapse)AuthorLines
2014-07-09syntax: doc comments all the thingsCorey Richardson-22/+22
2014-06-29librustc: Remove the fallback to `int` for integers and `f64` forPatrick Walton-3/+3
floating point numbers for real. This will break code that looks like: let mut x = 0; while ... { x += 1; } println!("{}", x); Change that code to: let mut x = 0i; while ... { x += 1; } println!("{}", x); Closes #15201. [breaking-change]
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-8/+8
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-4/+6
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
2014-06-08core: Rename `container` mod to `collections`. Closes #12543Brian Anderson-1/+1
Also renames the `Container` trait to `Collection`. [breaking-change]
2014-06-05Fallout from the libcollections movementAlex Crichton-1/+1
2014-06-04syntax: use doc comments in the internerCorey Richardson-5/+5
2014-06-01std: Drop Total from Total{Eq,Ord}Alex Crichton-3/+3
This completes the last stage of the renaming of the comparison hierarchy of traits. This change renames TotalEq to Eq and TotalOrd to Ord. In the future the new Eq/Ord will be filled out with their appropriate methods, but for now this change is purely a renaming change. [breaking-change]
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-1/+1
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-27std: Rename strbuf operations to stringRicho Healey-3/+3
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-9/+9
[breaking-change]
2014-05-11core: Remove the cast moduleAlex Crichton-2/+2
This commit revisits the `cast` module in libcore and libstd, and scrutinizes all functions inside of it. The result was to remove the `cast` module entirely, folding all functionality into the `mem` module. Specifically, this is the fate of each function in the `cast` module. * transmute - This function was moved to `mem`, but it is now marked as #[unstable]. This is due to planned changes to the `transmute` function and how it can be invoked (see the #[unstable] comment). For more information, see RFC 5 and #12898 * transmute_copy - This function was moved to `mem`, with clarification that is is not an error to invoke it with T/U that are different sizes, but rather that it is strongly discouraged. This function is now #[stable] * forget - This function was moved to `mem` and marked #[stable] * bump_box_refcount - This function was removed due to the deprecation of managed boxes as well as its questionable utility. * transmute_mut - This function was previously deprecated, and removed as part of this commit. * transmute_mut_unsafe - This function doesn't serve much of a purpose when it can be achieved with an `as` in safe code, so it was removed. * transmute_lifetime - This function was removed because it is likely a strong indication that code is incorrect in the first place. * transmute_mut_lifetime - This function was removed for the same reasons as `transmute_lifetime` * copy_lifetime - This function was moved to `mem`, but it is marked `#[unstable]` now due to the likelihood of being removed in the future if it is found to not be very useful. * copy_mut_lifetime - This function was also moved to `mem`, but had the same treatment as `copy_lifetime`. * copy_lifetime_vec - This function was removed because it is not used today, and its existence is not necessary with DST (copy_lifetime will suffice). In summary, the cast module was stripped down to these functions, and then the functions were moved to the `mem` module. transmute - #[unstable] transmute_copy - #[stable] forget - #[stable] copy_lifetime - #[unstable] copy_mut_lifetime - #[unstable] [breaking-change]
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-13/+17
2014-05-07core: Inherit possible string functionalityAlex Crichton-5/+0
This moves as much allocation as possible from teh std::str module into core::str. This includes essentially all non-allocating functionality, mostly iterators and slicing and such. This primarily splits the Str trait into only having the as_slice() method, adding a new StrAllocating trait to std::str which contains the relevant new allocation methods. This is a breaking change if any of the methods of "trait Str" were overriden. The old functionality can be restored by implementing both the Str and StrAllocating traits. [breaking-change]
2014-04-22rustc: de-@ middle::ty.Eduard Burtescu-0/+9
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-2/+2
2014-04-15Remove usage of private enum variantsAlex Crichton-25/+34
This replaces all uses of private enum variants with a struct that has one private field pointing at a private enum. RFC: 0006-remove-priv
2014-03-31syntax: Switch field privacy as necessaryAlex Crichton-5/+5
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