about summary refs log tree commit diff
path: root/src/libsyntax_ext/deriving/clone.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-78/+92
2019-11-05Review feedback: Remove more stuff! Simplify simplify simplify!Felix S. Klock II-2/+1
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-1/+2
This is done by moving some data definitions to syntax::expand.
2019-10-17Refer to "associated functions" instead of "static methods"Esteban Küber-13/+9
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-1/+1
2019-09-26Rename `Item.node` to `Item.kind`varkor-1/+1
2019-09-21Remove constraints argument from path_allMark Rousskov-1/+1
It was never used
2019-08-23Audit uses of `apply_mark` in built-in macrosVadim Petrochenkov-1/+1
Replace them with equivalents of `Span::{def_site,call_site}` from proc macro API. The new API is much less error prone and doesn't rely on macros having default transparency.
2019-08-15hygiene: `ExpnInfo` -> `ExpnData`Vadim Petrochenkov-1/+1
For naming consistency with everything else in this area
2019-08-15hygiene: Merge `ExpnInfo` and `InternalExpnData`Vadim Petrochenkov-1/+1
2019-08-15`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`Vadim Petrochenkov-1/+1
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
2019-08-14Merge Variant and Variant_Caio-3/+3
2019-08-03Move special treatment of `derive(Copy, PartialEq, Eq)` from expansion ↵Vadim Petrochenkov-3/+3
infrastructure to elsewhere
2019-07-31Replace AstBuilder with inherent methodsMark Rousskov-1/+0
2019-07-31Remove Span argument from ExtCtxt::attributeMark Rousskov-1/+1
MetaItem.span was always equivalent
2019-07-15normalize use of backticks in compiler messages for libsyntax_extSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-05-27Pass symbols to `ExtCtxt::std_path` instead of strings.Nicholas Nethercote-3/+3
Because this function is hot. Also remove the dead `ty_option` function.
2019-05-27Avoid unnecessary internings.Nicholas Nethercote-2/+2
Most involving `Symbol::intern` on string literals.
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-2/+3
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-2/+2
2019-02-04libsyntax_ext => 2018Taiki Endo-13/+12
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-04syntax: Rename some keywordsVadim Petrochenkov-1/+1
`CrateRoot` -> `PathRoot`, `::` doesn't necessarily mean crate root now `SelfValue` -> `SelfLower`, `SelfType` -> `SelfUpper`, both `self` and `Self` can be used in type and value namespaces now
2018-07-12Deny bare trait objects in src/libsyntax_extljedrz-1/+1
2018-06-20Rename structures in astvarkor-3/+3
2018-06-20Remove methods from ast::GenericParam and ast::Genericsvarkor-1/+4
2018-06-20Rename ast::GenericParam and ast::GenericArgvarkor-2/+2
It's so confusing to have everything having the same name, at least while refactoring.
2018-06-20Rename "parameter" to "arg"varkor-2/+2
2018-06-20Rename *Parameter to *Paramvarkor-2/+2
2018-06-20Consolidate PathParameters and AngleBracketedParameterDatavarkor-1/+2
2018-04-06Rename `ast::Variant_::name` into `ident` + Fix rebaseVadim Petrochenkov-1/+1
2017-12-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-9/+17
The Generics now contain one Vec of an enum for the generic parameters, rather than two separate Vec's for lifetime and type parameters. Additionally, places that previously used Vec<LifetimeDef> now use Vec<GenericParam> instead.
2017-12-09Use hygiene to access the injected crate (`core` or `std`) from builtin macros.Jeffrey Seyfried-2/+3
2017-08-30Make fields of `Span` privateVadim Petrochenkov-1/+1
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-1/+1
Like #43008 (f668999), but _much more aggressive_.
2017-06-16deriv(Hash) for single-variant enum should not hash discriminantStepan Koltsov-1/+1
Fixes #39137
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-1/+1
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-2/+2
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-2/+2
2016-09-10Improve `Eq` derivingVadim Petrochenkov-14/+1
2016-09-10Improve shallow `Clone` derivingVadim Petrochenkov-70/+109
2016-09-02rustc: Implement custom derive (macros 1.1)Alex Crichton-7/+10
This commit is an implementation of [RFC 1681] which adds support to the compiler for first-class user-define custom `#[derive]` modes with a far more stable API than plugins have today. [RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md The main features added by this commit are: * A new `rustc-macro` crate-type. This crate type represents one which will provide custom `derive` implementations and perhaps eventually flower into the implementation of macros 2.0 as well. * A new `rustc_macro` crate in the standard distribution. This crate will provide the runtime interface between macro crates and the compiler. The API here is particularly conservative right now but has quite a bit of room to expand into any manner of APIs required by macro authors. * The ability to load new derive modes through the `#[macro_use]` annotations on other crates. All support added here is gated behind the `rustc_macro` feature gate, both for the library support (the `rustc_macro` crate) as well as the language features. There are a few minor differences from the implementation outlined in the RFC, such as the `rustc_macro` crate being available as a dylib and all symbols are `dlsym`'d directly instead of having a shim compiled. These should only affect the implementation, however, not the public interface. This commit also ended up touching a lot of code related to `#[derive]`, making a few notable changes: * Recognized derive attributes are no longer desugared to `derive_Foo`. Wasn't sure how to keep this behavior and *not* expose it to custom derive. * Derive attributes no longer have access to unstable features by default, they have to opt in on a granular level. * The `derive(Copy,Clone)` optimization is now done through another "obscure attribute" which is just intended to ferry along in the compiler that such an optimization is possible. The `derive(PartialEq,Eq)` optimization was also updated to do something similar. --- One part of this PR which needs to be improved before stabilizing are the errors and exact interfaces here. The error messages are relatively poor quality and there are surprising spects of this such as `#[derive(PartialEq, Eq, MyTrait)]` not working by default. The custom attributes added by the compiler end up becoming unstable again when going through a custom impl. Hopefully though this is enough to start allowing experimentation on crates.io! syntax-[breaking-change]
2016-08-30Future proof `libsyntax_ext` for `union`.Jeffrey Seyfried-0/+1
2016-07-19Run rustfmt on libsyntax_ext/deriving folderSrinivas Reddy Thatiparthy-48/+50
2016-06-26Rollup merge of #34436 - jseyfried:no_block_expr, r=eddybJeffrey Seyfried-6/+4
To allow these braced macro invocation, this PR removes the optional expression from `ast::Block` and instead uses a `StmtKind::Expr` at the end of the statement list. Currently, braced macro invocations in blocks can expand into statements (and items) except when they are last in a block, in which case they can only expand into expressions. For example, ```rust macro_rules! make_stmt { () => { let x = 0; } } fn f() { make_stmt! {} //< This is OK... let x = 0; //< ... unless this line is commented out. } ``` Fixes #34418.
2016-06-23Remove field `expr` of `ast::Block`Jeffrey Seyfried-6/+4
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/+4
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-05-03Remove unused trait imports introduced while in reviewSeo Sanghyeon-1/+1