about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/iter_bytes.rs
AgeCommit message (Collapse)AuthorLines
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-100/+0
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-2/+2
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-2/+2
2014-01-27syntax: improve the spans of some #[deriving] traits.Huon Wilson-11/+12
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-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-2/+2
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/+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-11-08syntax::ext: Make type errors in deriving point to the field itself.Huon Wilson-2/+2
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-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-3/+3
2013-08-03remove obsolete `foreach` keywordDaniel Micay-1/+1
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-1/+1
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-2/+3
2013-06-29'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep ↵Ben Blum-3/+9
for making them noncopyable.
2013-06-25great renaming propagation: syntaxCorey Richardson-2/+0
2013-06-23vec: remove BaseIter implementationDaniel Micay-1/+1
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-14add IteratorUtil to the preludeDaniel Micay-1/+0
2013-06-09std: remove fold[lr] in favour of iteratorsHuon Wilson-2/+2
2013-06-07syntax: move expand_generic_deriving to be a method on TraitDefHuon Wilson-1/+1
2013-05-30Remove copy bindings from patterns.Niko Matsakis-2/+2
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+2
2013-05-22syntax: Change syntax extensions to expand to `std::foo` instead of `core::foo`Patrick Walton-2/+2
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-3/+3
2013-05-22syntax/ext: migrate build.rs functions to AstBuilder methods.Huon Wilson-4/+4
2013-05-22syntax/ext: modernise ext_ctxt to be CamelCase and use new.Huon Wilson-3/+3
2013-05-21syntax/ext: remove the ~str dependence of the deriving code.Huon Wilson-5/+5
2013-05-15auto merge of #6500 : kud1ing/rust/cleanup, r=bstriebors-10/+0
Fixes #6445
2013-05-15remove deriving_eq, deriving_iter_bytes, deriving_clone (deprecated in 0.6)Lenny222-10/+0
2013-05-14rustc: rename ast::self_ty and related fields to explicit_selfErick Tryzelaar-1/+1
2013-05-10Fix deriving(IterBytes) to use the new for-loop protocolAlex Crichton-11/+15
2013-05-08librustc: Remove mutable fields from the language.Patrick Walton-1/+1
They're still parsed though, to get through bootstrapping.
2013-05-07libsyntax: convert #[deriving(IterBytes)] to generic derivingHuon Wilson-223/+61
2013-04-27only use #[no_core] in libcoreDaniel Micay-4/+0
2013-04-19syntax: de-mode and prepare for de-modeing rustcAlex Crichton-1/+1
2013-04-12libsyntax: abstract most of the deriving boilerplate into a simpler(r) ↵Huon Wilson-2/+3
interface. Pulls out many of the common patterns from the Eq and Clone deriving code (and invents a few of its own), so that deriving instances are very easy to write for a certain class of traits. (Basically, those which don't have parameters and where all methods only take arguments of type `&Self` and return either `Self` or types with no parameters.)
2013-04-10syntax: Simplify deriving to handle classes that take generics, like EncodableErick Tryzelaar-2/+4
2013-04-10syntax: update a deriving error message to use the new syntaxErick Tryzelaar-1/+1
2013-03-28Removing unused importsAlex Crichton-8/+1
2013-03-28librustc: Remove common fields and nested enums from the languagePatrick Walton-1/+1
2013-03-27remove sty_by_ref, though traces still remain due to dtorsNiko Matsakis-1/+1
2013-03-26Rip out old code that still structured method calls as aNiko Matsakis-8/+5
expr_call(expr_field(...)) rather than an expr_method_call. There is probably more such code in trans that should be removed.
2013-03-22syntax: make old `#[deriving_foo]` attribute obsoleteAndrew Paseltiner-0/+10