about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/cmp/totalord.rs
AgeCommit message (Collapse)AuthorLines
2015-04-15syntax: Rename deriving/cmp/* to match their current namesErick Tryzelaar-142/+0
2015-03-03Switched to Box::new in many places.Felix S. Klock II-4/+4
Many of the modifications putting in `Box::new` calls also include a pointer to Issue 22405, which tracks going back to `box <expr>` if possible in the future. (Still tried to use `Box<_>` where it sufficed; thus some tests still have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.) Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-07Don't use std:: paths in syntax extensions when compiling a #![no_std] crateKeegan McAllister-4/+4
Fixes #16803. Fixes #14342. Fixes half of #21827 -- slice syntax is still broken.
2015-02-07Use path helper macros in derivingKeegan McAllister-2/+2
2015-01-25Associated types support for deriving::generic::TraitDefDzmitry Malyshau-1/+2
2015-01-17s/deriving/derives in Comments/DocsEarl St Sauver-2/+2
There are a large number of places that incorrectly refer to deriving in comments, instead of derives. Fixes #20984
2015-01-05syntax: remove remaining boxed closuresJorge Aparicio-2/+2
2014-12-15rollup merge of #19812: frewsxcv/expansion-include-enumBrian Anderson-0/+1
In preparation for [removing the `std::cmp::Ordering` reexport](https://github.com/rust-lang/rust/issues/19253), this needs to be done to prevent errors like: ``` note: in expansion of #[deriving] note: expansion site error: unresolved name `std::cmp::Equal` #[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Show)] ^~~ ```
2014-12-13libsyntax: use unboxed closuresJorge Aparicio-5/+7
2014-12-13Expansion should explicitly include enumCorey Farwell-0/+1
In preparation for removing the std::cmp::Ordering reexport, this needs to be done to prevent errors like: ``` note: in expansion of #[deriving] note: expansion site error: unresolved name `std::cmp::Equal` \#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Show)] ^~~ ```
2014-12-07syntax: use UFCS in the expansion of `#[deriving(Ord)]`Jorge Aparicio-4/+25
cc #18755
2014-12-05Utilize fewer reexportsCorey Farwell-3/+3
In regards to: https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729 This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::* and Result::*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
2014-11-07Update Partial/Total Eq/Ord terminologyJorge Aparicio-1/+1
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-7/+6
2014-07-11Removed dead structures after changes to PartialOrd/Ord derivings.Felix S. Klock II-27/+4
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-1/+16
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-1/+1
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/+5
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-05-30syntax: Prepare for Total{Eq,Ord} => {Eq,Ord}Alex Crichton-2/+2
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-04-23auto merge of #13704 : edwardw/rust/doc-hidden, r=alexcrichtonbors-1/+4
Closes #13698
2014-04-23Fix other bugs with new closure borrowingAlex Crichton-1/+3
This fixes various issues throughout the standard distribution and tests.
2014-04-23Honor hidden doc attribute of derivable trait methodsEdward Wang-1/+4
Closes #13698
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+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-10/+10
2014-02-21syntax: Allow syntax extensions to have attributesErick Tryzelaar-0/+1
2014-02-13Tweak ItemDecorator APISteven Fackler-2/+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-3/+2
2014-02-08Fixed error starting with uppercasemr.Shu-1/+1
Error messages cleaned in librustc/middle Error messages cleaned in libsyntax Error messages cleaned in libsyntax more agressively Error messages cleaned in librustc more aggressively Fixed affected tests Fixed other failing tests Last failing tests fixed
2014-02-08syntax: convert deriving to take &mut ExtCtxt.Huon Wilson-5/+7
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-2/+2
2013-12-28Stop using @ExtCtxtSteven Fackler-3/+3
2013-12-07syntax::deriving: add the cx and span to the TraitDef to reduce duplication.Huon Wilson-1/+3
2013-11-19Mark some derived methods as #[inline].Huon Wilson-0/+1
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-09-03Modernized a few more types in syntax::astMarvin Löbel-3/+3
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-4/+4
2013-08-04syntax: make #[deriving(TotalOrd)] lazy.Huon Wilson-16/+47
Previously it would call: f(sf1.cmp(&of1), f(sf2.cmp(&of2), ...)) (where s/of1 = 'self/other field 1', and f was std::cmp::lexical_ordering) This meant that every .cmp subcall got evaluated when calling a derived TotalOrd.cmp. This corrects this to use let test = sf1.cmp(&of1); if test == Equal { let test = sf2.cmp(&of2); if test == Equal { // ... } else { test } } else { test } This gives a lexical ordering by short-circuiting on the first comparison that is not Equal.
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-06-25great renaming propagation: syntaxCorey Richardson-3/+1
2013-06-07syntax: move expand_generic_deriving to be a method on TraitDefHuon Wilson-2/+1
2013-05-22syntax: Change syntax extensions to expand to `std::foo` instead of `core::foo`Patrick Walton-4/+4
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-9/+10
2013-05-22syntax/ext: migrate build.rs functions to AstBuilder methods.Huon Wilson-3/+3
2013-05-22syntax/ext: modernise ext_ctxt to be CamelCase and use new.Huon Wilson-4/+4
2013-05-21syntax/ext: remove the ~str dependence of the deriving code.Huon Wilson-3/+3
2013-05-14rustc: rename ast::self_ty and related fields to explicit_selfErick Tryzelaar-1/+1
2013-05-14syntax: Remove #[allow(vecs_implicitly_copyable)]Alex Crichton-4/+5