about summary refs log tree commit diff
path: root/src/libsyntax_ext/deriving
AgeCommit message (Collapse)AuthorLines
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
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-11/+11
2018-12-04syntax: Rename some keywordsVadim Petrochenkov-2/+2
`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-11-30proc_macro: move the rustc server to syntax_ext.Eduard-Mihai Burtescu-1/+1
2018-11-30proc_macro: remove the __internal module.Eduard-Mihai Burtescu-7/+5
2018-11-30proc_macro: introduce a "bridge" between clients (proc macros) and servers ↵Eduard-Mihai Burtescu-28/+37
(compiler front-ends).
2018-11-18Rollup merge of #55827 - ljedrz:various_stashed, r=alexcrichtonPietro Albini-10/+8
A few tweaks to iterations/collecting - simplify and speed up `dot::GraphWalk::nodes` for `cfg::CFG` - `reserve` the capacity for `edges` in `DepGraph::query` - collect directly to a `HirVec` in `LoweringContext::lower_attrs` - fix overallocation in `OnDiskCache::serialize` - preallocate the `new_partitioning` vector in `merge_codegen_units` - simplify `impl FromHex for str` - improve the creation of `self_arg_names` in `impl MethodDef`
2018-11-13fix various typos in doc commentsAndy Russell-1/+1
2018-11-13A few tweaks to iterations/collectingljedrz-10/+8
2018-10-31syntax: improve a few allocationsljedrz-1/+1
2018-10-26Auto merge of #54929 - csmoe:cfg_lint, r=petrochenkovbors-5/+5
Suggest to remove prefix `b` in cfg attribute lint string Closes #54926 r? @estebank
2018-10-26Remove redundant cloneShotaro Yamada-2/+2
2018-10-20handle errors based on parse_sesscsmoe-5/+5
2018-08-19mv (mod) codemap source_mapDonato Sciarra-4/+4
2018-08-16syntax_ext: remove leftover span_err_if_not_stage0 macro.Eduard-Mihai Burtescu-13/+2
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-2/+5
2018-08-09[nll] libsyntax_ext: remove unnecessary mut annotation on variablememoryruins-1/+1
Pointed out by nll. It is correct that the mut annotation is not needed.
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-14/+12
2018-07-23libsyntax_ext: Prefer `Option::map` over `match` where applicableColin Wallace-8/+4
2018-07-14Remove most of `PartialEq` impls from AST and HIR structuresVadim Petrochenkov-11/+6
2018-07-12Deny bare trait objects in src/libsyntax_extljedrz-21/+21
2018-06-23hygiene: Merge `NameAndSpan` into `ExpnInfo`Vadim Petrochenkov-2/+2
2018-06-21Parse async fn header.Without Boats-5/+5
This is gated on edition 2018 & the `async_await` feature gate. The parser will accept `async fn` and `async unsafe fn` as fn items. Along the same lines as `const fn`, only `async unsafe fn` is permitted, not `unsafe async fn`.The parser will not accept `async` functions as trait methods. To do a little code clean up, four fields of the function type struct have been merged into the new `FnHeader` struct: constness, asyncness, unsafety, and ABI. Also, a small bug in HIR printing is fixed: it previously printed `const unsafe fn` as `unsafe const fn`, which is grammatically incorrect.
2018-06-20Fix additional commentsvarkor-1/+1
2018-06-20Rename ty_param_bound to trait_boundvarkor-5/+5
2018-06-20Rename ParamBound(s) to GenericBound(s)varkor-2/+2
2018-06-20Remove name from GenericParamKind::Lifetimevarkor-4/+4
2018-06-20Lift bounds into GenericParamvarkor-12/+10
2018-06-20Simply joint lifetime/type iterationvarkor-57/+21
2018-06-20Rename structures in astvarkor-24/+24