about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/mod.rs
AgeCommit message (Collapse)AuthorLines
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-2/+4
2014-05-01Allow built-in traits to be derivedFlavio Percoco-0/+5
[RFC #3] cc #13231
2014-03-18Docify std::vec_ngSteven Fackler-1/+1
I also removed a couple of methods that were silly and added sort.
2014-03-08Removed DeepClone. Issue #12698.Michael Darakananda-1/+0
2014-02-27Fix syntax::ext::deriving{,::*} docs formatting.Chris Morgan-2/+2
The most significant fix is for `syntax::ext::deriving::encodable`, where one of the blocks of code, auspiciously containing `<S>` (recall that Markdown allows arbitrary HTML to be contained inside it), was not formatted as a code block, with a fun but messy effect.
2014-02-24Remove deriving(ToStr)Alex Crichton-2/+0
This has been superseded by deriving(Show). cc #9806
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-2/+0
2014-02-21std: rewrite Hash to make it more genericErick Tryzelaar-0/+2
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/+4
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-13Tweak ItemDecorator APISteven Fackler-9/+7
The old method of building up a list of items and threading it through all of the decorators was unwieldy and not really scalable as non-deriving ItemDecorators become possible. The API is now that the decorator gets an immutable reference to the item it's attached to, and a callback that it can pass new items to. If we want to add syntax extensions that can modify the item they're attached to, we can add that later, but I think it'll have to be separate from ItemDecorator to avoid strange ordering issues.
2014-02-08Implement `#[deriving(Show)]`.Huon Wilson-0/+2
2014-02-08syntax: convert deriving to take &mut ExtCtxt.Huon Wilson-1/+1
2014-02-08syntax: remove some dead code.Huon Wilson-15/+1
2014-02-02libsyntax: Introduce an `InternedString` type to reduce `@str` in thePatrick Walton-4/+4
compiler and use it for attributes
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-7/+7
2014-01-07Fix remaining cases of leaking importsAlex Crichton-1/+0
2013-12-28Stop using @ExtCtxtSteven Fackler-3/+3
2013-12-11Make 'self lifetime illegal.Erik Price-2/+2
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-2/+2
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-11/+11
2013-10-02syntax: Add #[deriving(FromPrimitive)] syntax extensionErick Tryzelaar-0/+4
Right now this only works for c-style enums.
2013-09-30syntax: Remove usage of fmt!Alex Crichton-2/+2
2013-09-12syntax: add #[deriving(Default)] syntax extensionErick Tryzelaar-0/+2
2013-09-02Renamed syntax::ast::ident -> IdentMarvin Löbel-3/+3
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-4/+4
2013-07-20syntax: modernise attribute handling in syntax::attr.Huon Wilson-10/+9
This does a number of things, but especially dramatically reduce the number of allocations performed for operations involving attributes/ meta items: - Converts ast::meta_item & ast::attribute and other associated enums to CamelCase. - Converts several standalone functions in syntax::attr into methods, defined on two traits AttrMetaMethods & AttributeMethods. The former is common to both MetaItem and Attribute since the latter is a thin wrapper around the former. - Deletes functions that are unnecessary due to iterators. - Converts other standalone functions to use iterators and the generic AttrMetaMethods rather than allocating a lot of new vectors (e.g. the old code would have to allocate a new vector to use functions that operated on &[meta_item] on &[attribute].) - Moves the core algorithm of the #[cfg] matching to syntax::attr, similar to find_inline_attr and find_linkage_metas. This doesn't have much of an effect on the speed of #[cfg] stripping, despite hugely reducing the number of allocations performed; presumably most of the time is spent in the ast folder rather than doing attribute checks. Also fixes the Eq instance of MetaItem_ to correctly ignore spaces, so that `rustc --cfg 'foo(bar)'` now works.
2013-06-25great renaming propagation: syntaxCorey Richardson-2/+0
2013-06-16auto merge of #7142 : alexcrichton/rust/deriving-zero, r=pcwaltonbors-0/+2
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-14add IteratorUtil to the preludeDaniel Micay-1/+0
2013-06-14Implement a deriving(Zero) attributeAlex Crichton-0/+2
2013-06-13Use @str instead of @~str in libsyntax and librustc. Fixes #5048.Huon Wilson-12/+12
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-1/+2
2013-06-07syntax: move functions from deriving/mod to deriving/generic.Huon Wilson-254/+1
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-3/+4
You can still initialize multiple variables at once with "let (x, y) = (1, 2)".
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+3
2013-05-22syntax: Change syntax extensions to expand to `std::foo` instead of `core::foo`Patrick Walton-1/+1
2013-05-22librustc: Change `std` to `extra` throughout libsyntax and librustcPatrick Walton-1/+1
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+2
to libextra
2013-05-22syntax/ext: convert all AstBuilder methods to a uniform syntax.Huon Wilson-63/+39
2013-05-22syntax/ext: migrate build.rs functions to AstBuilder methods.Huon Wilson-26/+26
2013-05-22syntax/ext: modernise ext_ctxt to be CamelCase and use new.Huon Wilson-13/+13
2013-05-20Remove all unnecessary allocations (as flagged by lint)Alex Crichton-2/+2
2013-05-16syntax: implement #[deriving(DeepClone)]. Fixes #6514.Huon Wilson-0/+1
2013-05-16syntax: deprecate #[auto_{en,de}code] in favour of #[deriving({En,De}codable)].Huon Wilson-4/+9
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-14syntax: Remove #[allow(vecs_implicitly_copyable)]Alex Crichton-4/+4
2013-05-12librustc: Make `self` and `static` into keywordsPatrick Walton-2/+1
2013-05-09Use a specialized string interner to reduce the need for owned stringsBjörn Steinbrink-3/+3
&str can be turned into @~str on demand, using to_owned(), so for strings, we can create a specialized interner that accepts &str for intern() and find() but stores and returns @~str.
2013-05-08librustc: Fix merge fallout.Patrick Walton-2/+2
2013-05-07libsyntax: add #[deriving(Rand, ToStr)].Huon Wilson-0/+6
The former fills each field of a struct or enum variant with a random value (and picks a random enum variant). The latter makes the .to_str method have the same output as fmt!("%?", ..).
2013-05-07libsyntax: extend generic deriving code to handle almost all possible traits.Huon Wilson-122/+142
This adds support for static methods, and arguments of most types, traits with type parameters, methods with type parameters (and lifetimes for both), as well as making the code more robust to support deriving on types with lifetimes (i.e. 'self).