summary refs log tree commit diff
path: root/src/librustc_save_analysis
AgeCommit message (Collapse)AuthorLines
2016-08-13Remove obsolete divergence related stuffAndrew Cann-1/+0
Replace FnOutput with Ty Replace FnConverging(ty) with ty Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-07-25Fixed missing comma in the csv dumper.Andrea Pretto-1/+1
2016-07-12Fix fallout.Jeffrey Seyfried-1/+1
2016-07-06Rollup merge of #34327 - nrc:save-fix-tuple, r=jseyfriedSteve Klabnik-1/+9
save-analysis: fix a bug with tuple sub-expressions
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-6/+4
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-06-26Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddybJeffrey Seyfried-2/+1
Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
2016-06-26Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrcJeffrey Seyfried-2/+2
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-25Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichtonJeffrey Seyfried-5/+10
This PR refactors the 'errors' part of libsyntax into its own crate (librustc_errors). This is the first part of a few refactorings to simplify error reporting and potentially support more output formats (like a standardized JSON output and possibly an --explain mode that can work with the user's code), though this PR stands on its own and doesn't assume further changes. As part of separating out the errors crate, I have also refactored the code position portion of codemap into its own crate (libsyntax_pos). While it's helpful to have the common code positions in a separate crate for the new errors crate, this may also enable further simplifications in the future.
2016-06-25Rollup merge of #34368 - petrochenkov:astqpath, r=ManishearthJeffrey Seyfried-2/+1
The AST part of https://github.com/rust-lang/rust/pull/34365 plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645
2016-06-25Rollup merge of #34213 - josephDunne:trait_item_macros, r=jseyfriedJeffrey Seyfried-1/+2
**syntax-[breaking-change]** cc #31645 New `TraitItemKind::Macro` variant This change adds support for macro expansion inside trait items by adding the new `TraitItemKind::Macro` and associated parsing code.
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-5/+10
2016-06-20Merge PatKind::QPath into PatKind::Path in ASTVadim Petrochenkov-2/+1
2016-06-17save-analysis: fix a bug with tuple sub-expressionsNick Cameron-1/+9
2016-06-17Fix falloutJeffrey Seyfried-2/+1
2016-06-17Rollup merge of #34298 - nrc:save-parent, r=eddybManish Goregaokar-35/+127
save-analysis: some tweaks
2016-06-16Add an abs_path member to FileMap, use it when writing debug info.Ted Mielczarek-1/+1
When items are inlined from extern crates, the filename in the debug info is taken from the FileMap that's serialized in the rlib metadata. Currently this is just FileMap.name, which is whatever path is passed to rustc. Since libcore and libstd are built by invoking rustc with relative paths, they wind up with relative paths in the rlib, and when linked into a binary the debug info uses relative paths for the names, but since the compilation directory for the final binary, tools trying to read source filenames will wind up with bad paths. We noticed this in Firefox with source filenames from libcore/libstd having bad paths. This change stores an absolute path in FileMap.abs_path, and uses that if available for writing debug info. This is not going to magically make debuggers able to find the source, but it will at least provide sensible paths.
2016-06-16save-analysis: add a decl_id for methodsNick Cameron-17/+50
This is non-null if the method is in a (non-inherent) impl and in that case will be the id for the method declaration in the implemented trait.
2016-06-14Remove the type parameter from `syntax::visit::Visitor`Jeffrey Seyfried-2/+2
2016-06-13Add support for macro expansion inside trait itemsJoseph Dunne-1/+2
2016-06-11save-analysis: some refinements to JSON dataNick Cameron-18/+77
Split variable and function kinds to give more information. Give children for methods, structs, enums, and traits.
2016-06-10Introduce TyCtxt::expect_def/expect_resolution helpers and use them where ↵Vadim Petrochenkov-38/+12
possible
2016-05-29Auto merge of #33859 - nrc:save-field-sub, r=pnkfelixbors-3/+9
save-analysis: be a bit more defensive with field sub-expressions Prevents an ice with `(...).f` since the sub-expression is in the AST but not the HIR. We could actually do better in this specific case, but it doesn't seem worth it.
2016-05-27Auto merge of #33800 - nrc:save-fn-name, r=eddybbors-3/+2
save-analysis: use a function's short name
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-1/+1
2016-05-25save-analysis: be a bit more defensive with field sub-expressionsNick Cameron-3/+9
Prevents an ice with `(...).f` since the sub-expression is in the AST but not the HIR. We could actually do better in this specific case, but it doesn't seem worth it.
2016-05-23save-analysis: use a function's short nameNick Cameron-3/+2
2016-05-13save-analysis: make DefIds prettierNick Cameron-25/+42
2016-05-11save-analysis: give better text info in value fieldsNick Cameron-31/+108
2016-05-11save-analysis: attempt number 2 at a JSON versionNick Cameron-61/+423
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-6/+6
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-31/+31
2016-05-09Rollup merge of #33370 - aochagavia:dump, r=nrcManish Goregaokar-810/+746
save-analysis: use a decoupled representation for dumped data Closes #33348 This will probably break any tool relying on the csv backend of save_analysis, for the following reasons: 1. Dumped spans don't contain extents anymore (`Dump` uses `SpanData` now instead of internal `Span`s). In case we still want to dump extents we could add them to `SpanData`. 1. `DefId`s are no longer dumped as a pair of `(ref_id, ref_crate)`. Instead, they are dumped as a single `Id`. @nrc You said something about storing the id in a `u64`, but you didn't explain why. I kept using `u32` in this branch but I can change it if you prefer that. r? @nrc By the way, the fact that this breaks tools relying on CSV may be a good occasion to start dumping CSV in a different way (i.e. using the serializer like in the JSON backend).
2016-05-06Use crate/index pair for def idsNick Cameron-179/+201
2016-05-03save-analysis: use a decoupled representation for dumped dataAdolfo Ochagavía-838/+752
Closes #33348
2016-05-03Remove unused trait imports flagged by lintSeo Sanghyeon-2/+0
2016-05-01Avoid using the lowering context in `librustc_save_analysis`Jeffrey Seyfried-17/+9
2016-04-28Fix #33213, a bug in which glob imports are not included in save-analysis dataJeffrey Seyfried-2/+2
2016-04-28Review changes and satisfy make tidyNick Cameron-51/+51
2016-04-26save-analysis-json: lower def idsNick Cameron-62/+63
2016-04-26save-analysis-json: thread through -z optionNick Cameron-12/+57
In fact, we make JSOn the default and add an option for save-analysis-csv for the legacy behaviour. We also rename some bits and pieces `dxr` -> `save-analysis`
2016-04-25save-analysis-json: introduce a lowering stepNick Cameron-9/+607
...in which we make the spans nice.
2016-04-25save-analysis: implement JSON dumpsNick Cameron-68/+143
2016-04-25save-analysis: remove dump spans stuffNick Cameron-217/+94
2016-04-25Rollup merge of #33041 - petrochenkov:path, r=nrc,ManishearthManish Goregaokar-2/+2
Paths are mostly parsed without taking whitespaces into account, e.g. `std :: vec :: Vec :: new ()` parses successfully, however, there are some special cases involving keywords `super`, `self` and `Self`. For example, `self::` is considered a path start only if there are no spaces between `self` and `::`. These restrictions probably made sense when `self` and friends weren't keywords, but now they are unnecessary. The first two commits remove this special treatment of whitespaces by removing `token::IdentStyle` entirely and therefore fix https://github.com/rust-lang/rust/issues/14109. This change also affects naked `self` and `super` (which are not tightly followed by `::`, obviously) they can now be parsed as paths, however they are still not resolved correctly in imports (cc @jseyfried, see `compile-fail/use-keyword.rs`), so https://github.com/rust-lang/rust/issues/29036 is not completely fixed. The third commit also makes `super`, `self`, `Self` and `static` keywords nominally (before this they acted as keywords for all purposes) and removes most of remaining \"special idents\". The last commit (before tests) contains some small improvements - some qualified paths with type parameters are parsed correctly, `parse_path` is not used for parsing single identifiers, imports are sanity checked for absence of type parameters - such type parameters can be generated by syntax extensions or by macros when https://github.com/rust-lang/rust/issues/10415 is fixed (~~soon!~~already!). This patch changes some pretty basic things in `libsyntax`, like `token::Token` and the keyword list, so it's a plugin-[breaking-change]. r? @eddyb
2016-04-24syntax: Make static/super/self/Self keywords + special ident cleanupVadim Petrochenkov-2/+2
2016-04-24thread tighter span for closures aroundNiko Matsakis-1/+1
Track the span corresponding to the `|...|` part of the closure.
2016-04-20debugging, misc fixesNick Cameron-20/+20
2016-04-06Rollup merge of #32570 - eddyb:tis-but-a-front, r=nikomatsakisManish Goregaokar-24/+21
r? @nikomatsakis Conflicts: src/librustc_save_analysis/lib.rs src/libsyntax/ast_util.rs
2016-04-06rustc: retire hir::map's paths.Eduard Burtescu-10/+10
2016-04-06Move span into `StructField`Vadim Petrochenkov-5/+5