about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/generic/mod.rs
AgeCommit message (Collapse)AuthorLines
2015-12-15Move built-in syntax extensions to a separate crateSeo Sanghyeon-1704/+0
2015-11-26Some TLC for the MoveMap traitMarvin Löbel-1/+1
2015-11-16rename `ast::ImplItem_::*ImplItem` to `ast::ImplItemKind::*`Oliver Schneider-2/+2
2015-11-12libsyntax: deny warnings in doctestsKevin Butler-4/+5
2015-10-25syntax/rustc_front: Simplify VariantData::fieldsVadim Petrochenkov-4/+4
And use VariantData instead of P<VariantData> in Item_ and Variant_
2015-10-19Generate stability attributes for derived implsVadim Petrochenkov-1/+1
The attributes are copied from the item for which the trait impl is derived
2015-10-13Merge struct fields and struct kindVadim Petrochenkov-5/+5
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-12/+12
2015-10-13Unify structures and enum variants in ASTVadim Petrochenkov-46/+4
2015-08-29Allow #[derive()] to generate unsafe trait implsMichael Layzell-1/+11
2015-08-28Move ExpnInfo to NameManish Goregaokar-2/+2
2015-08-27Enumify CompilerExpansion in ExpnInfoManish Goregaokar-2/+1
2015-08-24Auto merge of #27239 - apasel422:issue-19102, r=huonwbors-1/+7
closes #19102
2015-08-17Implement `repr(simd)` as an alias for `#[simd]`.Huon Wilson-1/+1
2015-08-03syntax: Implement #![no_core]Alex Crichton-6/+2
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-07-23add `#[allow(unused_qualifications)]` to derived implsAndrew Paseltiner-1/+7
closes #19102
2015-07-21Avoid repeated trait bounds in derived implsFlorian Hartwig-0/+11
2015-06-14Replaced a comment mentioning a fixed issueMarkus Westerlind-3/+5
Replaced it with a comment mentioning the rationale for checking the discriminants first.
2015-06-13Utilize discriminant_value for more efficient derivingMarkus-39/+85
The new code generated for deriving on enums looks something like this: ```rust let __self0_vi = unsafe { std::intrinsics::discriminant_value(&self) } as i32; let __self1_vi = unsafe { std::intrinsics::discriminant_value(&__arg1) } as i32; let __self2_vi = unsafe { std::intrinsics::discriminant_value(&__arg2) } as i32; /// if __self0_vi == __self1_vi && __self0_vi == __self2_vi && ... { match (...) { (Variant1, Variant1, ...) => Body1 (Variant2, Variant2, ...) => Body2, ... _ => ::core::intrinsics::unreachable() } } else { ... // catch-all remainder can inspect above variant index values. } ``` This helps massively for C-like enums since they will be compiled as a single comparison giving observed speedups of up to 8x. For more complex enums the speedup is more difficult to measure but it should not be slower to generate code this way regardless.
2015-06-11Conver reborrows to .iter() calls where appropriateJoshua Landau-1/+1
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-6/+6
2015-05-21syntax: parse `const fn` for free functions and inherent methods.Eduard Burtescu-0/+1
2015-05-17Allow #[derive()] to generate unsafe methodsManish Goregaokar-1/+10
2015-05-13Merge branch 'master' into mulit-decorNick Cameron-2/+2
2015-05-12RebasingNick Cameron-5/+5
2015-05-12Merge branch 'master' intoNick Cameron-29/+36
2015-05-11Auto merge of #25085 - carols10cents:remove-old-tilde, r=steveklabnikbors-2/+2
There were still some mentions of `~[T]` and `~T`, mostly in comments and debugging statements. I tried to do my best to preserve meaning, but I might have gotten some wrong-- I'm happy to fix anything :)
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-1/+1
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-05-03Update old uses of ~ in comments and debugging statementsCarol Nichols-2/+2
2015-05-02Rename AstBuilder::expr_int -> AstBuilder::expr_isizeManish Goregaokar-3/+6
2015-05-01Get tests passingNick Cameron-2/+3
2015-05-01Give access to field attributes in ext::derivingManish Goregaokar-29/+33
2015-04-30WIP refactor expansion of decorators and move derive to MultiDecoratorNick Cameron-32/+39
2015-04-21syntax: Replace [].tail with the stable [1..] syntaxErick Tryzelaar-1/+1
2015-04-21syntax: remove #![feature(box_syntax, box_patterns)]Erick Tryzelaar-1/+1
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-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-10fix some comments.Felix S. Klock II-6/+7
2015-04-10Incorporate repr-attr into deriving(PartialOrd) to avoid truncation errors.Felix S. Klock II-13/+38
remove out of date fixme.
2015-04-10Re-add a fixme after some investigation into what's going on.Felix S. Klock II-0/+11
2015-04-10Change `derive` expansions to use `discriminant_value` intrinsic.Felix S. Klock II-30/+27
Fix #15523.
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-1/+1
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-25rustc: Remove support for int/uintAlex Crichton-1/+1
This commit removes all parsing, resolve, and compiler support for the old and long-deprecated int/uint types.
2015-03-24syntax: Update #[derive(...)] to work with phantom and associated typesErick Tryzelaar-6/+118
Closes #7671, #19839
2015-03-11syntax: move MethMac to MacImplItem and combine {Provided,Required}Method ↵Eduard Burtescu-2/+2
into MethodTraitItem.
2015-03-11syntax: rename TypeMethod to MethodSig and use it in MethDecl.Eduard Burtescu-7/+7
2015-03-11syntax: gather common fields of impl & trait items into their respective types.Eduard Burtescu-26/+20
2015-03-11syntax: move indirection around {Trait,Impl}Item, from within.Eduard Burtescu-7/+7