about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/zero.rs
AgeCommit message (Collapse)AuthorLines
2015-01-03Remove deprecated functionalityAlex Crichton-102/+0
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2014-12-31syntax: unbox closures used in let bindingsJorge Aparicio-1/+1
2014-12-13libsyntax: use unboxed closuresJorge Aparicio-5/+7
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-7/+5
2014-07-11Removed dead structures after changes to PartialOrd/Ord derivings.Felix S. Klock II-6/+0
Remove the `NonMatchesExplode` variant now that no deriving impl uses it. Removed `EnumNonMatching` entirely. Remove now irrelevant `on_matching` field and `HandleNonMatchingEnums` type. Removed unused `EnumNonMatchFunc` type def. Drive-by: revise `EnumNonMatchCollapsedFunc` doc. Made all calls to `expand_enum_method_body` go directly to `build_enum_match_tuple`. Alpha-rename `enum_nonmatch_g` back to `enum_nonmatch_f` to reduce overall diff noise. Inline sole call of `some_ordering_const`. Inline sole call of `ordering_const`. Removed a bunch of code that became dead after the above changes.
2014-07-11`O(n*k)` code-size deriving on enums (better than previous `O(n^k)`).Felix S. Klock II-0/+4
In the above formulas, `n` is the number of variants, and `k` is the number of self-args fed into deriving. In the particular case of interest (namely `PartialOrd` and `Ord`), `k` is always 2, so we are basically comparing `O(n)` versus `O(n^2)`. Also, the stage is set for having *all* enum deriving codes go through `build_enum_match_tuple` and getting rid of `build_enum_match`. Also, seriously attempted to clean up the code itself. Added a bunch of comments attempting to document what I learned as I worked through the original code and adapted it to this new strategy.
2014-07-11Revise the `const_nonmatching` flag with more info about author's intent.Felix S. Klock II-2/+2
In particular, I want authors of deriving modes to understand what they are opting into (namely quadratic code size or worse) when they select NonMatchesExplode.
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-4/+7
2014-06-02syntax: Remove use of `pub use` globsklutzy-0/+1
`quote_expr!` now injects two more (priv) `use` globs. This may cause extra unused_imports warning.
2014-04-23auto merge of #13704 : edwardw/rust/doc-hidden, r=alexcrichtonbors-2/+5
Closes #13698
2014-04-23Fix other bugs with new closure borrowingAlex Crichton-3/+5
This fixes various issues throughout the standard distribution and tests.
2014-04-23Honor hidden doc attribute of derivable trait methodsEdward Wang-2/+5
Closes #13698
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-3/+3
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-2/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-1/+1
Closes #12771
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-0/+2
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-11/+11
2014-02-21syntax: Allow syntax extensions to have attributesErick Tryzelaar-0/+1
2014-02-13Tweak ItemDecorator APISteven Fackler-3/+3
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-08Update deriving to pass around the `cx` linearlyNiko Matsakis-4/+3
2014-02-08syntax: convert deriving to take &mut ExtCtxt.Huon Wilson-2/+2
2014-01-27syntax: improve the spans of some #[deriving] traits.Huon Wilson-6/+6
This makes error messages about (e.g.) `#[deriving(Clone)] struct Foo { x: Type }` point at `x: Type` rather than `Clone` in the header (while still referring to the `#[deriving(Clone)]` in the expansion info).
2014-01-18syntax::ext: replace span_fatal with span_err in many places.Huon Wilson-2/+3
This means that compilation continues for longer, and so we can see more errors per compile. This is mildly more user-friendly because it stops users having to run rustc n times to see n macro errors: just run it once to see all of them.
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-3/+3
2013-12-28Stop using @ExtCtxtSteven Fackler-2/+2
2013-12-07syntax::deriving: add the cx and span to the TraitDef to reduce duplication.Huon Wilson-1/+3
2013-11-28Register new snapshotsAlex Crichton-1/+1
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-2/+2
2013-11-19Mark some derived methods as #[inline].Huon Wilson-0/+2
ToStr, Encodable and Decodable are not marked as such, since they're already expensive, and lead to large methods, so inlining will bloat the metadata & the binaries. This means that something like #[deriving(Eq)] struct A { x: int } creates an instance like #[doc = "Automatically derived."] impl ::std::cmp::Eq for A { #[inline] fn eq(&self, __arg_0: &A) -> ::bool { match *__arg_0 { A{x: ref __self_1_0} => match *self { A{x: ref __self_0_0} => true && __self_0_0.eq(__self_1_0) } } } #[inline] fn ne(&self, __arg_0: &A) -> ::bool { match *__arg_0 { A{x: ref __self_1_0} => match *self { A{x: ref __self_0_0} => false || __self_0_0.ne(__self_1_0) } } } } (The change being the `#[inline]` attributes.)
2013-11-08syntax::ext: Make type errors in deriving point to the field itself.Huon Wilson-9/+7
This rearranges the deriving code so that #[deriving] a trait on a field that doesn't implement that trait will point to the field in question, e.g. struct NotEq; // doesn't implement Eq #[deriving(Eq)] struct Foo { ok: int, also_ok: ~str, bad: NotEq // error points here. } Unfortunately, this means the error is disconnected from the `deriving` itself but there's no current way to pass that information through to rustc except via the spans, at the moment. Fixes #7724.
2013-09-17extra: minor cleanup of Zero and Default syntax extensionErick Tryzelaar-5/+3
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-2/+2
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-3/+3
2013-07-20syntax: modernise attribute handling in syntax::attr.Huon Wilson-2/+2
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-07-17librustc: Remove all uses of "copy".Patrick Walton-1/+1
2013-06-25great renaming propagation: syntaxCorey Richardson-3/+1
2013-06-14Implement a deriving(Zero) attributeAlex Crichton-0/+96