summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
AgeCommit message (Collapse)AuthorLines
2019-01-15Add PartialEqYuki Okushi-2/+2
2018-12-27Get rid of `Block::recovered`Vadim Petrochenkov-1/+0
2018-12-27AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-endVadim Petrochenkov-0/+4
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-10Remove `tokenstream::Delimited`.Nicholas Nethercote-1/+1
Because it's an extra type layer that doesn't really help; in a couple of places it actively gets in the way, and overall removing it makes the code nicer. It does, however, move `tokenstream::TokenTree` further away from the `TokenTree` in `quote.rs`. More importantly, this change reduces the size of `TokenStream` from 48 bytes to 40 bytes on x86-64, which is enough to slightly reduce instruction counts on numerous benchmarks, the best by 1.5%. Note that `open_tt` and `close_tt` have gone from being methods on `Delimited` to associated methods of `TokenTree`.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-188/+187
2018-12-04Address review commentsVadim Petrochenkov-12/+1
2018-12-04syntax: Rename some keywordsVadim Petrochenkov-5/+5
`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-15Rollup merge of #55750 - oli-obk:node_id_x, r=michaelwoeristerPietro Albini-37/+18
Make `NodeId` and `HirLocalId` `newtype_index`
2018-11-13Move two `static_assert!`s to better spots.Nicholas Nethercote-0/+1
And make them x86_64-only so they can use `==` instead of `<=`.
2018-11-13Add a static assertion about the size of `ast::Expr`.Nicholas Nethercote-0/+5
2018-11-12Reintroduce the original debug formatting for NodeIdsOliver Scherer-0/+1
2018-11-12Make `NodeId` a `newtype_index` to enable niche optimizationsOliver Scherer-37/+17
2018-11-08Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.Nicholas Nethercote-1/+1
Because it results in fewer allocations and small speedups on some benchmarks.
2018-11-03Added support for trait aliases as object types.Alexander Regueiro-3/+3
2018-10-26Auto merge of #54929 - csmoe:cfg_lint, r=petrochenkovbors-0/+8
Suggest to remove prefix `b` in cfg attribute lint string Closes #54926 r? @estebank
2018-10-26more reviewer changesNick Cameron-5/+1
2018-10-26Store a resolved def on hir::PathSegmentNick Cameron-1/+1
2018-10-26Give each PathSegment a NodeIdNick Cameron-2/+8
2018-10-20suggest to remove prefix `b` in lint stringcsmoe-0/+8
2018-09-27Auto merge of #52319 - tinco:issue_12590, r=pnkfelixbors-0/+2
Track whether module declarations are inline (fixes #12590) To track whether module declarations are inline I added a field `inline: bool` to `ast::Mod`. The main use case is for pretty to know whether it should render the items associated with the module, but perhaps there are use cases for this information to not be forgotten in the AST.
2018-09-22fix typo in commentAlex Stokes-123/+193
2018-09-10Track whether module declarations are inline (fixes #12590)Tinco Andringa-0/+2
2018-09-04Introduce Custom Test FrameworksJohn Renner-1/+1
2018-09-01Auto merge of #53815 - F001:if-let-guard, r=petrochenkovbors-1/+6
refactor match guard This is the first step to implement RFC 2294: if-let-guard. Tracking issue: https://github.com/rust-lang/rust/issues/51114 The second step should be introducing another variant `IfLet` in the Guard enum. I separated them into 2 PRs for the convenience of reviewers. r? @petrochenkov
2018-08-30introduce Guard enumF001-1/+6
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-2/+2
2018-08-23Auto merge of #52602 - scottmcm:tryblock-expr, r=nikomatsakisbors-3/+3
Implement try block expressions I noticed that `try` wasn't a keyword yet in Rust 2018, so... ~~Fix​es https://github.com/rust-lang/rust/issues/52604~~ That was fixed by PR https://github.com/rust-lang/rust/pull/53135 cc https://github.com/rust-lang/rust/issues/31436 https://github.com/rust-lang/rust/issues/50412
2018-08-19Rename `Catch` variants to `TryBlock`Scott McMurray-3/+3
(Not `Try` since `QuestionMark` is using that.)
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-14Auto merge of #53085 - ljedrz:cleanup_syntax_structures, r=ljedrzbors-1/+1
Move SmallVector and ThinVec out of libsyntax - move `libsyntax::util::SmallVector` tests to `librustc_data_structures::small_vec` - remove `libsyntax::util::SmallVector` - move `libsyntax::util::thin_vec` to `librustc_data_structures::thin_vec` Other than moving these data structures where they belong it allows modules using `SmallVector<T>` (`SmallVec<[T; 1]>`) to specify their own length (e.g. 8 or 32) independently from `libsyntax`.
2018-08-14rustc_resolve: fix special-case for one-segment import paths.Eduard-Mihai Burtescu-1/+1
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-1/+1
2018-08-03Don't collect() when size_hint is uselessljedrz-1/+5
2018-08-01Switch syntax attribute tracking to BitVectorMark Rousskov-1/+11
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-8/+2
2018-07-18Implement existential typesOliver Schneider-0/+6
2018-07-15Update clippy and rlsOliver Schneider-3/+3
2018-07-14Address commentsVadim Petrochenkov-2/+3
2018-07-14Remove most of `Hash` impls from AST and HIR structuresVadim Petrochenkov-99/+99
2018-07-14Remove most of `PartialEq` impls from AST and HIR structuresVadim Petrochenkov-100/+115
2018-07-01Auto merge of #51883 - estebank:placement-suggestion, r=varkorbors-0/+10
Suggest correct comparison against negative literal When parsing as emplacement syntax (`x<-1`), suggest the correct syntax for comparison against a negative value (`x< -1`). Fix #45651.
2018-06-28Suggest correct comparison against negative literalEsteban Küber-0/+10
When parsing as emplacement syntax (`x<-1`), suggest the correct syntax for comparison against a negative value (`x< -1`).
2018-06-27Add a convenience method for getting the impl Trait `NodeId` of an `IsAysnc`Oliver Schneider-0/+7
2018-06-27Generate `DefId`s for the impl trait of `async` functionsOliver Schneider-2/+5
2018-06-27Generate the `NodeId` for `existential type` in the ASTOliver Schneider-1/+5
2018-06-26inclusive range syntax lint (`...` → `..=`)Zack M. Davis-1/+1
Our implementation ends up changing the `PatKind::Range` variant in the AST to take a `Spanned<RangeEnd>` instead of just a `RangeEnd`, because the alternative would be to try to infer the span of the range operator from the spans of the start and end subexpressions, which is both hideous and nontrivial to get right (whereas getting the change to the AST right was a simple game of type tennis). This is concerning #51043.
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-2/+2
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-21async await desugaring and testsTaylor Cramer-2/+22
2018-06-21Parse async fn header.Without Boats-5/+32
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.