about summary refs log tree commit diff
path: root/src/librustc/util
AgeCommit message (Collapse)AuthorLines
2014-06-22Refactor the unification code and rejuvenate the unit testNiko Matsakis-8/+91
infrastructure that has been accidentally left out of the build for a rather long time (it was still using `@DVec`!)
2014-06-18Remove TraitStore from ty_traitNick Cameron-3/+2
Use ty_rptr/ty_uniq(ty_trait) rather than TraitStore to represent trait types. Also addresses (but doesn't close) #12470. Part of the work towards DST (#12938). [breaking-change] lifetime parameters in `&mut trait` are now invariant. They used to be contravariant.
2014-06-16Change prints: @T -> Gc<T> , ~T -> Box<T>John Schmidt-2/+2
Fixes #14915
2014-06-15Register new snapshotsAlex Crichton-31/+0
2014-06-13librustc: Fix the issue with labels shadowing variable names by makingPatrick Walton-1/+1
the leading quote part of the identifier for the purposes of hygiene. This adopts @jbclements' solution to #14539. I'm not sure if this is a breaking change or not. Closes #12512. [breaking-change]
2014-06-13Introduce VecPerParamSpace and use it to represent sets of types andNiko Matsakis-81/+87
parameters This involves numerous substeps: 1. Treat Self same as any other parameter. 2. No longer compute offsets for method parameters. 3. Store all generic types (both trait/impl and method) with a method, eliminating odd discrepancies. 4. Stop doing unspeakable things to static methods and instead just use the natural types, now that we can easily add the type parameters from trait into the method's polytype. 5. No doubt some more. It was hard to separate these into distinct commits. Fixes #13564
2014-06-11std: Remove i18n/l10n from format!Alex Crichton-1/+32
* The select/plural methods from format strings are removed * The # character no longer needs to be escaped * The \-based escapes have been removed * '{{' is now an escape for '{' * '}}' is now an escape for '}' Closes #14810 [breaking-change]
2014-06-11rustc: Move the AST from @T to Gc<T>Alex Crichton-2/+2
2014-06-11rustc: Update how Gc<T> is recognizedAlex Crichton-1/+1
This commit uses the same trick as ~/Box to map Gc<T> to @T internally inside the compiler. This moves a number of implementations of traits to the `gc` module in the standard library. This removes functions such as `Gc::new`, `Gc::borrow`, and `Gc::ptr_eq` in favor of the more modern equivalents, `box(GC)`, `Deref`, and pointer equality. The Gc pointer itself should be much more useful now, and subsequent commits will move the compiler away from @T towards Gc<T> [breaking-change]
2014-06-10auto merge of #14764 : jbcrail/rust/fix-more-comments, r=alexcrichtonbors-2/+2
2014-06-10Fix more misspelled comments and strings.Joseph Crail-2/+2
2014-06-08Remove the dead code identified by the new lintJakub Wieczorek-11/+5
2014-06-06Rename Iterator::len to countAaron Turon-1/+1
This commit carries out the request from issue #14678: > The method `Iterator::len()` is surprising, as all the other uses of > `len()` do not consume the value. `len()` would make more sense to be > called `count()`, but that would collide with the current > `Iterator::count(|T| -> bool) -> unit` method. That method, however, is > a bit redundant, and can be easily replaced with > `iter.filter(|x| x < 5).count()`. > After this change, we could then define the `len()` method > on `iter::ExactSize`. Closes #14678. [breaking-change]
2014-06-06Move subst data structures into subst.rs, fix capitalizationNiko Matsakis-9/+11
2014-06-06auto merge of #14667 : aochagavia/rust/pr2, r=huonwbors-4/+7
2014-06-06Change to_str().to_string() to just to_str()Adolfo OchagavĂ­a-4/+7
2014-06-05Fallout from the libcollections movementAlex Crichton-7/+5
2014-06-01std: Drop Total from Total{Eq,Ord}Alex Crichton-2/+2
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-28std: Remove format_strbuf!()Alex Crichton-137/+119
This was only ever a transitionary macro.
2014-05-27std: Rename strbuf operations to stringRicho Healey-58/+58
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-89/+89
[breaking-change]
2014-05-23auto merge of #14317 : P1start/rust/lifetime-formatting, r=alexcrichtonbors-1/+1
This changes certain error messages about lifetimes so that they display lifetimes without an `&`. Fixes #10291.
2014-05-23Fix lifetime error to print `'a` instead of `&'a`P1start-1/+1
This changes certain error messages about lifetimes so that they display lifetimes without an `&`. Fixes #10291.
2014-05-22libstd: Remove all uses of `~str` from `libstd`Patrick Walton-1/+1
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-5/+5
2014-05-13syntax: Improve --pretty normal slightlyAlex Crichton-4/+4
When printing doc comments, always put a newline after them in a macro invocation to ensure that a line-doc-comment doesn't consume remaining tokens on the line.
2014-05-13syntax: Fix printing INT64_MINAlex Crichton-13/+9
Integers are always parsed as a u64 in libsyntax, but they're stored as i64. The parser and pretty printer both printed an i64 instead of u64, sometimes introducing an extra negative sign.
2014-05-12librustc: Remove all uses of `~str` from librustc.Patrick Walton-281/+336
2014-05-10auto merge of #14073 : alexcrichton/rust/snapshots, r=huonwbors-6/+5
2014-05-10auto merge of #14066 : edwardw/rust/pod-to-copy, r=alexcrichtonbors-2/+2
Some error messages still use the word `Pod` instead of `Copy`. Renames them.
2014-05-09Register new snapshotsAlex Crichton-6/+5
2014-05-09auto merge of #14057 : kballard/rust/remove_no-bounds, r=sfacklerbors-7/+1
Printing <no-bounds> on trait objects comes from a time when trait objects had a non-empty default bounds set. As they no longer have any default bounds, printing <no-bounds> is just noise.
2014-05-10Rename Pod to CopyEdward Wang-2/+2
Some error messages still use the word `Pod` instead of `Copy`. Renames them.
2014-05-09Currently trans uses Vec<ty::t> to represent substitutions instead of a properNiko Matsakis-0/+6
ty::substs struct. This is a holdover from the olden days of yore. This patch removes the last vestiges of that practice. This is part of the work I was doing on #5527.
2014-05-08Remove <no-bounds> on trait objectsKevin Ballard-7/+1
Printing <no-bounds> on trait objects comes from a time when trait objects had a non-empty default bounds set. As they no longer have any default bounds, printing <no-bounds> is just noise.
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-4/+4
2014-05-07std: Modernize the local_data apiAlex Crichton-5/+3
This commit brings the local_data api up to modern rust standards with a few key improvements: * The `pop` and `set` methods have been combined into one method, `replace` * The `get_mut` method has been removed. All interior mutability should be done through `RefCell`. * All functionality is now exposed as a method on the keys themselves. Instead of importing std::local_data, you now use "key.replace()" and "key.get()". * All closures have been removed in favor of RAII functionality. This means that get() and get_mut() no long require closures, but rather return Option<SmartPointer> where the smart pointer takes care of relinquishing the borrow and also implements the necessary Deref traits * The modify() function was removed to cut the local_data interface down to its bare essentials (similarly to how RefCell removed set/get). [breaking-change]
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-3/+3
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-1/+1
2014-04-29Remove internal support for fixed length stringsNick Cameron-6/+1
2014-04-28Refactor ty_str to use a ~(str) representation.Nick Cameron-21/+6
Similar to my recent changes to ~[T]/&[T], these changes remove the vstore abstraction and represent str types as ~(str) and &(str). The Option<uint> in ty_str is the length of the string, None if the string is dynamically sized.
2014-04-22rustc: de-@ middle::ty.Eduard Burtescu-1/+8
2014-04-22rustc: de-@ some RefCell's.Eduard Burtescu-8/+13
2014-04-21Fix misspellings in comments.Joseph Crail-2/+2
2014-04-20Refactor ty_vec represent &[T] as &([T])Nick Cameron-24/+12
Refactores all uses of ty_vec and associated things to remove the vstore abstraction (still used for strings, for now). Pointers to vectors are stored as ty_rptr or ty_uniq wrapped around a ty_vec. There are no user-facing changes. Existing behaviour is preserved by special-casing many instances of pointers containing vectors. Hopefully with DST most of these hacks will go away. For now it is useful to leave them hanging around rather than abstracting them into a method or something. Closes #13554.
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-38/+41
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-2/+1
2014-04-15Use the unsigned integer types for bitwise intrinsics.Huon Wilson-6/+4
Exposing ctpop, ctlz, cttz and bswap as taking signed i8/i16/... is just exposing the internal LLVM names pointlessly (LLVM doesn't have "signed integers" or "unsigned integers", it just has sized integer types with (un)signed *operations*). These operations are semantically working with raw bytes, which the unsigned types model better.
2014-04-14auto merge of #13480 : edwardw/rust/vtable-ice, r=alexcrichtonbors-2/+3
A mismatched type with more type parameters than the expected one causes `typeck` looking up out of the bound of type parameter vector, which leads to ICE. Closes #13466
2014-04-13auto merge of #13452 : Ryman/rust/fix_uint_as_u, r=alexcrichtonbors-4/+2
Fixes #13359.