about summary refs log tree commit diff
path: root/src/librustc_save_analysis/lib.rs
AgeCommit message (Collapse)AuthorLines
2019-01-13Rollup merge of #57474 - emilio:save-analysis-path, r=nrcMazdak Farrokhzad-3/+5
save-analysis: Get path def from parent in case there's no def for the path itself. This fixes #57462. The relevant part from the hir type collector is: ``` DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(32) => Entry { parent: NodeId(33), dep_node: 4294967040, node: Expr(expr(32: <Foo>::new)) } DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(48) => Entry { parent: NodeId(32), dep_node: 4294967040, node: Ty(type(Foo)) } DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(30) => Entry { parent: NodeId(48), dep_node: 4294967040, node: PathSegment(PathSegment { ident: Foo#0, id: Some(NodeId(30)), def: Some(Err), args: None, infer_types: true }) } DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(31) => Entry { parent: NodeId(32), dep_node: 4294967040, node: PathSegment(PathSegment { ident: new#0, id: Some(NodeId(31)), def: Some(Err), args: None, infer_types: true }) } ``` We have the right ID when looking for NodeId(31) and try with NodeId(32) (which is the right thing to look for) from get_path_data. But not when we look from `write_sub_paths_truncated` Basically process_path takes an id which is always the parent, and that we fall back to in get_path_data(), so we get the right result for the last path segment, but not for the other segments that get written to from write_sub_paths_truncated. I think we can stop passing the explicit `id` around to get_path_data as a followup.
2019-01-09save-analysis: Get path def from parent in case there's no def for the path ↵Emilio Cobos Álvarez-3/+5
itself. This fixes #57462. The relevant part from the hir type collector is: ``` DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(32) => Entry { parent: NodeId(33), dep_node: 4294967040, node: Expr(expr(32: <Foo>::new)) } DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(48) => Entry { parent: NodeId(32), dep_node: 4294967040, node: Ty(type(Foo)) } DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(30) => Entry { parent: NodeId(48), dep_node: 4294967040, node: PathSegment(PathSegment { ident: Foo#0, id: Some(NodeId(30)), def: Some(Err), args: None, infer_types: true }) } DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(31) => Entry { parent: NodeId(32), dep_node: 4294967040, node: PathSegment(PathSegment { ident: new#0, id: Some(NodeId(31)), def: Some(Err), args: None, infer_types: true }) } ``` We have the right ID when looking for NodeId(31) and try with NodeId(32) (which is the right thing to look for) from get_path_data, but not for the segments that we write from `write_sub_paths_truncated`. Basically `process_path` takes an id which is always the parent, and that we fall back to in `get_path_data()`, so we get the right result for the last path segment, but not for the other segments that get written to from `write_sub_paths_truncated`. I think we can stop passing the explicit id around to `get_path_data` now, will consider sending that as a followup.
2019-01-08save-analysis: use a fallback when access levels couldn't be computedIgor Matuszewski-0/+11
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn Kåre Alsaker-13/+13
2018-11-19save-analysis: fallback to using path idNick Cameron-4/+17
2018-10-26Fix tests and assertions; add some commentsNick Cameron-1/+5
2018-10-26save-analysis: handle missing field namesNick Cameron-6/+7
FIxes https://github.com/rust-lang-nursery/rls/issues/1031
2018-10-26dump refs for path segments in save-analysisNick Cameron-0/+4
Requires adding path segments to the hir map
2018-10-26dump data for prefix path segmentsNick Cameron-25/+13
2018-10-26save-analysis: remove hacky, unnecessary code now that we have spans for ↵Nick Cameron-72/+44
every ident
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-2/+2
2018-09-30Auto merge of #54601 - cuviper:prep-1.31, r=Mark-Simulacrumbors-1/+1
Bump to 1.31.0 and bootstrap from 1.30 beta Closes #54594.
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-1/+1
2018-09-28Minimize final diffIgor Matuszewski-5/+3
2018-09-28Remap only source files in the command lineIgor Matuszewski-14/+9
2018-09-28Emit only necessary compilation options in save-analysisIgor Matuszewski-12/+26
This is `command`, `directory` and `output` file.
2018-09-28Emit used rustc invocation in the save-analysis fileIgor Matuszewski-4/+23
2018-09-13introduce SelfCtorF001-0/+1
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-09-03A few cleanups and minor improvements to save_analysisljedrz-3/+3
2018-08-30Rollup merge of #53732 - emilio:foreign-fn, r=nrcPietro Albini-2/+2
save-analysis: Differentiate foreign functions and statics.
2018-08-27Rename hir::map::NodeKind to hir::Nodevarkor-15/+15
2018-08-27Rename hir::map::Node to hir::map::NodeKindvarkor-15/+15
2018-08-27Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakisbors-0/+1
fix for late-bound regions Fix for https://github.com/rust-lang/rust/issues/53419 r? @nikomatsakis
2018-08-27save-analysis: Differentiate foreign functions and statics.Emilio Cobos Álvarez-2/+2
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-23use String::new() instead of String::from(""), "".to_string(), "".to_owned() ↵Matthias Krüger-1/+1
or "".into()
2018-08-22Replace TyForeign with ForeignTyvarkor-1/+1
2018-08-22Rename Def::{Param, Foreign} to Def::{TyParam, TyForeign}varkor-2/+2
2018-08-22Remove Ty prefix from Ty{Foreign|Param}varkor-2/+2
2018-08-22Remove Ty prefix from ↵varkor-5/+5
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-19mv codemap() source_map()Donato Sciarra-3/+3
2018-08-19mv (mod) codemap source_mapDonato Sciarra-2/+2
2018-08-10Rollup merge of #53214 - memoryruins:nll_bootstrap_2, r=nikomatsakiskennytm-0/+1
[nll] enable feature(nll) on various crates for bootstrap: part 2 #53172
2018-08-09Rollup merge of #53110 - Xanewok:save-analysis-remap-path, r=nrckennytm-1/+1
Account for --remap-path-prefix in save-analysis Fixes #52549. Didn't add a test since save-analysis is still unstable, only tested this locally. Should I add a test for that? If so, is run-make-fulldeps an appropriate format? Session is already created with remapped working directory, so use that instead of the actual cwd. This was the only place affected, since the rest of the paths in save-analysis are directly derived from files in spans from `sess.codemap()`, which already creates remapped ones. r? @nrc
2018-08-09[nll] librustc_save_analysis: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-08-08Auto merge of #53053 - petrochenkov:custattr, r=alexcrichtonbors-1/+1
resolve: Support custom attributes when macro modularization is enabled Basically, if resolution of a single-segment attribute is a determined error, then we interpret it as a custom attribute. Since custom attributes are integrated into general macro resolution, `feature(custom_attribute)` now requires and implicitly enables macro modularization (`feature(use_extern_macros)`). Actually, a few other "advanced" macro features now implicitly enable macro modularization too (and one bug was found and fixed in process of enabling it). The first two commits are preliminary cleanups/refactorings.
2018-08-07Rollup merge of #52886 - petrochenkov:noga, r=alexcrichtonkennytm-1/+0
cleanup: Remove `Def::GlobalAsm` Global asm is not something that needs to have a `Def` or `DefId`.
2018-08-06Discern between various kinds of non-macro attributesVadim Petrochenkov-1/+1
2018-08-06Account for --remap-path-prefix in save-analysisIgor Matuszewski-1/+1
2018-08-04Normalize variants of CrateType to standard styleMark Rousskov-2/+2
This is a clippy-breaking change.
2018-08-04cleanup: Remove `Def::GlobalAsm`Vadim Petrochenkov-1/+0
2018-08-01resolve: Implement prelude search for macro pathsVadim Petrochenkov-0/+2
resolve/expansion: Implement tool attributes
2018-07-29Remove unused `mut`sMatthew Jasper-1/+1
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-1/+0
2018-07-18Implement existential typesOliver Schneider-0/+1
2018-07-16ItemKindcsmoe-2/+2
2018-07-16TyKindcsmoe-1/+1