about summary refs log tree commit diff
path: root/src/librustc/ich
AgeCommit message (Collapse)AuthorLines
2017-12-14add trait aliases to HIRAlex Burka-0/+2
2017-12-14incr.comp.: Do less hashing per Span.Michael Woerister-6/+11
2017-12-14incr.comp.: Speed up span hashing by caching expansion context hashes.Michael Woerister-3/+28
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-0/+11
2017-12-13Auto merge of #46419 - jseyfried:all_imports_in_metadata, r=nrcbors-1/+3
Record all imports (`use`, `extern crate`) in the crate metadata This PR adds non-`pub` `use` and `extern crate` imports in the crate metadata since hygienic macros invoked in other crates may use them. We already include all other non-`pub` items in the crate metadata. This improves import suggestions in some cases. Fixes #42337. r? @nrc
2017-12-08incr.comp.: Hash spans unconditionally for full accuracy.Michael Woerister-203/+13
2017-12-07mir-borrowck returns closure requirements, mir-typeck enforcesNiko Matsakis-0/+22
2017-12-05Add field `is_import` to `def::Export`.Jeffrey Seyfried-1/+2
2017-12-05Include non-`pub` `use` and `extern crate` items in the crate metadata for ↵Jeffrey Seyfried-0/+1
macros 2.0.
2017-12-02Auto merge of #46368 - michaelwoerister:incr-comp-type-debuginfo-spans, r=eddybbors-11/+9
incr.comp.: Remove an unnecessary HIR access which enables hashing spans for type definitions. r? @nikomatsakis
2017-12-01Auto merge of #46425 - eddyb:mir-place, r=nikomatsakisbors-25/+25
MIR: change "lvalue" terminology to "place". As pointed out elsewhere, "lvalue" vs "rvalue" is a misleading/obscure distinction and several other choices have been proposed, the one I prefer being "place" vs "value". This PR only touches the "lvalue" side, and only in MIR-related code, as it's already a lot and could rot.
2017-12-01MIR: s/lv(al(ue)?)?/place in function/variable/module names.Eduard-Mihai Burtescu-22/+22
2017-12-01MIR: s/Lvalue/Place in type names.Eduard-Mihai Burtescu-4/+4
2017-12-01Auto merge of #46338 - michaelwoerister:lazy-diagnostics, r=nikomatsakisbors-44/+57
incr.comp.: Load cached diagnostics lazily and allow more things in the cache. This PR implements makes two changes: 1. Diagnostics are loaded lazily from the incr. comp. cache now. This turned out to be necessary for correctness because diagnostics contain `Span` values and deserializing those requires that the source file they point to is still around in the current compilation session. Obviously this isn't always the case. Loading them lazily allows for never touching diagnostics that are not valid anymore. 2. The compiler can now deal with there being no cache entry for a given query invocation. Before, all query results of a cacheable query were always expected to be present in the cache. Now, the compiler can fall back to re-computing the result if there is no cache entry found. This allows for caching things that we cannot force from dep-node (like the `symbol_name` query). In such a case we'll just have a "best effort" caching strategy. ~~This PR is based on https://github.com/rust-lang/rust/pull/46301 (=first 2 commits), so please don't merge until that has landed. The rest of the commits are ready for review though.~~ r? @nikomatsakis
2017-12-01Auto merge of #46236 - davidtwco:issue-46023, r=arielb1bors-1/+1
MIR-borrowck: immutable unique closure upvars can be mutated Fixes #46023 and #46160 (see [this comment](https://github.com/rust-lang/rust/pull/46236#issuecomment-347204874)).
2017-12-01incr.comp.: Store Spans as (file,line,col,length) in incr.comp. cache.Michael Woerister-43/+32
The previous method ran into problems because ICH would treat Spans as (file,line,col) but the cache contained byte offsets and its possible for the latter to change while the former stayed stable.
2017-12-01incr.comp.: Properly hash and encode macro expansion information.Michael Woerister-1/+25
2017-12-01Auto merge of #46370 - michaelwoerister:rm-metadata-hashing, r=eddybbors-6/+0
incr.comp.: Remove ability to produce incr. comp. hashes during metadata export. This functionality has been superseded by on-import hashing, which can be less conservative and does not require extra infrastructure. r? @nikomatsakis
2017-11-30Immutable unique closure upvars cannot be mutated.David Wood-1/+1
2017-11-29incr.comp.: Remove on-export crate metadata hashing.Michael Woerister-6/+0
2017-11-29incr.comp.: Remove an unnecessary HIR access which enables hashing spans for ↵Michael Woerister-11/+9
type definitions.
2017-11-28incr.comp.: Make MIR encoding fit for incr.comp. caching.Michael Woerister-3/+3
2017-11-28MIR: split Operand::Consume into Copy and Move.Eduard-Mihai Burtescu-1/+4
2017-11-26make accessing packed fields a future-compat warningAriel Ben-Yehuda-1/+20
2017-11-25Conform namesShotaro Yamada-1/+1
2017-11-24Do match-check before const MIR generationShotaro Yamada-1/+2
2017-11-22Implement in-band lifetime bindingsTaylor Cramer-3/+9
2017-11-21Auto merge of #45879 - nikomatsakis:nll-kill-cyclic-closures, r=arielb1bors-1/+2
move closure kind, signature into `ClosureSubsts` Instead of using side-tables, store the closure-kind and signature in the substitutions themselves. This has two key effects: - It means that the closure's type changes as inference finds out more things, which is very nice. - As a result, it avoids the need for the `freshen_closure_like` code (though we still use it for generators). - It avoids cyclic closures calls. - These were never meant to be supported, precisely because they make a lot of the fancy inference that we do much more complicated. However, due to an oversight, it was previously possible -- if challenging -- to create a setup where a closure *directly* called itself (see e.g. #21410). We have to see what the effect of this change is, though. Needs a crater run. Marking as [WIP] until that has been assessed. r? @arielb1
2017-11-21Auto merge of #45701 - cramertj:impl-trait-this-time, r=eddybbors-1/+6
impl Trait Lifetime Handling This PR implements the updated strategy for handling `impl Trait` lifetimes, as described in [RFC 1951](https://github.com/rust-lang/rfcs/blob/master/text/1951-expand-impl-trait.md) (cc #42183). With this PR, the `impl Trait` desugaring works as follows: ```rust fn foo<T, 'a, 'b, 'c>(...) -> impl Foo<'a, 'b> { ... } // desugars to exists type MyFoo<ParentT, 'parent_a, 'parent_b, 'parent_c, 'a, 'b>: Foo<'a, 'b>; fn foo<T, 'a, 'b, 'c>(...) -> MyFoo<T, 'static, 'static, 'static, 'a, 'b> { ... } ``` All of the in-scope (parent) generics are listed as parent generics of the anonymous type, with parent regions being replaced by `'static`. Parent regions referenced in the `impl Trait` return type are duplicated into the anonymous type's generics and mapped appropriately. One case came up that wasn't specified in the RFC: it's possible to write a return type that contains multiple regions, neither of which outlives the other. In that case, it's not clear what the required lifetime of the output type should be, so we generate an error. There's one remaining FIXME in one of the tests: `-> impl Foo<'a, 'b> + 'c` should be able to outlive both `'a` and `'b`, but not `'c`. Currently, it can't outlive any of them. @nikomatsakis and I have discussed this, and there are some complex interactions here if we ever allow `impl<'a, 'b> SomeTrait for AnonType<'a, 'b> { ... }`, so the plan is to hold off on this until we've got a better idea of what the interactions are here. cc #34511. Fixes #44727.
2017-11-18make `ty::Predicate` carry a `ClosureSubsts`Niko Matsakis-1/+2
2017-11-17Fix impl Trait Lifetime HandlingTaylor Cramer-1/+6
After this change, impl Trait existentials are desugared to a new `abstract type` definition paired with a set of lifetimes to apply. In-scope generics are included as parents of the `abstract type` generics. Parent regions are replaced with static, and parent regions referenced in the `impl Trait` type are duplicated at the end of the `abstract type`'s generics.
2017-11-17Auto merge of #46004 - michaelwoerister:cached-mir-wip-3, r=nikomatsakisbors-1/+19
incr.comp.: Implement query result cache and use it to cache type checking tables. This is a spike implementation of caching more than LLVM IR and object files when doing incremental compilation. At the moment, only the `typeck_tables_of` query is cached but MIR and borrow-check will follow shortly. The feature is activated by running with `-Zincremental-queries` in addition to `-Zincremental`, it is not yet active by default. r? @nikomatsakis
2017-11-16Introduce LocalDefId which provides a type-level guarantee that the DefId is ↵Michael Woerister-1/+19
from the local crate.
2017-11-15Split hir::TyImplTrait, move checks to HIR loweringChristopher Vittal-1/+2
Replace hir::TyImplTrait with TyImplTraitUniversal and TyImplTraitExistential. Add an ImplTraitContext enum to rustc::hir::lowering to track the kind and allowedness of an impl Trait. Significantly alter lowering to thread ImplTraitContext and one other boolean parameter described below throughought much of lowering. The other parameter is for tracking if lowering a function is in a trait impl, as there is not enough information to otherwise know this information during lowering otherwise. This change also removes the checks from ast_ty_to_ty for impl trait allowedness as they are now all taking place in HIR lowering.
2017-11-10Auto merge of #45785 - arielb1:unsafe-fixes, r=eddybbors-0/+1
fixes to MIR effectck r? @eddyb beta-nominating because regression (MIR effectck is new)
2017-11-07incr.comp.: Acknowledge the fact that shift operations can panic at runtime.Michael Woerister-2/+2
2017-11-07incr.comp.: Don't filter out StmtDecls from hir::Block during hashing as ↵Michael Woerister-27/+1
these make a difference for the RegionScopeTree.
2017-11-06collect unused unsafe codeAriel Ben-Yehuda-0/+1
FIXME: de-uglify
2017-11-04Auto merge of #45711 - tirr-c:unicode-span, r=estebankbors-0/+16
Display spans correctly when there are zero-width or wide characters Hopefully... * fixes #45211 * fixes #8706 --- Before: ``` error: invalid width `7` for integer literal --> unicode_2.rs:12:25 | 12 | let _ = ("a̐éö̲", 0u7); | ^^^ | = help: valid widths are 8, 16, 32, 64 and 128 error: invalid width `42` for integer literal --> unicode_2.rs:13:20 | 13 | let _ = ("아あ", 1i42); | ^^^^ | = help: valid widths are 8, 16, 32, 64 and 128 error: aborting due to 2 previous errors ``` After: ``` error: invalid width `7` for integer literal --> unicode_2.rs:12:25 | 12 | let _ = ("a̐éö̲", 0u7); | ^^^ | = help: valid widths are 8, 16, 32, 64 and 128 error: invalid width `42` for integer literal --> unicode_2.rs:13:20 | 13 | let _ = ("아あ", 1i42); | ^^^^ | = help: valid widths are 8, 16, 32, 64 and 128 error: aborting due to 2 previous errors ``` Spans might display incorrectly on the browser. r? @estebank
2017-11-04Auto merge of #45384 - mikhail-m1:mir_add_false_edges_terminator_kind, r=arielb1bors-1/+8
add TerminatorKind::FalseEdges and use it in matches impl #45184 and fixes #45043 right way. False edges unexpectedly affects uninitialized variables analysis in MIR borrowck.
2017-11-03Finish DefaultImpl -> AutoImpl rename.leonardo.yvens-3/+3
Forgot this ones.
2017-11-03add `auto` keyword, parse `auto trait`, lower to HIRleonardo.yvens-1/+5
Adds an `IsAuto` field to `ItemTrait` which flags if the trait was declared as an `auto trait`. Auto traits cannot have generics nor super traits.
2017-11-03[Syntax Breaking] Rename DefaultImpl to AutoImplleonardo.yvens-4/+4
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-11-03Display spans correctly when there are non-half-width charactersWonwoo Choi-0/+16
2017-11-02add TerminatorKind::FalseEdges and use it in matchesMikhail Modin-1/+8
2017-11-02Auto merge of #45468 - Xanewok:crate-source, r=nrcbors-0/+5
Emit crate disambiguators in save-analysis data Needed for https://github.com/nrc/rls-analysis/issues/93. Blocked by https://github.com/nrc/rls-data/pull/11. (For now, this pulls my branch [rls-data/crate-source](https://github.com/Xanewok/rls-data/tree/crate-source)) This will allow to disambiguate different crates types/versions when indexing resulting save-analysis data (most importantly allow to support bin+lib and different crate versions). r? @nrc
2017-11-01Rollup merge of #45602 - petrochenkov:ospan, r=michaelwoeristerkennytm-5/+6
Optimize some span operations Do not decode span data twice/thrice/etc unnecessarily. Applied to stable hashing and all methods in `impl Span`. Follow up to https://github.com/rust-lang/rust/pull/44646 r? @michaelwoerister
2017-10-31Auto merge of #45551 - michaelwoerister:fix-hir-depnodes-and-ich, r=nikomatsakisbors-9/+28
incr.comp.: Fix two problems with HIR hashing. Fixes https://github.com/rust-lang/rust/issues/45469. This PR fixes two small problems: * Overflow checks are always enabled in a constant context, so we need to hash spans of potentially overflowing operations. (Eventually I'd like to handle spans differently so we don't have to make HIR hashing know so much about things like this.) * The HIR map collector had a bug where it would assign the `DepNode::Hir` instead of the corresponding `DepNode::HirBody` in some nested contexts. r? @nikomatsakis
2017-10-29Optimize some span operationsVadim Petrochenkov-5/+6
Decode span data only once
2017-10-27Use rls-data 0.12Igor Matuszewski-0/+5