about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/clone.rs
AgeCommit message (Collapse)AuthorLines
2015-12-15Move built-in syntax extensions to a separate crateSeo Sanghyeon-114/+0
2015-08-29Allow #[derive()] to generate unsafe trait implsMichael Layzell-0/+1
2015-08-03syntax: Implement #![no_core]Alex Crichton-6/+1
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-05-22Let MultiItemDecorator take `&Annotatable` (fixes #25683)Manish Goregaokar-2/+2
2015-05-17Allow #[derive()] to generate unsafe methodsManish Goregaokar-0/+1
2015-05-12RebasingNick Cameron-1/+1
2015-04-30WIP refactor expansion of decorators and move derive to MultiDecoratorNick Cameron-4/+4
2015-04-18Auto merge of #23985 - erickt:derive-cleanup, r=ericktbors-6/+5
This extracts some of the minor cleanup patches from #23905.
2015-04-15syntax: Change deriving methods to take a `&mut FnMut(P<Item>)`Erick Tryzelaar-6/+5
This allows #[derive(...)]` to create more than one impl
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-03-03Switched to Box::new in many places.Felix S. Klock II-2/+2
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-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-3/+3
where possible.
2015-02-12Made `Self` a keyword.Marvin Löbel-1/+1
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
2015-02-07Don't use std:: paths in syntax extensions when compiling a #![no_std] crateKeegan McAllister-2/+2
Fixes #16803. Fixes #14342. Fixes half of #21827 -- slice syntax is still broken.
2015-02-07Use path helper macros in derivingKeegan McAllister-1/+1
2015-02-04remove all kind annotations from closuresJorge Aparicio-1/+1
2015-01-25Associated types support for deriving::generic::TraitDefDzmitry Malyshau-1/+2
2015-01-17s/deriving/derives in Comments/DocsEarl St Sauver-3/+3
There are a large number of places that incorrectly refer to deriving in comments, instead of derives. Fixes #20984
2015-01-07use slicing sugarJorge Aparicio-5/+5
2015-01-07Replace full slice notation with index callsNick Cameron-3/+3
2015-01-05syntax: remove remaining boxed closuresJorge Aparicio-1/+1
2014-12-21Fallout of std::str stabilizationAlex Crichton-6/+3
2014-12-13libsyntax: use unboxed closuresJorge Aparicio-5/+7
2014-12-13libsyntax: fix falloutJorge Aparicio-1/+1
2014-11-17Switch to purely namespaced enumsSteven Fackler-6/+7
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-03syntax: Use UFCS in the expansion of `#[deriving(Clone)]`Jorge Aparicio-3/+11
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-1/+1
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
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-2/+1
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/+1
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/+6
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-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-9/+17
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-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-08Removed DeepClone. Issue #12698.Michael Darakananda-30/+0
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-1/+3
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-13/+13
2014-02-21syntax: Allow syntax extensions to have attributesErick Tryzelaar-0/+2
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-23/+20
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-13Tweak ItemDecorator APISteven Fackler-6/+6
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-6/+4
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-3/+3
2014-01-27syntax: improve the spans of some #[deriving] traits.Huon Wilson-16/+16
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).