about summary refs log tree commit diff
path: root/src/librustc_mir
AgeCommit message (Collapse)AuthorLines
2020-02-19Reorder yield visitation order to match callJonas Schievink-1/+1
2020-02-19Handle resume args in `RequiresStorage` analysisJonas Schievink-11/+46
2020-02-19Use match ergonomics to simplify matchJonas Schievink-5/+5
2020-02-19Match MIR statements exhaustivelyJonas Schievink-1/+8
2020-02-19Make lookup of associated item by name O(log n)Dylan MacKenzie-2/+2
2020-02-19Rollup merge of #69280 - ecstatic-morse:promote-shuffle-no-special-case, ↵Dylan DPC-21/+7
r=petrochenkov Remove special case for `simd_shuffle` arg promotion After rust-lang/stdarch#825, these intrinsics are now defined with `#[rustc_args_required_const(2)]`, so the special-case is no longer necessary.
2020-02-18Remove mention of `simd_shuffle` promotion from commentsDylan MacKenzie-9/+7
2020-02-18Remove special case for `simd_shuffle` arg promotionDylan MacKenzie-12/+0
After rust-lang/stdarch#825, these intrinsics are now defined with `#[rustc_args_required_const(2)]`, so the special-case is no longer necessary.
2020-02-18Prevent const trait methods from being marked stableDylan MacKenzie-0/+8
2020-02-18Make `fn_queries` helpers module-privateDylan MacKenzie-75/+74
2020-02-18Remove outdated FIXMEDylan MacKenzie-2/+0
2020-02-18Check for trait methods on concrete types in const checkingDylan MacKenzie-3/+17
2020-02-19Auto merge of #69113 - ecstatic-morse:unified-dataflow-borrowed, r=wesleywiserbors-278/+297
Combine `HaveBeenBorrowedLocals` and `IndirectlyMutableLocals` into one dataflow analysis This PR began as an attempt to port `HaveBeenBorrowedLocals` to the new dataflow framework (see #68241 for prior art). Along the way, I noticed that it could share most of its code with `IndirectlyMutableLocals` and then found a few bugs in the two analyses: - Neither one marked locals as borrowed after an `Rvalue::AddressOf`. - `IndirectlyMutableLocals` was missing a minor fix that `HaveBeenBorrowedLocals` got in #61069. This is not a problem today since it is only used during const-checking, where custom drop glue is forbidden. However, this may change some day. I decided to combine the two analyses so that they wouldn't diverge in the future while ensuring that they remain distinct types (called `MaybeBorrowedLocals` and `MaybeMutBorrowedLocals` to be consistent with the `Maybe{Un,}InitializedPlaces` naming scheme). I fixed the bugs and switched to exhaustive matching where possible to make them less likely in the future. Finally, I added comments explaining some of the finer points of the transfer function for these analyses (see #61069 and #65006).
2020-02-18Const-check functions in a `const` implDylan MacKenzie-1/+14
2020-02-18Add `is_const_impl_raw` queryDylan MacKenzie-1/+15
2020-02-18better lint namesRalf Jung-4/+4
2020-02-18Rollup merge of #69146 - matthewjasper:literal-qualif, r=eddybMazdak Farrokhzad-17/+8
Always const qualify literals by type r? @eddyb
2020-02-18Rollup merge of #69181 - skinny121:const-eval-return, r=oli-obkDylan DPC-51/+50
Change const eval to just return the value As discussed in https://github.com/rust-lang/rust/pull/68505#discussion_r370956535, the type of consts shouldn't be returned from const eval queries. r? @eddyb cc @nikomatsakis
2020-02-18more English grammarRalf Jung-4/+4
2020-02-18miri value visitor: fix some wrong assumptions about layout; improve error ↵Ralf Jung-157/+151
messages
2020-02-17Fix typo in commentDylan MacKenzie-1/+1
2020-02-17Use doc comment for explanation of `shared_borrow_allows_mutation`Dylan MacKenzie-9/+9
2020-02-17Rollup merge of #69179 - JohnTitor:rename-to-fnretty, r=CentrilYuki Okushi-3/+3
Rename `FunctionRetTy` to `FnRetTy` As per FIXME comment r? @Centril
2020-02-17Rollup merge of #69158 - ecstatic-morse:graphviz-diff, r=matthewjasperYuki Okushi-20/+35
Don't print block exit state in dataflow graphviz if unchanged A small quality-of-life improvement I was using while working on #68528. It's pretty common to have a lot of zero-statement basic blocks, especially before a `SimplifyCfg` pass is run. When the dataflow state was dense, these blocks could take up a lot of vertical space since the full flow state was printed on both entry and exit. After this PR, we only print a block's exit state if it differs from that block's entry state. Take a look at the two basic blocks on the left. Before: ![image](https://user-images.githubusercontent.com/29463364/74505395-e2d1dd00-4eab-11ea-8006-ec8f0dc9d1b6.png) After: ![image](https://user-images.githubusercontent.com/29463364/74505277-98506080-4eab-11ea-8d95-5190bc378331.png)
2020-02-17Rename `FunctionRetTy` to `FnRetTy`Yuki Okushi-3/+3
2020-02-16Clarify mir block mergingMarkus Westerlind-1/+5
2020-02-16Make librustc_mir compile.Camille GILLOT-47/+50
2020-02-16Make librustc_infer compile.Camille GILLOT-0/+1
2020-02-16Auto merge of #69156 - ecstatic-morse:unified-dataflow-impls2, r=eddybbors-83/+41
Use `ResultsCursor` for `elaborate_drops` Some cleanup after #68241. The old code was using a custom cursor-like struct called `InitializationData`.
2020-02-16Determine type of intrinsics instead of assuming the destination type is the ↵Ben Lewis-1/+8
same.
2020-02-16Code review changes.Ben Lewis-2/+2
2020-02-15Tighter type bounds for messagesRalf Jung-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-02-15Always qualify literals by typeMatthew Jasper-17/+8
2020-02-15fix exceeding_bitshift lint and testRalf Jung-5/+7
2020-02-15Rollup merge of #69166 - JohnTitor:ice-const-enum, r=matthewjasperDylan DPC-1/+4
Check `has_typeck_tables` before calling `typeck_tables_of` Fixes #68684 r? @matthewjasper
2020-02-15Auto merge of #67681 - matthewjasper:infer-regions-in-borrowck, r=nikomatsakisbors-144/+446
Infer regions for opaque types in borrowck This is a step towards the goal of typeck not doing region inference. The commits up to `Arena allocate the result of mir_borrowck` are various bug fixes and prerequisites. The remaining commits move opaque type inference to borrow checking. r? @nikomatsakis
2020-02-15Fix emulate intrinsics return type.Ben Lewis-2/+1
2020-02-15Change `const_field` and `const_caller_location` to return `ConstValue` ↵Ben Lewis-11/+4
instead of `Const` as the type in the returned const isn't needed.
2020-02-15Change const eval to return `ConstValue`, instead of `Const` as the type ↵Ben Lewis-43/+43
inside it shouldn't be used.
2020-02-14Add fast path to eq_opaque_type_and_typeMatthew Jasper-0/+16
2020-02-14Fix and test nested impl TraitMatthew Jasper-5/+13
2020-02-14Use member constraint for most opaque types in NLLMatthew Jasper-0/+2
This ensures that NLL will infer suitable values for regions in opaque types when it's possible.
2020-02-14Always check upper bounds when choosing member regionsMatthew Jasper-40/+81
Also correctly calculate what the upper bounds are.
2020-02-14Improve opaque type lifetime errorsMatthew Jasper-14/+36
* Use better span for member constraint errors * Avoid a bad suggestion * Don't report member constraint errors if we have other universal region errors.
2020-02-14Handle equal regions in opaque type inferenceMatthew Jasper-18/+70
2020-02-14Show inferred opaque types with `#[rustc_regions]`Matthew Jasper-5/+29
2020-02-14Address review commentsMatthew Jasper-18/+2
2020-02-14Ensure RPIT types get recorded in borrowckMatthew Jasper-7/+27
2020-02-14Avoid unnecessary opaque type errors in borrowckMatthew Jasper-0/+8
2020-02-14Infer opaque type regions in borrow checkingMatthew Jasper-3/+83
We want type checking for function bodies to ignore/erase regions. As such, we need to infer the regions in opaque types in borrow check instead.