summary refs log tree commit diff
path: root/src/librustc_save_analysis/lib.rs
AgeCommit message (Collapse)AuthorLines
2017-04-12First attempt at global_asm! macroA.J. Gardner-0/+1
2017-04-04rebasedNick Cameron-1/+5
2017-04-04save-analysis: index extern blocksNick Cameron-0/+55
2017-03-29Refactor how spans are combined in the parser.Jeffrey Seyfried-1/+1
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-4/+3
2017-03-23save-analysis: allow clients to get data directly without writing to a fileNick Cameron-56/+119
2017-03-19Rollup merge of #40554 - nrc:rls-data, r=alexcrichtonCorey Farwell-1/+4
Use rls-data crate This basically pulls out a bunch of data structures used by save-analysis for serialization into an external crate, and pulls that crate in using Rustbuild. The RLS can then share these data structures with the compiler which in some cases will allow more efficient communication between the compiler and the RLS (i.e., without serialisation). Along the way, I have to pull in rls-span, which is the RLS's way of defining spans (more type-safe than the compiler's built-in way). This is basically just to convert from compiler spans to RLS spans. I also pull in the crates.io version of rustc-serialize, which is a bit annoying, but seems to be the only way to have serialisable data in an external crate. To make this work, all of the save-analysis crate has to use this version too (cc #40527). Finally I pull in a line from #40347 to make the unstable crate checking stuff working. There are a lot of changes to save-analysis but they are all mechanical and trivial - changing from using `From` to `Into` (because of orphan rules) being the main thing. r? @alexcrichton
2017-03-19Auto merge of #39799 - dpc:create_dir_all, r=alexcrichtonbors-1/+1
Fix race condition in fs::create_dir_all The code would crash if the directory was created after create_dir_all checked whether the directory already existed. This was contrary to the documentation which claimed to create the directory if it doesn't exist, implying (but not stating) that there would not be a failure due to the directory existing.
2017-03-17Fix race condition in fs::create_dir_allDavid Roundy-1/+1
It is more robust to not fail if any directory in a path was created concurrently. This change lifts rustc internal `create_dir_racy` that was created to handle such conditions to be new `create_dir_all` implementation.
2017-03-15Add rls-span to do some conversions into rls-data.Nick Cameron-0/+1
And fix some warnings and borrow errors
2017-03-15Use out-of-tree rustc serializeNick Cameron-1/+1
And remove a few data structures in favour of rls-data ones
2017-03-15save-analysis: depend on the rls-data crateNick Cameron-0/+2
2017-03-14Refactor `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`.Jeffrey Seyfried-3/+2
2017-03-11Rollup merge of #40344 - nrc:save-container, r=eddybAriel Ben-Yehuda-1/+4
save-analysis: cope with lack of method data after a type error Fixes #39957 r? @eddyb
2017-03-10save-analysis: cope with lack of method data after a type errorNick Cameron-1/+4
Fixes #39957
2017-03-10Move remove_docs_from_attrs into lowering stepJonas Bushart-14/+8
2017-03-10Export attributes in save-analysis dataJonas Bushart-3/+18
Some annotations like the "test" annotations might be of interest for other projects, especially rls. Export all attributes in a new attributes item.
2017-02-25rustc_typeck: lift CrateCtxt to TyCtxt.Eduard Burtescu-3/+3
2017-02-13save-analysis: emit info about impls and super-traits in JSONNick Cameron-1/+3
2017-02-02save-analysis: be more paranoid about generated pathsNick Cameron-0/+3
fixes https://github.com/rust-lang-nursery/rls/issues/160
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-11/+11
2017-01-25rename `Tables` to `TypeckTables`Niko Matsakis-2/+2
2017-01-08Auto merge of #38813 - eddyb:lazy-11, r=nikomatsakisbors-24/+12
[11/n] Separate ty::Tables into one per each body. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/38449) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well. If any motivation is unclear, please ask for additional PR description clarifications or code comments._ <hr> In order to track the results of type-checking and inference for incremental recompilation, they must be stored separately for each function or constant value, instead of lumped together. These side-`Tables` also have to be tracked by various passes, as they visit through bodies (all of which have `Tables`, even if closures share the ones from their parent functions). This is usually done by switching a `tables` field in an override of `visit_nested_body` before recursing through `visit_body`, to the relevant one and then restoring it - however, in many cases the nesting is unnecessary and creating the visitor for each body in the crate and then visiting that body, would be a much cleaner solution. To simplify handling of inlined HIR & its side-tables, their `NodeId` remapping and entries HIR map were fully stripped out, which means that `NodeId`s from inlined HIR must not be used where a local `NodeId` is expected. It might be possible to make the nodes (`Expr`, `Block`, `Pat`, etc.) that only show up within a `Body` have IDs that are scoped to that `Body`, which would also allow `Tables` to use `Vec`s. That last part also fixes #38790 which was accidentally introduced in a previous refactor.
2017-01-06rustc: keep track of tables everywhere as if they were per-body.Eduard-Mihai Burtescu-24/+12
2016-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-28rustc: always print nested nodes where a HIR map is available.Eduard-Mihai Burtescu-1/+1
2016-12-22save-analysis signature stuff for json-api flavour.Nick Cameron-1/+0
2016-12-22signature info for other items (mods, fns, methods, etc.)Nick Cameron-13/+39
2016-12-22field signaturesNick Cameron-5/+29
2016-12-22save-analysis: fix ICE on partially resolved pathNick Cameron-0/+4
Occurs when we produce save-analysis before type checking is complete (due to errors).
2016-12-13rustc: Use `create_dir_racy` in save analysisAlex Crichton-2/+2
The OSX bots failed last night due a race condition in save analysis where concurrent calls to `fs::create_dir_all` conflicted with one another. This replaces the relevant function call with `fs::create_dir_racy` which is defined internally to the compiler.
2016-12-09Auto merge of #38203 - nrc:save-wr, r=eddybbors-1/+1
save-analysis: fix a few generated code errors
2016-12-06save-analysis: fix a few generated code errorsNick Cameron-1/+1
2016-12-06annotate stricter lifetimes on LateLintPass methods to allow them to forward ↵Oliver Schneider-1/+1
to a Visitor
2016-12-02Auto merge of #38053 - eddyb:lazy-9, r=nikomatsakisbors-1/+1
[9/n] rustc: move type information out of AdtDef and TraitDef. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37688) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well. If any motivation is unclear, please ask for additional PR description clarifications or code comments._ <hr> Both `AdtDef` and `TraitDef` contained type information (field types, generics and predicates) which was required to create them, preventing their use before that type information exists, or in the case of field types, *mutation* was required, leading to a variance-magicking implementation of `ivar`s. This PR takes that information out and the resulting cleaner setup could even eventually end up merged with HIR, because, just like `AssociatedItem` before it, there's no dependency on types anymore. (With one exception, variant discriminants should probably be moved into their own map later.)
2016-11-30Update the bootstrap compilerAlex Crichton-1/+0
Now that we've got a beta build, let's use it!
2016-11-29rustc: simplify AdtDef by removing the field types and ty::ivar.Eduard-Mihai Burtescu-1/+1
2016-11-28rustc_typeck: save the type cache for rustdoc and save-analysis.Eduard Burtescu-7/+22
2016-11-28rustc: embed path resolutions into the HIR instead of keeping DefMap.Eduard-Mihai Burtescu-10/+38
2016-11-23Auto merge of #37908 - nrc:save-def, r=eddybbors-1/+6
save-analysis: fix ICE on partially resolved path Occurs when we produce save-analysis before type checking is complete (due to errors).
2016-11-24Inspect def locally instead of using a methodNick Cameron-1/+6
2016-11-23save-analysis: fix ICE on partially resolved pathNick Cameron-1/+1
Occurs when we produce save-analysis before type checking is complete (due to errors).
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-4/+4
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-2/+3
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-2/+2
2016-11-20Refactor away `ast::Attribute_`.Jeffrey Seyfried-1/+1
2016-11-17hash the contents of impl-item-ref by adding them to visitorNiko Matsakis-1/+1
Also simplify some of the `ty::AssociatedItem` representation, in particular by folding `has_value` into `hir::Defaultness`
2016-11-12Rollup merge of #37688 - eddyb:lazy-8, r=petrochenkovEduard-Mihai Burtescu-1/+2
[8/n] rustc: clean up lookup_item_type and remove TypeScheme. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37676) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well. If any motivation is unclear, please ask for additional PR description clarifications or code comments._ <hr> * `tcx.tcache` -> `tcx.item_types` * `TypeScheme` (grouping `Ty` and `ty::Generics`) is removed * `tcx.item_types` entries no longer duplicated in `tcx.tables.node_types` * `tcx.lookup_item_type(def_id).ty` -> `tcx.item_type(def_id)` * `tcx.lookup_item_type(def_id).generics` -> `tcx.item_generics(def_id)` * `tcx.lookup_generics(def_id)` -> `tcx.item_generics(def_id)` * `tcx.lookup_{super_,}predicates(def_id)` -> `tcx.item_{super_,}predicates(def_id)`
2016-11-10rustc: clean up lookup_item_type and remove TypeScheme.Eduard Burtescu-1/+2
2016-11-10Add variants `Def::Macro` and `Namespace::MacroNS`.Jeffrey Seyfried-0/+1