summary refs log tree commit diff
path: root/src/libsyntax_ext/deriving
AgeCommit message (Collapse)AuthorLines
2019-06-23Remove built-in derive macros `Send` and `Sync`Vadim Petrochenkov-10/+0
2019-06-23Fix meta-variable binding errors in macrosJulien Cretin-1/+1
The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact.
2019-06-19Auto merge of #61172 - matthewjasper:cleanup-implied-bounds-lint, r=varkorbors-1/+0
Improve the explicit_outlives_requirements lint * Don't use Strings to compare parameters * Extend the lint to lifetime bounds * Extend the lint to enums and unions * Use the correct span for where clauses in tuple structs * Try to early-out where possible * Remove unnecessary bounds in rustc crates
2019-06-19Rollup merge of #61898 - petrochenkov:sekind, r=eddybMazdak Farrokhzad-19/+21
syntax: Factor out common fields from `SyntaxExtension` variants And some other related cleanups. Continuation of https://github.com/rust-lang/rust/pull/61606. This will also help to unblock https://github.com/rust-lang/rust/pull/61877.
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-18allow_internal_unstable: Avoid some more allocationsVadim Petrochenkov-16/+3
2019-06-18syntax: Factor out common fields from `SyntaxExtension` variantsVadim Petrochenkov-3/+18
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-1/+1
Allow attributes in formal function parameters Implements https://github.com/rust-lang/rust/issues/60406. This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made. **TODO** - [x] Forbid some built-in attributes. - [x] Expand cfg/cfg_attr
2019-06-12Rollup merge of #61654 - Electron-libre:use_slice_patterns_in_rustc, ↵Mazdak Farrokhzad-10/+10
r=oli-obk,Centril use pattern matching for slices destructuring refs #61542 Use slices pattern where it seems to make sense .
2019-06-10syntax: Rename variants of `SyntaxExtension` for consistencyVadim Petrochenkov-1/+1
2019-06-10syntax: Use `MultiItemModifier` for built-in derivesVadim Petrochenkov-4/+20
2019-06-09Allow attributes in formal function parametersCaio-1/+1
2019-06-08use pattern matching for slices destructuringCedric-10/+10
2019-06-06syntax: Switch function parameter order in `TokenTree::token`Vadim Petrochenkov-1/+1
2019-06-06syntax: Use `Token` in `TokenTree::Token`Vadim Petrochenkov-1/+1
2019-06-06Always use token kinds through `token` module rather than `Token` typeVadim Petrochenkov-2/+2
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-2/+1
2019-06-03syntax: revert `ast::AsyncArgument` and associated changes.Eduard-Mihai Burtescu-1/+0
Here follows the main reverts applied in order to make this commit: Revert "Rollup merge of #60676 - davidtwco:issue-60674, r=cramertj" This reverts commit 45b09453dbf120cc23d889435aac3ed7d2ec8eb7, reversing changes made to f6df1f6c30b469cb9e65c5453a0efa03cbb6005e. Revert "Rollup merge of #60437 - davidtwco:issue-60236, r=nikomatsakis" This reverts commit 16939a50ea440e72cb6ecefdaabb988addb1ec0e, reversing changes made to 12bf98155249783583a91863c5dccf9e346f1226. Revert "Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj" This reverts commit 62d1574876f5531bce1b267e62dff520d7adcbbb, reversing changes made to 4eff8526a789e0dfa8b97f7dec91b7b5c18e8544.
2019-05-27Pass symbols to `ExtCtxt::std_path` instead of strings.Nicholas Nethercote-24/+27
Because this function is hot. Also remove the dead `ty_option` function.
2019-05-27Avoid unnecessary internings.Nicholas Nethercote-21/+21
Most involving `Symbol::intern` on string literals.
2019-05-24Tweak macro parse errors when reaching EOF during macro call parseEsteban Küber-1/+1
- Add detail on origin of current parser when reaching EOF and stop saying "found <eof>" and point at the end of macro calls - Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error
2019-05-22Eliminate unnecessary `Ident::with_empty_ctxt`sVadim Petrochenkov-1/+1
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-8/+9
2019-05-13Return a `Symbol` from `name_or_empty` functions.Nicholas Nethercote-2/+2
2019-05-13Remove the equality operation between `Symbol` and strings.Nicholas Nethercote-2/+2
And also the equality between `Path` and strings, because `Path` is made up of `Symbol`s.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-4/+4
2019-04-21Introduce `LocalSource` into the AST.David Wood-0/+1
This will be used to keep track of the origin of a local in the AST. In particular, it will be used by `async fn` lowering for the locals in `let <pat>: <ty> = __arg0;` statements.
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-53/+51
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-9/+8
2019-02-18Remove `LazyTokenStream`.Nicholas Nethercote-1/+2
It's present within `Token::Interpolated` as an optimization, so that if a nonterminal is converted to a `TokenStream` multiple times, the first-computed value is saved and reused. But in practice it's not needed. `interpolated_to_tokenstream()` is a cold function: it's only called a few dozen times while compiling rustc itself, and a few hundred times across the entire `rustc-perf` suite. Furthermore, when it is called, it is almost always the first conversion, so no benefit is gained from it. So this commit removes `LazyTokenStream`, along with the now-unnecessary `Token::interpolated()`. As well as a significant simplification, the removal speeds things up slightly, mostly due to not having to `drop` the `LazyTokenStream` instances.
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-1/+1
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-11/+11
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-13Cleanup importsTaiki Endo-1/+1
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-1/+1
2019-02-11Use `Rc<[Symbol]>` instead of `Vec<Symbol>` to reduce # of allocsOliver Scherer-3/+4
2019-02-11Require a list of features to allow in `allow_internal_unstable`Oliver Scherer-2/+6
2019-02-10rustc: doc commentsAlexander Regueiro-11/+11
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-165/+174
libsyntax_ext => 2018 Transitions `libsyntax_ext` to Rust 2018; cc #58099 r? @Centril
2019-02-06Overhaul `syntax::fold::Folder`.Nicholas Nethercote-6/+6
This commit changes `syntax::fold::Folder` from a functional style (where most methods take a `T` and produce a new `T`) to a more imperative style (where most methods take and modify a `&mut T`), and renames it `syntax::mut_visit::MutVisitor`. The first benefit is speed. The functional style does not require any reallocations, due to the use of `P::map` and `MoveMap::move_{,flat_}map`. However, every field in the AST must be overwritten; even those fields that are unchanged are overwritten with the same value. This causes a lot of unnecessary memory writes. The imperative style reduces instruction counts by 1--3% across a wide range of workloads, particularly incremental workloads. The second benefit is conciseness; the imperative style is usually more concise. E.g. compare the old functional style: ``` fn fold_abc(&mut self, abc: ABC) { ABC { a: fold_a(abc.a), b: fold_b(abc.b), c: abc.c, } } ``` with the imperative style: ``` fn visit_abc(&mut self, ABC { a, b, c: _ }: &mut ABC) { visit_a(a); visit_b(b); } ``` (The reductions get larger in more complex examples.) Overall, the patch removes over 200 lines of code -- even though the new code has more comments -- and a lot of the remaining lines have fewer characters. Some notes: - The old style used methods called `fold_*`. The new style mostly uses methods called `visit_*`, but there are a few methods that map a `T` to something other than a `T`, which are called `flat_map_*` (`T` maps to multiple `T`s) or `filter_map_*` (`T` maps to 0 or 1 `T`s). - `move_map.rs`/`MoveMap`/`move_map`/`move_flat_map` are renamed `map_in_place.rs`/`MapInPlace`/`map_in_place`/`flat_map_in_place` to reflect their slightly changed signatures. - Although this commit renames the `fold` module as `mut_visit`, it keeps it in the `fold.rs` file, so as not to confuse git. The next commit will rename the file.
2019-02-04libsyntax_ext => 2018Taiki Endo-165/+174
2018-12-27Fix `trace_macros` and `log_syntax`Vadim Petrochenkov-1/+1
2018-12-27Get rid of `Block::recovered`Vadim Petrochenkov-1/+0
2018-12-27Do not abort compilation if expansion produces errorsVadim Petrochenkov-2/+2
Fix a number of uncovered deficiencies in diagnostics
2018-12-25Remove licensesMark Rousskov-150/+0
2018-12-19Remove `eliminate_crate_var` and special pretty-printing for `$crate`Vadim Petrochenkov-1/+0