about summary refs log tree commit diff
path: root/src/librustc/hir/map
AgeCommit message (Collapse)AuthorLines
2017-11-03[Syntax Breaking] Rename DefaultImpl to AutoImplleonardo.yvens-6/+6
DefaultImpl is a highly confusing name for what we now call auto impls, as in `impl Send for ..`. The name auto impl is not formally decided but for sanity anything is better than `DefaultImpl` which refers neither to `default impl` nor to `impl Default`.
2017-10-26incr.comp.: Fix invalid DepNode assignment in HIR map.Michael Woerister-1/+1
2017-10-26Auto merge of #45464 - sinkuu:ice_44851, r=jseyfriedbors-0/+14
Visit attribute tokens in `DefCollector` and `BuildReducedGraphVisitor` Fixes #44851.
2017-10-24Introduce CrateDisambiguator newtype and fix testsIgor Matuszewski-7/+13
2017-10-23Use 128 bit instead of Symbol for crate disambiguatorIgor Matuszewski-2/+3
2017-10-23Fix #44851 by visiting tokens in `DefCollector` and `BuildReducedGraphVisitor`sinkuu-0/+14
2017-10-05Fix infinite recursion in <DepNode as Debug>.Michael Woerister-21/+0
2017-09-23incr.comp.: Do some various cleanup.Michael Woerister-11/+1
2017-09-23incr.comp.: Initial implemenation of append-only dep-graph.Michael Woerister-0/+9
2017-09-22Auto merge of #44696 - michaelwoerister:fingerprints-in-dep-graph-3, ↵bors-46/+171
r=nikomatsakis incr.comp.: Move task result fingerprinting into DepGraph. This PR - makes the DepGraph store all `Fingerprints` of task results, - allows `DepNode` to be marked as input nodes, - makes HIR node hashing use the regular fingerprinting infrastructure, - removes the now unused `IncrementalHashesMap`, and - makes sure that `traits_in_scope_map` fingerprints are stable. r? @nikomatsakis cc @alexcrichton
2017-09-21Refactor lifetime name into an enumTaylor Cramer-1/+1
2017-09-20incr.comp.: Add some comments.Michael Woerister-1/+8
2017-09-20incr.comp.: Store result fingerprints in DepGraph.Michael Woerister-46/+164
2017-09-19rework the README.md for rustc and add other readmesNiko Matsakis-0/+4
This takes way longer than I thought it would. =)
2017-09-18incr.comp.: Remove tcx from StableHashingContext.Michael Woerister-4/+4
2017-09-08Use NodeId/HirId instead of DefId for local variables.Eduard-Mihai Burtescu-17/+1
2017-09-05rustc: Store InternedString in `DefPathData`Alex Crichton-32/+36
Previously a `Symbol` was stored there, but this ended up causing hash collisions in situations that otherwise shouldn't have a hash collision. Only the symbol's string value was hashed, but it was possible for distinct symbols to have the same string value, fooling various calcuations into thinking that these paths *didn't* need disambiguating data when in fact they did! By storing `InternedString` instead we're hopefully triggering all the exising logic to disambiguate paths with same-name `Symbol` but actually distinct locations.
2017-09-05rustc: Move stability functionality into queriesAlex Crichton-1/+11
This commit primarily removes the `stability` field from `TyCtxt` as well as its internal mutable state, instead using a query to build the stability index as well as primarily using queries for other related lookups. Like previous commits the calculation of the stability index is wrapped in a `with_ignore` node to avoid regressing the current tests, and otherwise this commit also introduces #44232 but somewhat intentionally so.
2017-09-01rustc: use hir::ItemLocalId instead of ast::NodeId in CFG.Eduard-Mihai Burtescu-1/+14
2017-08-25Fix merge conflictAlex Crichton-1/+1
2017-08-25Merge remote-tracking branch 'origin/master' into genAlex Crichton-222/+297
2017-08-22incr.comp.: Cache Hir-DepNodeIndices in the HIR map.Michael Woerister-222/+297
2017-08-21Merge remote-tracking branch 'origin/master' into genAlex Crichton-13/+31
2017-08-18rustc: Add `Local` to the HIR map of parentsAlex Crichton-1/+19
When walking parents for lints we want to be sure to hit `let` statements which can have attributes, so hook up these statements in the HIR map. Closes #43910
2017-08-17rustc: Rename NodeLocal to NodeBindingAlex Crichton-12/+12
2017-08-17Merge remote-tracking branch 'origin/master' into genAlex Crichton-1/+1
2017-08-15Fix typos & us spellingsFourchaux-1/+1
2017-08-14Merge remote-tracking branch 'origin/master' into genAlex Crichton-1/+41
2017-08-14Auto merge of #43740 - michaelwoerister:local-id-in-typecktables, r=arielb1bors-0/+40
Use hir::ItemLocalId as keys in TypeckTables. This PR makes `TypeckTables` use `ItemLocalId` instead of `NodeId` as key. This is needed for incremental compilation -- for stable hashing and for being able to persist and reload these tables. The PR implements the most important part of https://github.com/rust-lang/rust/issues/40303. Some notes on the implementation: * The PR adds the `HirId` to HIR nodes where needed (`Expr`, `Local`, `Block`, `Pat`) which obviates the need to store a `NodeId -> HirId` mapping in crate metadata. Thanks @eddyb for the suggestion! In the future the `HirId` should completely replace the `NodeId` in HIR nodes. * Before something is read or stored in one of the various `TypeckTables` subtables, the entry's key is validated via the new `TypeckTables::validate_hir_id()` method. This makes sure that we are not mixing information from different items in a single table. That last part could be made a bit nicer by either (a) new-typing the table-key and making `validate_hir_id()` the only way to convert a `HirId` to the new-typed key, or (b) just encapsulate sub-table access a little better. This PR, however, contents itself with not making things significantly worse. Also, there's quite a bit of switching around between `NodeId`, `HirId`, and `DefIndex`. These conversions are cheap except for `HirId -> NodeId`, so if the valued reviewer finds such an instance in a performance critical place, please let me know. Ideally we convert more and more code from `NodeId` to `HirId` in the future so that there are no more `NodeId`s after HIR lowering anywhere. Then the amount of switching should be minimal again. r? @eddyb, maybe?
2017-08-12Fix some typosBastien Orivel-1/+1
2017-08-11Add some ID conversion methods to HIR map and Definitions.Michael Woerister-0/+23
2017-08-11Make Definitions::find_node_for_hir_id() a linear search instead of a binary ↵Michael Woerister-1/+5
one. Unfortunately, the NodeId->HirId array is not sorted. Since this search is only done right before calling bug!(), let's not waste time allocating a faster lookup.
2017-08-11Make TypeckTables::type_dependent_defs use ItemLocalId instead of NodeId.Michael Woerister-0/+13
2017-08-09Merge remote-tracking branch 'origin/master' into genAlex Crichton-16/+30
2017-08-04Auto merge of #43403 - RalfJung:mir-validate, r=nikomatsakisbors-0/+12
Add MIR Validate statement This adds statements to MIR that express when types are to be validated (following [Types as Contracts](https://internals.rust-lang.org/t/types-as-contracts/5562)). Obviously nothing is stabilized, and in fact a `-Z` flag has to be passed for behavior to even change at all. This is meant to make experimentation with Types as Contracts in miri possible. The design is definitely not final. Cc @nikomatsakis @aturon
2017-08-02Auto merge of #43605 - RalfJung:mapdoc, r=michaelwoeristerbors-2/+4
Improve hir::map::Map::get_parent_node doc The documentation says ``` /// Similar to get_parent, returns the parent node id or id if there is no /// parent. /// This function returns the immediate parent in the AST, whereas get_parent /// returns the enclosing item. ``` One would think that one can walk up the tree by repeatedly calling `get_parent_node` until it returns the argument, and then work on the `NodeId`s that arise. However, that is not true: `get_parent_node` will return id 0 (the crate itself) for items that sit directly in the crate; calling `get` on that `NodeId` will panic. So, the fact that `get_parent_node` returns the root when passed the root is actually not really useful, because the root itself is already a somewhat degenerate node. This improves the doc so hopefully people writing code that "walks up the tree" don't run into this issue like I did...
2017-08-01improve hir::map::Map::get_parent_node docRalf Jung-2/+4
2017-08-01use FnLike to recognize functions for usRalf Jung-0/+12
2017-08-01rustc::hir::map::definitions - fix O(n^2) when disambiguatingAriel Ben-Yehuda-14/+14
Instead of finding the next free disambiguator by incrementing it until you find a place, store the next available disambiguator in an hash-map. This avoids O(n^2) performance when lots of items have the same un-disambiguated `DefPathData` - e.g. all `use` items have `DefPathData::Misc`.
2017-07-28Remove support for `gen arg`Alex Crichton-18/+0
2017-07-28Remove a FIXMEJohn Kåre Alsaker-1/+0
2017-07-28Generator literal supportJohn Kåre Alsaker-3/+24
2017-07-20Remove unused DefTable::retrace_path().Michael Woerister-71/+20
2017-07-05use field init shorthand in src/librustcZack M. Davis-21/+21
The field init shorthand syntax was stabilized in 1.17.0 (aebd94f); we are now free to use it in the compiler.
2017-06-27Review commentsEsteban Küber-0/+22
- Fix typo - Add docstring - Remove spurious test output file
2017-06-24Detect missing `;` on methods with return type `()`Esteban Küber-5/+39
- Point out the origin of a type requirement when it is the return type of a method - Point out possibly missing semicolon when the return type is () and the implicit return makes sense as a statement - Suggest changing the return type of methods with default return type - Don't suggest changing the return type on fn main() - Don't suggest changing the return type on impl fn
2017-06-13incr.comp.: Don't use Ident in DefPath because that's unstable across ↵Michael Woerister-86/+92
compilation sessions.
2017-06-09incr.comp.: Uniformly represent DepNodes as (Kind, StableHash) pairs.Michael Woerister-20/+25
2017-06-07Allocate DefIndices for global crate metadata.Michael Woerister-12/+106
This allows for treating global crate metadata the same as regular metadata with regard to incr. comp.
2017-05-31Don't print the whole crate disambiguator value in debug outputMichael Woerister-1/+3