about summary refs log tree commit diff
path: root/src/test/run-pass-fulldeps/pprust-expr-roundtrip.rs
AgeCommit message (Collapse)AuthorLines
2019-07-27tests: Move run-pass tests without naming conflicts to uiVadim Petrochenkov-230/+0
2019-07-27tests: Add missing run-pass annotationsVadim Petrochenkov-0/+1
2019-06-23let_chains: Add test cases to pprust-expr-roundtrip.Mazdak Farrokhzad-23/+32
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-17/+15
2019-05-29Update the rest of the test suites to use dynmemoryruins-1/+1
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-1/+1
2019-02-27Rename variadic to c_variadicDan Robertson-1/+1
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.
2019-02-10tests: doc commentsAlexander Regueiro-2/+2
2019-02-06Overhaul `syntax::fold::Folder`.Nicholas Nethercote-24/+28
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.
2018-12-27Get rid of `Block::recovered`Vadim Petrochenkov-1/+0
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-04updates all Filename variants to take a fingerprintMatthew Russo-2/+4
2018-08-19mv (mod) codemap source_mapDonato Sciarra-2/+2
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-1/+2
2018-06-21Fix test using ExprKind::ClosureTaylor Cramer-0/+1
2018-04-06Remove more duplicated spansVadim Petrochenkov-3/+3
2018-04-06Rename `ast::Variant_::name` into `ident` + Fix rebaseVadim Petrochenkov-4/+2
2018-04-06Rename `PathSegment::identifier` to `ident`Vadim Petrochenkov-24/+5
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-23/+16
Closes #22181, #27779
2018-03-14Remove syntax and syntax_pos thread localsJohn Kåre Alsaker-1/+4
2018-01-23Adds support for immovable generators. Move checking of invalid borrows ↵John Kåre Alsaker-1/+5
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2017-12-21Do not emit type errors on recovered blocksEsteban Küber-0/+1
When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user.
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-2/+2
2017-09-06better explanatory comment for the pprust-expr-roundtrip testStuart Pernsteiner-0/+18
2017-09-06pprust: fix parenthesization of exprsStuart Pernsteiner-0/+227