about summary refs log tree commit diff
path: root/src/librustc/ich
AgeCommit message (Collapse)AuthorLines
2017-07-28Generator literal supportJohn Kåre Alsaker-5/+51
2017-07-27erase types in the move-path abstract domainAriel Ben-Yehuda-7/+9
Leaving types unerased would lead to 2 types with a different "name" getting different move-paths, which would cause major brokenness (see e.g. #42903). This does not fix any *known* issue, but is required if we want to use abs_domain with non-erased regions (because the same can easily have different names). cc @RalfJung.
2017-07-18Prohibit lifetime arguments in path segments with late bound lifetime parametersVadim Petrochenkov-0/+2
2017-07-12Auto merge of #43107 - michaelwoerister:less-span-info-in-debug, r=nikomatsakisbors-19/+24
incr.comp.: Don't include span information in the ICH of type definitions This should improve some of the `regex` tests on perf.rlo. Not including spans into the ICH is harmless until we also cache warnings. To really solve the problem, we need to do more refactoring (see #43088). r? @nikomatsakis
2017-07-11Downgrade ProjectionTy's TraitRef to its substsTobias Schottdorf-3/+3
Addresses the second part of #42171 by removing the `TraitRef` from `ProjectionTy`, and directly storing its `Substs`. Closes #42171.
2017-07-10Add StableHash implementation for ty::Instance.Michael Woerister-0/+57
2017-07-10Store all generic arguments for method calls in HIRVadim Petrochenkov-1/+1
2017-07-07incr.comp.: Don't include span information in the ICH of type definitions.Michael Woerister-19/+24
2017-07-05use field init shorthand in src/librustcZack M. Davis-3/+3
The field init shorthand syntax was stabilized in 1.17.0 (aebd94f); we are now free to use it in the compiler.
2017-07-05Merge remote-tracking branch 'origin/master' into proc_macro_apiAlex Crichton-2/+1
2017-06-27rustc: move the PolyFnSig out of TyFnDef.Eduard-Mihai Burtescu-2/+1
2017-06-26Simplify `hygiene::Mark` application, andJeffrey Seyfried-2/+1
remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
2017-06-19Auto merge of #39409 - pnkfelix:mir-borrowck2, r=nikomatsakisbors-0/+3
MIR EndRegion Statements (was MIR dataflow for Borrows) This PR adds an `EndRegion` statement to MIR (where the `EndRegion` statement is what terminates a borrow). An earlier version of the PR implemented a dataflow analysis on borrow expressions, but I am now factoring that into a follow-up PR so that reviewing this one is easier. (And also because there are some revisions I want to make to that dataflow code, but I want this PR to get out of WIP status...) This is a baby step towards MIR borrowck. I just want to get the review process going while I independently work on the remaining steps.
2017-06-18Auto merge of #42593 - ibabushkin:on-demand-external-source, r=eddybbors-0/+4
Implement lazy loading of external crates' sources. Fixes #38875 Fixes #38875. This is a follow-up to #42507. When a (now correctly translated) span from an external crate is referenced in a error, warning or info message, we still don't have the source code being referenced. Since stuffing the source in the serialized metadata of an rlib is extremely wasteful, the following scheme has been implemented: * File maps now contain a source hash that gets serialized as well. * When a span is rendered in a message, the source hash in the corresponding file map(s) is used to try and load the source from the corresponding file on disk. If the file is not found or the hashes don't match, the failed attempt is recorded (and not retried). * The machinery fetching source lines from file maps is augmented to use the lazily loaded external source as a secondary fallback for file maps belonging to external crates. This required a small change to the expected stderr of one UI test (it now renders a span, where previously was none). Further work can be done based on this - some of the machinery previously used to hide external spans is possibly obsolete and the hashing code can be reused in different places as well. r? @eddyb
2017-06-13incr.comp.: Make DepNode's std::fmt::Debug implementation useful again.Michael Woerister-0/+11
2017-06-12Add `EndRegion` statement kind to MIR.Felix S. Klock II-0/+3
* Emit `EndRegion` for every code-extent for which we observe a borrow. To do this, we needed to thread source info back through to `fn in_scope`, which makes this commit a bit more painful than one might have expected. * There is `end_region` emission in `Builder::pop_scope` and in `Builder::exit_scope`; the first handles falling out of a scope normally, the second handles e.g. `break`. * Remove `EndRegion` statements during the erase_regions mir transformation. * Preallocate the terminator block, and throw an `Unreachable` marker on it from the outset. Then overwrite that Terminator as necessary on demand. * Instead of marking the scope as needs_cleanup after seeing a borrow, just treat every scope in the chain as being part of the diverge_block (after any *one* of them has separately signalled that it needs cleanup, e.g. due to having a destructor to run). * Allow for resume terminators to be patched when looking up drop flags. (In particular, `MirPatch::new` has an explicit code path, presumably previously unreachable, that patches up such resume terminators.) * Make `Scope` implement `Debug` trait. * Expanded a stray comment: we do not emit StorageDead on diverging paths, but that end behavior might not be desirable.
2017-06-10Added external crates' sources to FileMap.Inokentiy Babushkin-0/+1
They are now handled in their own member to prevent mutating access to the `src` member. This way, we can safely load external sources, while keeping the mutation of local source strings off-limits.
2017-06-10Added source hashes to FileMapInokentiy Babushkin-0/+3
We can use these to perform lazy loading of source files belonging to external crates. That way we will be able to show the source code of external spans that have been translated.
2017-06-06ICH: Add some HashStable implementations.Michael Woerister-1/+14
2017-06-06ICH: Make StableHashingContext work with any TyCtxt, not just the global one.Michael Woerister-179/+210
2017-06-04Auto merge of #42265 - Zoxc:for-sugar, r=eddybbors-1/+7
Change for-loop desugar to not borrow the iterator during the loop This is enables the use of suspend points inside for-loops in movable generators. This is illegal in the current desugaring as `iter` is borrowed across the body.
2017-06-03Auto merge of #42332 - michaelwoerister:no-more-retracing, r=nikomatsakisbors-1/+2
incr.comp.: Use DefPathHash-based DepNodes in the serialized DepGraph and remove obsolete DefIdDirectory With this PR we don't store the dep-graph as a set of `DepNode<IndexIntoDefIdDirectory>` anymore but instead as a set of `DepNode<DefPathHash>`. Since a `DefPathHash` is a global identifier that is valid across compilation sessions, we don't need the `DefIdDirectory` anymore. Since a `DepNode<DefPathHash>` is bigger than a `DepNode<IndexIntoDefIdDirectory>` and our on-disk encoding of the dep-graph is inefficient, this PR will probably increase the amount of space the dep-graph takes up on disk. I'm in the process of gathering some performance data. The changes in here are a step towards implementing ICH-based `DepNodes` (#42294). r? @nikomatsakis
2017-06-02Rollup merge of #42335 - jcowgill:fingerprint-be, r=michaelwoeristerMark Simulacrum-19/+1
Don't byteswap Fingerprints when encoding Byteswapping Fingerprints when encoding is unnessesary and breaks if the Fingerprint is later decoded on a machine with different endianness to the one it was encoded on. Fixes #42239 This PR fixes a regression caused by #42082. @michaelwoerister
2017-06-01Change for-loop desugar to not borrow the iterator during the loopJohn Kåre Alsaker-1/+7
2017-06-01Auto merge of #42281 - eddyb:well-adjusted, r=nikomatsakisbors-24/+11
Decompose Adjustment into smaller steps and remove the method map. The method map held method callee information for: * actual method calls (`x.f(...)`) * overloaded unary, binary, indexing and call operators * *every overloaded deref adjustment* (many can exist for each expression) That last one was a historical ~~accident~~ hack, and part of the motivation for this PR, along with: * a desire to compose adjustments more freely * containing the autoderef logic better to avoid mutation within an inference snapshot * not creating `TyFnDef` types which are incompatible with the original one * i.e. we used to take a`TyFnDef`'s `for<'a> &'a T -> &'a U` signature and instantiate `'a` using a region inference variable, *then* package the resulting `&'b T -> &'b U` signature in another `TyFnDef`, while keeping *the same* `DefId` and `Substs` * to fix #3548 by explicitly writing autorefs for the RHS of comparison operators Individual commits tell their own story, of "atomic" changes avoiding breaking semantics. Future work based on this PR could include: * removing the signature from `TyFnDef`, now that it's always "canonical" * some questions of variance remain, as subtyping *still* treats the signature differently * moving part of the typeck logic for methods, autoderef and coercion into `rustc::traits` * allowing LUB coercions (joining multiple expressions) to "stack up" many adjustments * transitive coercions (e.g. reify or unsize after multiple steps of autoderef) r? @nikomatsakis
2017-06-01Don't byteswap Fingerprints when encodingJames Cowgill-19/+1
Byteswapping Fingerprints when encoding is unnessesary and breaks if the Fingerprint is later decoded on a machine with different endianness to the one it was encoded on. Fix by removing the Encodable and Decodable implementations and use the ones derived from RustcEncodable and RustcDecodable. Fixes #42239
2017-06-01rustc: decompose Adjustment into a vector of adjustment steps.Eduard-Mihai Burtescu-5/+9
2017-06-01rustc: move autoref and unsize from Adjust::DerefRef to Adjustment.Eduard-Mihai Burtescu-4/+2
2017-06-01rustc: replace autoderefs' use of MethodCallee with OverloadedDeref.Eduard-Mihai Burtescu-1/+1
2017-06-01rustc: replace method_map with Def::Method and node_substs entries.Eduard-Mihai Burtescu-4/+2
2017-06-01rustc: remove unnecessary ItemSubsts wrapper.Eduard-Mihai Burtescu-4/+2
2017-06-01rustc: replace TyFnDef in MethodCallee with just the FnSig.Eduard-Mihai Burtescu-1/+1
2017-06-01rustc: keep overloaded autoderef MethodCallee's in Adjust.Eduard-Mihai Burtescu-13/+2
2017-05-31Upgrade ProjectionTy's Name to a DefIdTobias Schottdorf-1/+1
Part of #42171, in preparation for downgrading the contained `TraitRef` to only its `substs`.
2017-05-31Make a newtype for DefPathHash so they are not confused with content hashesMichael Woerister-1/+2
2017-05-28Auto merge of #42175 - michaelwoerister:filemap-hashing-fix-1, r=nikomatsakisbors-29/+54
incr.comp.: Track expanded spans instead of FileMaps. This PR removes explicit tracking of FileMaps in response to #42101. The reasoning behind being able to just *not* track access to FileMaps is similar to why we don't track access to the `DefId->DefPath` map: 1. One can only get ahold of a `Span` value by accessing the HIR (for local things) or a `metadata::schema::Entry` (for things from external crates). 2. For both of these things we compute a hash that incorporates the *expanded spans*, that is, what we hash is in the (FileMap independent) format `filename:line:col`. 3. Consequently, everything that emits a span should already be tracked via its dependency to something that has the span included in its hash and changes would be detected via that hash. One caveat here is that we have to be conservative when exporting things in metadata. A crate can be built without debuginfo and would thus by default not incorporate most spans into the metadata hashes. However, a downstream crate can make an inline copy of things in the upstream crate and span changes in the upstream crate would then go undetected, even if the downstream uses them (e.g. by emitting debuginfo for an inlined function). For this reason, we always incorporate spans into metadata hashes for now (there might be more efficient ways to handle this safely when red-green tracking is implemented). r? @nikomatsakis
2017-05-28add NullOp::SizeOf and BinOp::OffsetAriel Ben-Yehuda-2/+8
2017-05-26Auto merge of #42058 - froydnj:thiscall-support, r=nikomatsakisbors-0/+1
add thiscall calling convention support This support is needed for bindgen to work well on 32-bit Windows, and also enables people to begin experimenting with C++ FFI support on that platform. Fixes #42044.
2017-05-25Improve intercrate hygiene.Jeffrey Seyfried-1/+1
2017-05-25Improve efficiency.Jeffrey Seyfried-1/+1
2017-05-25Hygienize `librustc_privacy`.Jeffrey Seyfried-0/+1
2017-05-25Declarative macros 2.0 without hygiene.Jeffrey Seyfried-0/+1
2017-05-24add thiscall calling convention supportNathan Froyd-0/+1
This support is needed for bindgen to work well on 32-bit Windows, and also enables people to begin experimenting with C++ FFI support on that platform. Fixes #42044.
2017-05-23incr.comp.: Track expanded spans instead of FileMaps.Michael Woerister-29/+54
2017-05-18Use 128 instead of 64 bits for DefPath hashesMichael Woerister-1/+1
2017-05-18Use in-memory representation for Fingerprint that is more amenable to hashing.Michael Woerister-46/+26
2017-05-15ICH: Hash lists of local trait impls as part of the HIR.Michael Woerister-2/+33
2017-05-13rustc: stop interning CodeExtent, it's small enough.Eduard-Mihai Burtescu-8/+8
2017-05-13rustc: remove redundant fn_id's from CodeExtentData.Eduard-Mihai Burtescu-3/+2
2017-05-13rustc: treat ReEarlyBound as free without replacing it with ReFree.Eduard-Mihai Burtescu-1/+2