summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving
AgeCommit message (Collapse)AuthorLines
2013-06-30Remove vec::{map, mapi, zip_map} and the methods, except for .map, since thisHuon Wilson-11/+12
is very common, and the replacement (.iter().transform().collect()) is very ugly.
2013-06-29Remove mutability from unique boxes in the ASTAlex Crichton-1/+1
2013-06-29'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep ↵Ben Blum-4/+10
for making them noncopyable.
2013-06-28librustc: Change "Owned" to "Send" everywherePatrick Walton-4/+4
2013-06-27Remove many shared pointersPhilipp Brüschweiler-2/+0
Mostly just low-haning fruit, i.e. function arguments that were @ even though & would work just as well. Reduces librustc.so size by 200k when compiling without -O, by 100k when compiling with -O.
2013-06-26Infer default static/Owned bounds for unbounded heap fns/traits (#7264)Ben Blum-3/+3
2013-06-25auto merge of #7365 : cmr/rust/syntax_cleanup, r=Aatchbors-35/+10
Sets the stage for further cleanup (especially mass-slaughter of `@`)
2013-06-25remove the redundant `each` method from OptVecDaniel Micay-2/+2
2013-06-25great renaming propagation: syntaxCorey Richardson-35/+10
2013-06-23Parse and typecheck (not kindcheck) bounds on trait paths.Ben Blum-3/+5
2013-06-22auto merge of #7274 : thestinger/rust/size_hint, r=huonwbors-4/+4
I ran into a weird lifetime bug blocking updating the `collect` method to use `FromIterator`, but everything here works fine.
2013-06-23vec: remove BaseIter implementationDaniel Micay-4/+4
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-22Expand the deriving(ToStr) implementationAlex Crichton-11/+64
2013-06-21vec: rm old_iter implementations, except BaseIterDaniel Micay-7/+7
The removed test for issue #2611 is well covered by the `std::iterator` module itself. This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-5/+5
2013-06-16auto merge of #7142 : alexcrichton/rust/deriving-zero, r=pcwaltonbors-0/+98
This allows mass-initialization of large structs without having to specify all the fields. I'm a bit hesitant, but I wanted to get this out there. I don't really like using the `Zero` trait, because it doesn't really make sense for a type like `HashMap` to use `Zero` as the 'blank allocation' trait. In theory there'd be a new trait, but then that's adding cruft to the language which may not necessarily need to be there. I do think that this can be useful, but I only implemented `Zero` on the basic types where I thought it made sense, so it may not be all that usable yet. (opinions?)
2013-06-14auto merge of #7121 : huonw/rust/rand-call, r=pnkfelixbors-3/+4
r? @pnkfelix
2013-06-14add IteratorUtil to the preludeDaniel Micay-3/+0
2013-06-14Implement a deriving(Zero) attributeAlex Crichton-0/+98
2013-06-14syntax: revert the uint -> u32 "fix"; make the names/comment match.Huon Wilson-4/+4
2013-06-14syntax: correct the Rand::rand call to select enum variants in ↵Huon Wilson-4/+5
#[deriving(Rand)]. Previously, this was not a global call, and so when `#[deriving(Rand)]` was in any module other than the top-level one, it failed (unless there was a `use std;` in scope). Also, fix a minor inconsistency between uints and u32s for this piece of code.
2013-06-13Use @str instead of @~str in libsyntax and librustc. Fixes #5048.Huon Wilson-16/+16
This almost removes the StringRef wrapper, since all strings are Equiv-alent now. Removes a lot of `/* bad */ copy *`'s, and converts several things to be &'static str (the lint table and the intrinsics table). There are many instances of .to_managed(), unfortunately.
2013-06-09std: remove foldr and alli methods in vecHuon Wilson-5/+6
2013-06-09std: remove fold[lr] in favour of iteratorsHuon Wilson-2/+2
2013-06-08std: remove vec::each2 and vec::each2_mut in favour of iteratorsHuon Wilson-2/+3
2013-06-07syntax: correct the modifications to deriving(Ord) so that it works.Huon Wilson-30/+13
2013-06-07syntax: rewrite deriving(Ord) to not require Eq.Huon Wilson-57/+59
lt and gt are implement directly in terms of the corresponding method on their elements, and le and ge are the negations of these.
2013-06-07syntax: move expand_generic_deriving to be a method on TraitDefHuon Wilson-55/+37
2013-06-07syntax: move functions from deriving/mod to deriving/generic.Huon Wilson-277/+199
These are now only called in generic and can be private. This includes manually inlining/merging some that are called once.
2013-06-04librustc: Disallow multiple patterns from appearing in a "let" declaration.Patrick Walton-6/+10
You can still initialize multiple variables at once with "let (x, y) = (1, 2)".
2013-06-01Remove all uses of `pub impl`. rs=stylePatrick Walton-18/+41
2013-05-31auto merge of #6851 : alexcrichton/rust/bugfixes, r=pcwaltonbors-957/+232
Closes #5090 by using the excellent new generic deriving code Promotes the unreachable code attribute to a lint attribute (instead of always being a warning) Fixes some edge cases when creating hashmaps/hashsets and also when consuming them. (fixes #5998)
2013-05-30Rewrite deriving(Decodable, Encodable)Alex Crichton-957/+232
Now it uses the generic deriving code and should in theory work in all cases.
2013-05-30Remove copy bindings from patterns.Niko Matsakis-3/+3
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-3/+15
2013-05-22syntax: Change syntax extensions to expand to `std::foo` instead of `core::foo`Patrick Walton-18/+18
2013-05-22librustc: Change `std` to `extra` throughout libsyntax and librustcPatrick Walton-11/+11
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-1/+23
to libextra
2013-05-22syntax/ext: convert all AstBuilder methods to a uniform syntax.Huon Wilson-434/+276
2013-05-22syntax/ext: migrate build.rs functions to AstBuilder methods.Huon Wilson-279/+245
2013-05-22syntax/ext: modernise ext_ctxt to be CamelCase and use new.Huon Wilson-98/+98
2013-05-21syntax/ext: remove the ~str dependence of the deriving code.Huon Wilson-79/+81
2013-05-20Remove all unnecessary allocations (as flagged by lint)Alex Crichton-13/+13
2013-05-16syntax: use fmt! over + in deriving/cloneHuon Wilson-6/+6
2013-05-16syntax: implement #[deriving(DeepClone)]. Fixes #6514.Huon Wilson-6/+42
2013-05-15auto merge of #6502 : huonw/rust/no-auto-code, r=graydonbors-4/+326
Replace all instances of #[auto_*code] with the appropriate #[deriving] attribute and remove the majority of the actual auto_* code, leaving stubs to refer the user to the new syntax. Also, moves the useful contents of auto_encode.rs to more appropriate spots: tests and comments to deriving/encodable.rs, and the ExtCtxtMethods trait to build.rs (unused so far, but the method syntax might be nicer than using the mk_* fns in many instances).
2013-05-15auto merge of #6500 : kud1ing/rust/cleanup, r=bstriebors-27/+0
Fixes #6445
2013-05-16syntax: deprecate #[auto_{en,de}code] in favour of #[deriving({En,De}codable)].Huon Wilson-4/+326
Replace all instances of #[auto_*code] with the appropriate #[deriving] attribute and remove the majority of the actual code, leaving stubs to refer the user to the new syntax.
2013-05-15remove deriving_eq, deriving_iter_bytes, deriving_clone (deprecated in 0.6)Lenny222-27/+0
2013-05-14rustc: rename ast::self_ty and related fields to explicit_selfErick Tryzelaar-30/+29