about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving
AgeCommit message (Collapse)AuthorLines
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-43/+45
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-14Fix all code examplesAlex Crichton-12/+20
2014-02-14auto merge of #12234 : sfackler/rust/restructure-item-decorator, r=huonwbors-65/+67
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. @huonw
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-22/+18
2014-02-13Tweak ItemDecorator APISteven Fackler-65/+67
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-11libsyntax -- fix unsafe sharing in closuresNiko Matsakis-9/+12
2014-02-11to_str -- update to contain scope of closureNiko Matsakis-20/+21
2014-02-08Update deriving to pass around the `cx` linearlyNiko Matsakis-132/+157
2014-02-08Fixed error starting with uppercasemr.Shu-16/+16
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-08Implement `#[deriving(Show)]`.Huon Wilson-0/+140
2014-02-08syntax: convert deriving to take &mut ExtCtxt.Huon Wilson-62/+62
2014-02-08syntax: remove some dead code.Huon Wilson-15/+1
2014-02-07Removed @self and @Trait.Eduard Burtescu-7/+2
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-8/+7
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
2014-02-02librustc: De-`@str` `NameAndSpan`Patrick Walton-1/+1
2014-02-02librustc: Fix merge fallout.Patrick Walton-4/+7
2014-02-02libsyntax: De-`@str` literal strings in the ASTPatrick Walton-41/+100
2014-02-02libsyntax: Introduce an `InternedString` type to reduce `@str` in thePatrick Walton-6/+14
compiler and use it for attributes
2014-01-31Fix minor doc typosVirgile Andreani-2/+2
2014-01-30Implement default type parameters in generics.Eduard Burtescu-2/+2
2014-01-27auto merge of #11826 : huonw/rust/7621-deriving-errors, r=alexcrichtonbors-9/+7
cc #7621. See the commit message. I'm not sure if we should merge this now, or wait until we can write `Clone::clone(x)` which will directly solve the above issue with perfect error messages.
2014-01-28syntax: make deriving have slightly less cryptic error messages.Huon Wilson-9/+7
This unfortunately changes an error like error: mismatched types: expected `&&NotClone` but found `&NotClone` into error: type `NotClone` does not implement any method in scope named `clone`
2014-01-27Demote self to an (almost) regular argument and remove the env param.Eduard Burtescu-4/+8
Fixes #10667 and closes #10259.
2014-01-27syntax: improve the spans of some #[deriving] traits.Huon Wilson-137/+138
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-26syntax: Fix a missing closing code tag in docs.Huon Wilson-0/+1
2014-01-21[std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behaviorSimon Sapin-2/+2
2014-01-21[std::vec] Rename .last_opt() to .last(), drop the old .last() behaviorSimon Sapin-1/+1
2014-01-18syntax::ext: replace span_fatal with span_err in many places.Huon Wilson-5/+9
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-16Load macros from external modulesSteven Fackler-1/+1
2014-01-12Removed remnants of `@mut` and `~mut` from comments and the type system.Eduard Burtescu-1/+1
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-107/+105
2014-01-08auto merge of #11370 : alexcrichton/rust/issue-10465, r=pwaltonbors-1/+0
Turned out to be a 2-line fix, but the compiler fallout was huge.
2014-01-07Fix remaining cases of leaking importsAlex Crichton-1/+0
2014-01-07'borrowed pointer' -> 'reference'Brian Anderson-1/+1
2014-01-03librustc: Remove `@mut` support from the parserPatrick Walton-4/+4
2013-12-28Stop using @ExtCtxtSteven Fackler-55/+55
2013-12-11Make 'self lifetime illegal.Erik Price-45/+45
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-07syntax::deriving: indicate from which trait type errors (etc) ariseHuon Wilson-4/+22
using the expansion info. Previously something like struct NotEq; #[deriving(Eq)] struct Error { foo: NotEq } would just point to the `foo` field, with no mention of the `deriving(Eq)`. With this patch, the compiler creates a note saying "in expansion of #[deriving(Eq)]" pointing to the Eq.
2013-12-07syntax::deriving: add the cx and span to the TraitDef to reduce duplication.Huon Wilson-226/+251
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-19/+15
critical enum sizes.
2013-11-28Register new snapshotsAlex Crichton-14/+14
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-74/+80
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-16/+17
2013-11-19libsyntax: Change all uses of `&fn` to `||`.Patrick Walton-16/+24
2013-11-19Mark some derived methods as #[inline].Huon Wilson-1/+27
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-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-14/+15
2013-11-08syntax::ext: Make type errors in deriving point to the field itself.Huon Wilson-312/+327
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-10-25libsyntax/librustc: Allow mut qualifier in patterns.Luqman Aden-2/+2
2013-10-22libsyntax/librustc: Allow specifying mut on ~self.Luqman Aden-1/+1
2013-10-22libsyntax/librustc: Allow specifying mut on by-value self.Luqman Aden-1/+1