about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-07-02rename `QueryRegionConstraint` to `QueryOutlivesConstraint`Niko Matsakis-23/+23
2019-07-02enforce and report pick-constraint errorsNiko Matsakis-52/+169
The error message here is not great.
2019-07-02integrate pick constraints into lexical solver more completelyNiko Matsakis-17/+56
2019-07-02rename from "in constraint" to "pick constraint"Niko Matsakis-39/+44
2019-07-02add some tests, currently ICE-ingNiko Matsakis-25/+119
2019-07-02make `dup_vec` optionalNiko Matsakis-13/+20
2019-07-02lexical_region_resolve: rustfmtNiko Matsakis-86/+68
2019-07-02introduce an "in" constraint instead of errorNiko Matsakis-49/+133
2019-07-02introduce `constrain_regions` helperNiko Matsakis-20/+25
2019-07-02opaque_types/mod.rs: rustfmtNiko Matsakis-90/+51
2019-07-02Derive which queries to save using the proc macroJohn Kåre Alsaker-24/+13
2019-07-02Use a single CtxtInternersJohn Kåre Alsaker-136/+28
2019-07-02Auto merge of #61871 - Zoxc:no-lift-branch, r=eddybbors-73/+113
Don't use lift to detect local types This overlaps with https://github.com/rust-lang/rust/pull/61392. r? @eddyb
2019-07-01Enable mem_take feature in relevant cratesChris Gregory-0/+1
2019-07-01Convert more usages overChris Gregory-11/+10
2019-07-01rustc: use a separate copy of P for HIR than for AST.Eduard-Mihai Burtescu-17/+165
2019-07-01rustc: always keep `hir::Path` behind a `P<...>`.Eduard-Mihai Burtescu-4/+4
2019-06-30Keep caching for non-promoted queriesJohn Kåre Alsaker-0/+2
2019-06-30Clean up query cache codeJohn Kåre Alsaker-164/+57
2019-06-29Remove io::Result from syntax::printMark Rousskov-889/+852
Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-06-29Replace pretty-printer Box<dyn Write> with &mut StringMark Rousskov-12/+8
2019-06-29Rollup merge of #62104 - Zoxc:query-info, r=eddybMazdak Farrokhzad-18/+52
Inform the query system about properties of queries at compile time
2019-06-27Rollup merge of #62160 - ia0:question_mark_macro_sep, r=petrochenkovMazdak Farrokhzad-9/+1
Remove outdated question_mark_macro_sep lint
2019-06-27Rollup merge of #62152 - doctorn:async_let_ice, r=cramertjMazdak Farrokhzad-2/+1
Don't ICE on item in `.await` expression The code for lowering a `.await` expression missed that item IDs may already have been assigned for items inside of an `async` block, or for closures. This change means we no longer exit early after finding a `.await` in a block that isn't `async` and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (The `YieldSource` of the generated `yield` expression is used to avoid errors generated about having `yield` expressions outside of generator literals.) r? @cramertj Resolves #62009 and resolves #61685
2019-06-27Add suggestion for missing `.await` keywordNathan Corbyn-0/+1
2019-06-27rename InterpretCx -> InterpCxRalf Jung-1/+1
That's more consistent with InterpResult and InterpError.
2019-06-26Remove outdated question_mark_macro_sep lintJulien Cretin-9/+1
2019-06-26Don't ICE on item in `.await` expressionNathan Corbyn-2/+1
2019-06-26Check for local types in writeback with debug assertionsJohn Kåre Alsaker-0/+4
2019-06-26Don't use lift to detect local typesJohn Kåre Alsaker-73/+109
2019-06-26Auto merge of #62072 - eddyb:generator-memory-index, r=tmandrybors-37/+78
rustc: correctly transform memory_index mappings for generators. Fixes #61793, closes #62011 (previous attempt at fixing #61793). During #60187, I made the mistake of suggesting that the (re-)computation of `memory_index` in `ty::layout`, after generator-specific logic split/recombined fields, be done off of the `offsets` of those fields (which needed to be computed anyway), as opposed to the `memory_index`. `memory_index` maps each field to its in-memory order index, which ranges over the same `0..n` values as the fields themselves, making it a bijective mapping, and more specifically a permutation (indeed, it's the permutation resulting from field reordering optimizations). Each field has an unique "memory index", meaning a sort based on them, even an unstable one, will not put them in the wrong order. But offsets don't have that property, because of ZSTs (which do not increase the offset), so sorting based on the offset of fields alone can (and did) result in wrong orders. Instead of going back to sorting based on (slices/subsets of) `memory_index`, or special-casing ZSTs to make sorting based on offsets produce the right results (presumably), as #62011 does, I opted to drop sorting altogether and focus on `O(n)` operations involving *permutations*: * a permutation is easily inverted (see the `invert_mapping` `fn`) * an `inverse_memory_index` was already employed in other parts of the `ty::layout` code (that is, a mapping from memory order to field indices) * inverting twice produces the original permutation, so you can invert, modify, and invert again, if it's easier to modify the inverse mapping than the direct one * you can modify/remove elements in a permutation, as long as the result remains dense (i.e. using every integer in `0..len`, without gaps) * for splitting a `0..n` permutation into disjoint `0..x` and `x..n` ranges, you can pick the elements based on a `i < x` / `i >= x` predicate, and for the latter, also subtract `x` to compact the range to `0..n-x` * in the general case, for taking an arbitrary subset of the permutation, you need a renumbering from that subset to a dense `0..subset.len()` - but notably, this is still `O(n)`! * you can merge permutations, as long as the result remains disjoint (i.e. each element is unique) * for concatenating two `0..n` and `0..m` permutations, you can renumber the elements in the latter to `n..n+m` * some of these operations can be combined, and an inverse mapping (be it a permutation or not) can still be used instead of a forward one by changing the "domain" of the loop performing the operation I wish I had a nicer / more mathematical description of the recombinations involved, but my focus was to fix the bug (in a way which preserves information more directly than sorting would), so I may have missed potential changes in the surrounding generator layout code, that would make this all more straight-forward. r? @tmandry
2019-06-25Rollup merge of #62096 - spastorino:impl-place-from, r=oli-obk,CentrilMazdak Farrokhzad-0/+12
Implement From<Local> for Place and PlaceBase r? @oli-obk More tiny bits of Place 2.0 moved into master
2019-06-25Rollup merge of #62091 - ljedrz:hiridification_almost_there, r=ZoxcMazdak Farrokhzad-66/+51
HirIdification: almost there I'm beginning to run out of stuff to HirIdify :wink:. This time I targeted mainly `hir::map::{find, get_parent_node}`, but a few other bits got changed too. r? @Zoxc
2019-06-25Rollup merge of #62055 - matthewjasper:fix-error-counting, r=pnkfelixMazdak Farrokhzad-9/+7
Fix error counting Count duplicate errors for `track_errors` and other error counting checks. Add FIXMEs to make it clear that we should be moving away from this kind of logic. Closes #61663
2019-06-25Rollup merge of #61987 - eddyb:hirless-resolver, r=petrochenkovMazdak Farrokhzad-10/+20
rustc: produce AST instead of HIR from `hir::lowering::Resolver` methods. This avoids synthesizing HIR nodes in `rustc_resolve`, and `rustc::hir::lowering` patching up the result after the fact (I suspect this is even more significant for @Zoxc's chages to arena-allocate the HIR). r? @oli-obk
2019-06-25Rollup merge of #61814 - varkor:uninhabited-const-61744, r=oli-obkMazdak Farrokhzad-1/+1
Fix an ICE with uninhabited consts Fixes https://github.com/rust-lang/rust/issues/61744. r? @oli-obk
2019-06-25Implement From<Local> for Place and PlaceBaseSantiago Pastorino-0/+12
2019-06-25rustc: produce AST instead of HIR from `hir::lowering::Resolver` methods.Eduard-Mihai Burtescu-10/+20
2019-06-25rustc: correctly transform memory_index mappings for generators.Eduard-Mihai Burtescu-37/+78
2019-06-25Fix an ICE with uninhabited constsvarkor-1/+1
2019-06-25Inform the query system about properties of queries at compile timeJohn Kåre Alsaker-18/+52
2019-06-25Auto merge of #61572 - Aaron1011:fix/generator-ref, r=varkorbors-2/+108
Fix HIR visit order Fixes #61442 When rustc::middle::region::ScopeTree computes its yield_in_scope field, it relies on the HIR visitor order to properly compute which types must be live across yield points. In order for the computed scopes to agree with the generated MIR, we must ensure that expressions evaluated before a yield point are visited before the 'yield' expression. However, the visitor order for ExprKind::AssignOp was incorrect. The left-hand side of a compund assignment expression is evaluated before the right-hand side, but the right-hand expression was being visited before the left-hand expression. If the left-hand expression caused a new type to be introduced (e.g. through a deref-coercion), the new type would be incorrectly seen as occuring *after* the yield point, instead of before. This leads to a mismatch between the computed generator types and the MIR, since the MIR will correctly see the type as being live across the yield point. To fix this, we correct the visitor order for ExprKind::AssignOp to reflect the actual evaulation order.
2019-06-24Auto merge of #62081 - RalfJung:miri-pointer-checks, r=oli-obkbors-88/+78
Refactor miri pointer checks Centralize bounds, alignment and NULL checking for memory accesses in one function: `memory.check_ptr_access`. That function also takes care of converting a `Scalar` to a `Pointer`, should that be needed. Not all accesses need that though: if the access has size 0, `None` is returned. Everyone accessing memory based on a `Scalar` should use this method to get the `Pointer` they need. All operations on the `Allocation` work on `Pointer` inputs and expect all the checks to have happened (and will ICE if the bounds are violated). The operations on `Memory` work on `Scalar` inputs and do the checks themselves. The only other public method to check pointers is `memory.ptr_may_be_null`, which is needed in a few places. No need for `check_align` or similar methods. That makes the public API surface much easier to use and harder to mis-use. This should be largely no-functional-change, except that ZST accesses to a "true" pointer that is dangling or out-of-bounds are now considered UB. This is to be conservative wrt. whatever LLVM might be doing. While I am at it, this also removes the assumption that the vtable part of a `dyn Trait`-fat-pointer is a `Pointer` (as opposed to a pointer cast to an integer, stored as raw bits). r? @oli-obk
2019-06-24Allow usage_of_ty_tykind only in styflip1995-19/+27
and in some special cases
2019-06-24fix reoccurring typoRalf Jung-10/+10
2019-06-24Turn internal lints into tool lintsflip1995-14/+14
2019-06-24Allow default_hash_types in some cratesflip1995-1/+1
2019-06-24Enable internal lints in bootstrapflip1995-1/+0
2019-06-24Only allow {declare,impl}_lint_pass macros for implementing LintPassflip1995-10/+24
2019-06-24Implement initernal lint LINT_PASS_IMPL_WITHOUT_MACROflip1995-17/+35