about summary refs log tree commit diff
path: root/src/libsyntax_ext/deriving/decodable.rs
AgeCommit message (Collapse)AuthorLines
2019-12-30Rename directories for some crates from `syntax_x` to `rustc_x`Vadim Petrochenkov-225/+0
`syntax_expand` -> `rustc_expand` `syntax_pos` -> `rustc_span` `syntax_ext` -> `rustc_builtin_macros`
2019-12-22Format the worldMark Rousskov-84/+119
2019-12-201. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.Mazdak Farrokhzad-1/+1
2. mir::Mutability -> ast::Mutability.
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-1/+1
2019-09-15Give more `Idents` spansMatthew Jasper-8/+12
2019-09-05or-patterns: syntax: adjust derive, format, and building.Mazdak Farrokhzad-3/+1
2019-08-17Remove gensyms from built-in derivesMatthew Jasper-3/+3
Also make them generally more hygienic with name resolution.
2019-08-03Rollup merge of #63146 - Mark-Simulacrum:clean-attr, r=petrochenkovMazdak Farrokhzad-1/+0
Cleanup syntax::attr Mostly removing needless arguments to constructors r? @petrochenkov
2019-07-31Remove derives `Encodable`/`Decodable` and unstabilize attribute `#[bench]`Vadim Petrochenkov-17/+1
2019-07-31Replace AstBuilder with inherent methodsMark Rousskov-1/+0
2019-07-07syntax: Migrate built-in macros to the regular stability checkingVadim Petrochenkov-2/+0
2019-02-10rustc: doc commentsAlexander Regueiro-1/+1
2019-02-04libsyntax_ext => 2018Taiki Endo-11/+11
2018-12-25Remove licensesMark Rousskov-10/+0
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-2/+2
2018-07-12Deny bare trait objects in src/libsyntax_extljedrz-3/+3
2018-04-15Provide better names for builtin deriving-generated attributesJames Sanderson-2/+2
2017-12-09Use hygiene to access the injected crate (`core` or `std`) from builtin macros.Jeffrey Seyfried-14/+6
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-1/+1
Like #43008 (f668999), but _much more aggressive_.
2017-02-05Move derive macro expansion into the MacroExpanderJosh Driver-1/+2
This removes the expand_derives function, and sprinkles the functionality throughout the Invocation Collector, Expander and Resolver.
2017-02-05Make builtin derives a SyntaxExtensionJosh Driver-0/+1
This allows builtin derives to be registered and resolved, just like other derive types.
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-8/+7
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-6/+3
2016-11-10syntax: don't fake a block around closures' bodies during parsing.Eduard Burtescu-3/+3
2016-10-31Changed most vec! invocations to use square bracesiirelu-2/+2
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-08-30Future proof `libsyntax_ext` for `union`.Jeffrey Seyfried-0/+1
2016-08-18Fix #[derive] for empty tuple structs/variantsVadim Petrochenkov-3/+3
2016-07-19Run rustfmt on libsyntax_ext/deriving folderSrinivas Reddy Thatiparthy-88/+87
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-1/+1
2016-05-12Improve derived implementations for enums with lots of fieldless variantsBjörn Steinbrink-0/+1
A number of trait methods like PartialEq::eq or Hash::hash don't actually need a distinct arm for each variant, because the code within the arm only depends on the number and types of the fields in the variants. We can easily exploit this fact to create less and better code for enums with multiple variants that have no fields at all, the extreme case being C-like enums. For nickel.rs and its by now infamous 800 variant enum, this reduces optimized compile times by 25% and non-optimized compile times by 40%. Also peak memory usage is down by almost 40% (310MB down to 190MB). To be fair, most other crates don't benefit nearly as much, because they don't have as huge enums. The crates in the Rust distribution that I measured saw basically no change in compile times (I only tried optimized builds) and only 1-2% reduction in peak memory usage.
2016-04-26shallow Clone for #[derive(Copy,Clone)]Alex Burka-1/+1
Changes #[derive(Copy, Clone)] to use a faster impl of Clone when both derives are present, and there are no generics in the type. The faster impl is simply returning *self (which works because the type is also Copy). See the comments in libsyntax_ext/deriving/clone.rs for more details. There are a few types which are Copy but not Clone, in violation of the definition of Copy. These include large arrays and tuples. The very existence of these types is arguably a bug, but in order for this optimization not to change the applicability of #[derive(Copy, Clone)], the faster Clone impl also injects calls to a new function, core::clone::assert_receiver_is_clone, to verify that all members are actually Clone. This is not a breaking change, because pursuant to RFC 1521, any type that implements Copy should not do any observable work in its Clone impl.
2016-03-14derive: improve hygiene for type parameters (see #2810)Alex Burka-5/+7
When deriving Hash, RustcEncodable and RustcDecodable, the syntax extension needs a type parameter to use in the inner method. They used to use __H, __S and __D respectively. If this conflicts with a type parameter already declared for the item, bad times result (see the test). There is no hygiene for type parameters, but this commit introduces a better heuristic by concatenating the names of all extant type parameters (and prepending __H).
2016-02-11[breaking-change] don't glob export ast::Mutablity variantsOliver 'ker' Schneider-2/+2
2015-12-15Move built-in syntax extensions to a separate crateSeo Sanghyeon-0/+224