about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2017-06-09rustc_typeck: do not mutate tables directly during upvar inference.Eduard-Mihai Burtescu-77/+14
2017-06-09Auto merge of #42504 - michaelwoerister:hash-dep-nodes-prep, r=nikomatsakisbors-5/+3
Some preparatory refactorings for hash-based DepNodes This PR collects some changes that turn out to be necessary for implementing `DepNodes` based on stable hashes (see #42294). The commits are self-contained and mostly straightforward. The most interesting change here is the introduction of `DefIndices` for things that are not part of the AST: Some pieces of crate metadata now have a `DefIndex` too. cc @eddyb r? @nikomatsakis
2017-06-07Fix translation of external spans.Inokentiy Babushkin-4/+8
2017-06-07Allocate DefIndices for global crate metadata.Michael Woerister-5/+3
This allows for treating global crate metadata the same as regular metadata with regard to incr. comp.
2017-06-04Merge branch 'profiling' of github.com:whitequark/rust into profilingMarco Castelluccio-0/+2
2017-06-03Remove 'elided' from lifetime resolution errorStephen Lazaro-1/+1
Removes 'elided' from lifetime resolution errors Removes 'elided' from relevant error messaging tests
2017-06-03Auto merge of #42396 - venkatagiri:remove_lifetime_extn, r=arielb1bors-88/+15
rustc: remove temporary lifetime extension by borrow hint closes #39283. Thanks to @nikomatsakis for mentoring on this one. r? @arielb1
2017-06-03Auto merge of #42332 - michaelwoerister:no-more-retracing, r=nikomatsakisbors-4/+9
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-02rustc: remove temporary lifetime extension by borrow hintVenkata Giri Reddy-88/+15
2017-06-01strip param-env from infcxNiko Matsakis-10/+18
2017-06-01rewrite layout to take a (param-env, ty) pair instead of infcxNiko Matsakis-26/+25
2017-06-01move projection mode into parameter environmentNiko Matsakis-2/+1
2017-06-01Auto merge of #42281 - eddyb:well-adjusted, r=nikomatsakisbors-391/+200
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-01rustc: adjust the RHS of comparison operators instead of assuming autorefs.Eduard-Mihai Burtescu-87/+13
2017-06-01rustc: decompose Adjustment into a vector of adjustment steps.Eduard-Mihai Burtescu-117/+80
2017-06-01rustc: move autoref and unsize from Adjust::DerefRef to Adjustment.Eduard-Mihai Burtescu-22/+16
2017-06-01rustc: replace autoderefs' use of MethodCallee with OverloadedDeref.Eduard-Mihai Burtescu-18/+14
2017-06-01rustc: replace method_map with Def::Method and node_substs entries.Eduard-Mihai Burtescu-12/+11
2017-06-01rustc: avoid using MethodCallee's signature where possible.Eduard-Mihai Burtescu-125/+98
2017-06-01rustc: replace TyFnDef in MethodCallee with just the FnSig.Eduard-Mihai Burtescu-17/+10
2017-06-01rustc: keep overloaded autoderef MethodCallee's in Adjust.Eduard-Mihai Burtescu-94/+60
2017-06-01rustc: remove unused field of mc::Categorization::Deref.Eduard-Mihai Burtescu-28/+27
2017-05-31Build DefPathHash->DefId table when incr.comp. is enabledMichael Woerister-1/+6
2017-05-31Make a newtype for DefPathHash so they are not confused with content hashesMichael Woerister-3/+3
2017-05-30Add new error codeGuillaume Gomez-1/+1
2017-05-28fix RUST_LOG ICE caused by printing a default impl's DefIdAriel Ben-Yehuda-2/+0
2017-05-27Stabilize unions with `Copy` fields and no destructorVadim Petrochenkov-0/+21
2017-05-26Auto merge of #42083 - petrochenkov:safeassign, r=nikomatsakisbors-0/+24
Make assignments to `Copy` union fields safe This is an accompanying PR to PR https://github.com/rust-lang/rust/pull/42068 stabilizing FFI unions. This was first proposed in https://github.com/rust-lang/rust/issues/32836#issuecomment-281296416, see subsequent comments as well. Assignments to `Copy` union fields do not read any data from the union and are [equivalent](https://github.com/rust-lang/rust/issues/32836#issuecomment-281660298) to whole union assignments, which are safe, so they should be safe as well. This removes a significant number of "false positive" unsafe blocks, in code dealing with FFI unions in particular. It desirable to make this change now, together with stabilization of FFI unions, because now it affecfts only unstable code, but later it will cause warnings/errors caused by `unused_unsafe` lint in stable code. cc #32836 r? @nikomatsakis
2017-05-25Use parameter environment associated with field use, not field definitionVadim Petrochenkov-2/+8
2017-05-25Make assignments to `Copy` union fields safeVadim Petrochenkov-0/+18
2017-05-25Hygienize lifetimes.Jeffrey Seyfried-2/+1
2017-05-18Use 128 instead of 64 bits for DefPath hashesMichael Woerister-2/+2
2017-05-14Remove rustc_llvm dependency from rustc_metadataRobin Kruppe-5/+27
Move the code for loading metadata from rlibs and dylibs from rustc_metadata into rustc_trans, and introduce a trait to avoid introducing a direct dependency on rustc_trans. This means rustc_metadata is no longer rebuilt when LLVM changes.
2017-05-13rustc: don't keep a second reference to the HIR map in middle::region.Eduard-Mihai Burtescu-22/+21
2017-05-13rustc: stop interning CodeExtent, it's small enough.Eduard-Mihai Burtescu-144/+104
2017-05-13rustc: remove redundant fn_id's from CodeExtentData.Eduard-Mihai Burtescu-16/+10
2017-05-13rustc: treat ReEarlyBound as free without replacing it with ReFree.Eduard-Mihai Burtescu-55/+64
2017-05-13rustc_typeck: do not leak late-bound lifetimes from bounds to closures.Eduard-Mihai Burtescu-2/+56
2017-05-13rustc: move liberate_late_bound_regions to rustc_typeck.Eduard-Mihai Burtescu-48/+1
2017-05-13rustc: use DefId instead of CodeExtent for FreeRegion's scope.Eduard-Mihai Burtescu-33/+16
2017-05-13rustc: use call_site_extent for closure environment free regions.Eduard-Mihai Burtescu-15/+1
2017-05-13rustc: uniformly compute ParameterEnvironment's "free outlive scope".Eduard-Mihai Burtescu-7/+7
2017-05-13Auto merge of #41847 - alexcrichton:less-unstable-annotations, r=eddybbors-25/+58
rustc: Add a new `-Z force-unstable-if-unmarked` flag This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
2017-05-10rustc: Add a new `-Z force-unstable-if-unmarked` flagAlex Crichton-25/+58
This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
2017-05-09resolved merge conflictsachernyak-111/+109
2017-05-09Auto merge of #41709 - michaelwoerister:close-metadata-ich-holes, r=nikomatsakisbors-1/+29
incr.comp.: Hash more pieces of crate metadata to detect changes there. This PR adds incr. comp. hashes for non-`Entry` pieces of data in crate metadata. The first part of it I like: `EntryBuilder` is refactored into the more generally applicable `IsolatedEncoder` which provides means of encoding something into metadata while also feeding the encoded data into an incr. comp. hash. We already did this for `Entry`, now we are doing it for various other pieces of data too, like the set of exported symbols and so on. The hashes generated there are persisted together with the per-`Entry` hashes and are also used for dep-graph dirtying the same way. The second part of the PR I'm not entirely happy with: In order to make sure that we don't forget registering a read to the new `DepNodes` introduced here, I added the `Tracked<T>` struct. This struct wraps a value and requires a `DepNode` when accessing the wrapped value. This makes it harder to overlook adding read edges in the right places and works just fine. However, crate metadata is already used in places where there is no `tcx` yet or even in places where no `cnum` has been assigned -- this makes it harder to apply this feature consistently or implement it ergonomically. The result is not too bad but there's a bit more code churn and a bit more opportunity to get something wrong than I would have liked. On the other hand, wrapping things in `Tracked<T>` already has revealed some bugs, so there's definitely some value in it. This is still a work in progress: - [x] I need to write some test cases. - [x] Accessing the CodeMap should really be dependency tracked too, especially with the new path-remapping feature. cc @nikomatsakis
2017-05-08Auto merge of #41515 - eddyb:non-static-assoc-const, r=nikomatsakisbors-95/+65
rustc: treat const bodies like fn bodies in middle::region. Allows `T::ASSOC_CONST` to be used without a `T: 'static` bound. cc @rust-lang/compiler @rust-lang/lang
2017-05-08Remove need for &format!(...) or &&"" dances in `span_label` callsOliver Schneider-15/+15
2017-05-08incr.comp.: Hash more pieces of crate metadata to detect changes there.Michael Woerister-1/+29
2017-05-07is_exported_symbolachernyak-2/+0