summary refs log tree commit diff
path: root/src/libsyntax_ext/deriving/generic
AgeCommit message (Collapse)AuthorLines
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-2/+3
This is done by moving some data definitions to syntax::expand.
2019-10-18review comment: span bug labelEsteban Küber-1/+1
2019-10-17Refer to "associated functions" instead of "static methods"Esteban Küber-3/+1
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-2/+2
2019-10-15syntax::parse::sess -> syntax::sessMazdak Farrokhzad-1/+1
2019-10-11deriving: avoid dummy Span on an artificial `type_ident` pathDan Aloni-2/+2
The dummy Span pointed to the beginning of the source file instead to where the `#[derive]` is located. Later, it tripped the `in_derive_expansion(span)` check at `src/librustc/middle/stability.rs`, causing a span-less deprecation warning to be emitted. Fixes #56195, #55417.
2019-09-26Rename `Item.node` to `Item.kind`varkor-3/+3
2019-09-26Rename `Ty.node` to `Ty.kind`varkor-2/+2
2019-09-26Rename `ImplItem.node` to `ImplItem.kind`varkor-2/+2
2019-09-21Inline attribute constructorsMark Rousskov-2/+5
2019-09-21Remove constraints argument from path_allMark Rousskov-5/+5
It was never used
2019-09-15Give more `Idents` spansMatthew Jasper-9/+9
2019-09-15Avoid some unnecessary `&str` to `Ident` conversionsMatthew Jasper-15/+13
2019-09-09Resolve attributes in several placesCaio-0/+1
Arm, Field, FieldPat, GenericParam, Param, StructField and Variant
2019-09-05or-patterns: syntax: adjust derive, format, and building.Mazdak Farrokhzad-3/+3
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-2/+2
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-17Remove gensyms from built-in derivesMatthew Jasper-6/+9
Also make them generally more hygienic with name resolution.
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-15Remove `Spanned` from `{ast,hir}::FieldPat`Vadim Petrochenkov-9/+7
2019-08-14Rollup merge of #63543 - c410-f3r:variant, r=c410-f3rMazdak Farrokhzad-8/+8
Merge Variant and Variant_ Extracted from #63468.
2019-08-14Merge Variant and Variant_Caio-8/+8
2019-08-13Add NodeId for Arm, Field and FieldPatCaio-0/+1
2019-08-05Auto merge of #63248 - petrochenkov:nomarker, r=matthewjasperbors-2/+3
Move special treatment of `derive(Copy, PartialEq, Eq)` from expansion infrastructure to elsewhere As described in https://github.com/rust-lang/rust/pull/62086#issuecomment-515195477. Reminder: - `derive(PartialEq, Eq)` makes the type it applied to a "structural match" type, so constants of this type can be used in patterns (and const generics in the future). - `derive(Copy)` notifies other derives that the type it applied to implements `Copy`, so `derive(Clone)` can generate optimized code and other derives can generate code working with `packed` types and types with `rustc_layout_scalar_valid_range` attributes. First, the special behavior is now enabled after properly resolving the derives, rather than after textually comparing them with `"Copy"`, `"PartialEq"` and `"Eq"` in `fn add_derived_markers`. The markers are no longer kept as attributes in AST since derives cannot modify items and previously did it through hacks in the expansion infra. Instead, the markers are now kept in a "global context" available from all the necessary places, namely - resolver. For `derive(PartialEq, Eq)` the markers are created by the derive macros themselves and then consumed during HIR lowering to add the `#[structural_match]` attribute in HIR. This is still a hack, but now it's a hack local to two specific macros rather than affecting the whole expansion infra. Ideally we should find the way to put `#[structural_match]` on the impls rather than on the original item, and then consume it in `rustc_mir`, then no hacks in expansion and lowering will be required. (I'll make an issue about this for someone else to solve, after this PR lands.) The marker for `derive(Copy)` cannot be emitted by the `Copy` macro itself because we need to know it *before* the `Copy` macro is expanded for expanding other macros. So we have to do it in resolve and block expansion of any derives in a `derive(...)` container until we know for sure whether this container has `Copy` in it or not. Nasty stuff. r? @eddyb or @matthewjasper
2019-08-04Rename `ItemImplKind::Type` to `ItemImplKind::TyAlias`varkor-1/+2
2019-08-03Move special treatment of `derive(Copy, PartialEq, Eq)` from expansion ↵Vadim Petrochenkov-2/+3
infrastructure to elsewhere
2019-07-31Replace AstBuilder with inherent methodsMark Rousskov-2/+0
2019-07-31Remove Span argument from ExtCtxt::attributeMark Rousskov-3/+2
MetaItem.span was always equivalent
2019-07-27Move proc macro server into libsyntaxVadim Petrochenkov-51/+1
2019-07-19Adjust other names after the `Mark` renamingVadim Petrochenkov-1/+1
2019-07-03Remove needless lifetimesJeremy Stucki-5/+5
2019-06-18Remove the HirId/NodeId from where clausesMatthew Jasper-1/+0
Also give them a span in the HIR
2019-06-18Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-5/+6
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-1/+1
2019-06-09Allow attributes in formal function parametersCaio-1/+1
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-2/+1
2019-05-27Avoid unnecessary internings.Nicholas Nethercote-3/+2
Most involving `Symbol::intern` on string literals.
2019-05-22Eliminate unnecessary `Ident::with_empty_ctxt`sVadim Petrochenkov-1/+1
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-6/+6
2019-05-13Return a `Symbol` from `name_or_empty` functions.Nicholas Nethercote-2/+2
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-2/+2
2019-03-25Auto merge of #59256 - petrochenkov:derval2, r=Zoxcbors-3/+4
Make meta-item API compatible with `LocalInternedString::get` soundness fix r? @Zoxc
2019-03-24Remove methods is_struct/is_tuple/is_unit from VariantDataVadim Petrochenkov-3/+5
2019-03-17Make meta-item API compatible with `LocalInternedString::get` soundness fixVadim Petrochenkov-3/+4
2019-03-16syntax: Do not accidentally treat multi-segment meta-items as single-segmentVadim Petrochenkov-6/+3
2019-02-10rustc: doc commentsAlexander Regueiro-8/+8
2019-02-07Support const generics in derivevarkor-1/+15
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07Rollup merge of #58133 - taiki-e:libsyntax_ext-2018, r=Centrilkennytm-69/+68
libsyntax_ext => 2018 Transitions `libsyntax_ext` to Rust 2018; cc #58099 r? @Centril