summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/mod.rs
AgeCommit message (Collapse)AuthorLines
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-7/+6
2014-08-07Rename `Share` to `Sync`Alex Crichton-1/+1
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-06-14Register new snapshotsAlex Crichton-1/+0
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-3/+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-30syntax: Prepare for Total{Eq,Ord} => {Eq,Ord}Alex Crichton-2/+3
This commit adds the groundwork for the renaming of the Total{Eq,Ord} traits. After this commit hits a snapshot, the traits can be renamed.
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-3/+2
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-28rustc: Accept PartialOrd/PartialOrdEq for Eq/OrdAlex Crichton-2/+3
This is a transitionary step towards completing #12517. This change modifies the compiler to accept Partial{Ord,Eq} as deriving modes which will currently expand to implementations of PartialOrd and PartialEq (synonyms for Eq/Ord). After a snapshot, all of deriving(Eq, Ord) will be removed, and after a snapshot of that, TotalEq/TotalOrd will be renamed to Eq/Ord.
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