summary refs log tree commit diff
path: root/src/librustc_save_analysis
AgeCommit message (Collapse)AuthorLines
2017-01-27save-analysis: get tables directly, accomodating them being missingNick Cameron-4/+9
Fixes an ICE when running with save-analsysis after an error
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-61/+61
2017-01-25rename `Tables` to `TypeckTables`Niko Matsakis-2/+2
2017-01-25save-analysis: walk pathsNick Cameron-0/+1
Catches generic types in paths
2017-01-25save-analysis: walk path expressionsNick Cameron-0/+6
This is actually kinda hard to hit, but it fixes missing the `foo` in `for _ in foo {}`.
2017-01-20Rollup merge of #39118 - jseyfried:token_tree_based_parser, r=nrcAlex Crichton-7/+6
Refactor the parser to consume token trees This is groundwork for efficiently parsing attribute proc macro invocations, bang macro invocations, and `TokenStream`-based attributes and fragment matchers. This improves parsing performance by 8-15% and expansion performance by 0-5% on a sampling of the compiler's crates. r? @nrc
2017-01-17Introduce `string_reader.parse_all_token_trees()`.Jeffrey Seyfried-5/+5
2017-01-17Give the `StringReader` a `sess: &ParseSess`.Jeffrey Seyfried-2/+1
2017-01-10save-analysis: handle paths in type/trait context more correctlyNick Cameron-8/+6
TBH, this is still not perfect, witness the FIXME, but it is an improvement. In particular it means we get information about trait references in impls.
2017-01-09save-analysis: fix over-zealous filter on generated codeNick Cameron-8/+9
2017-01-08Auto merge of #38813 - eddyb:lazy-11, r=nikomatsakisbors-38/+48
[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-38/+48
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-23Auto merge of #38529 - nrc:save-sig, r=nikomatsakisbors-16/+320
save-analysis: add signature info These 'signatures' for definitions contain enough info for the RLS to create Rustdoc-style info on the fly.
2016-12-22Refactor how global paths are represented (for both ast and hir).Jeffrey Seyfried-32/+17
2016-12-22rebasing fixNick Cameron-1/+1
2016-12-22save-analysis signature stuff for json-api flavour.Nick Cameron-9/+8
2016-12-22signature info for other items (mods, fns, methods, etc.)Nick Cameron-50/+106
2016-12-22further lowering of signature dataNick Cameron-8/+89
2016-12-22field signaturesNick Cameron-7/+38
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-22save-analysis: add `Signature` info to structsNick Cameron-6/+139
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-9/+11
save-analysis: fix a few generated code errors
2016-12-06save-analysis: fix a few generated code errorsNick Cameron-9/+11
2016-12-06annotate stricter lifetimes on LateLintPass methods to allow them to forward ↵Oliver Schneider-50/+53
to a Visitor
2016-12-02Auto merge of #38053 - eddyb:lazy-9, r=nikomatsakisbors-2/+2
[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-30Auto merge of #37800 - alexcrichton:new-bootstrap, r=eddybbors-1/+0
Update the bootstrap compiler Now that we've got a beta build, let's use it!
2016-11-30Update the bootstrap compilerAlex Crichton-1/+0
Now that we've got a beta build, let's use it!
2016-11-30Auto merge of #37989 - nrc:save-mod, r=nikomatsakisbors-17/+39
save-analysis: redirect a module decl to the start of the defining file
2016-11-29rustc: simplify AdtDef by removing the field types and ty::ivar.Eduard-Mihai Burtescu-2/+2
2016-11-28rustc_typeck: save the type cache for rustdoc and save-analysis.Eduard Burtescu-16/+27
2016-11-28rustc: embed path resolutions into the HIR instead of keeping DefMap.Eduard-Mihai Burtescu-21/+47
2016-11-25save-analysis: redirect a module decl to the start of the defining fileNick Cameron-17/+39
2016-11-23Auto merge of #37908 - nrc:save-def, r=eddybbors-6/+32
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-23Fix a bunch of bugs shown by the testNick Cameron-5/+26
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-4/+7
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-18Auto merge of #37776 - nrc:save-double-angle, r=@brsonbors-14/+42
save-analysis: handle << and >> operators inside [] in types Fixes #37700
2016-11-18save-analysis: handle << and >> operators inside [] in typesNick Cameron-14/+42
Fixes #37700
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/+2
2016-11-10Rollup merge of #37412 - eddyb:lazy-6, r=nikomatsakisEduard-Mihai Burtescu-1/+1
[6/n] rustc: transition HIR function bodies from Block to Expr. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37408) | [next](https://github.com/rust-lang/rust/pull/37676)) 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> The main change here is that functions and closures both use `Expr` instead of `Block` for their bodies. For closures this actually allows a honest representation of brace-less closure bodies, e.g. `|x| x + 1` is now distinguishable from `|x| { x + 1 }`, therefore this PR is `[syntax-breaking]` (cc @Manishearth). Using `Expr` allows more logic to be shared between constant bodies and function bodies, with some small such changes already part of this PR, and eventually easing #35078 and per-body type tables. Incidentally, there used to be some corners cut here and there and as such I had to (re)write divergence tracking for type-checking so that it is capable of understanding basic structured control-flow: ``` rust fn a(x: bool) -> i32 { // match also works (as long as all arms diverge) if x { panic!("true") } else { return 1; } 0 // "unreachable expression" after this PR } ``` And since liveness' "not all control paths return a value" moved to type-checking we can have nice things: ``` rust // before & after: fn b() -> i32 { 0; } // help: consider removing this semicolon // only after this PR fn c() -> i32 { { 0; } } // help: consider removing this semicolon fn d() { let x: i32 = { 0; }; } // help: consider removing this semicolon fn e() { f({ 0; }); } // help: consider removing this semicolon ```