about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir
AgeCommit message (Collapse)AuthorLines
2022-07-20add a Vtable kind of symbolic allocationsRalf Jung-4/+42
2022-07-20Auto merge of #99472 - RalfJung:provenance, r=oli-obkbors-106/+108
interpret: rename Tag/PointerTag to Prov/Provenance We were pretty inconsistent with calling this the "tag" vs the "provenance" of the pointer; I think we should consistently call it "provenance". r? `@oli-obk`
2022-07-20Remove unused StableMap and StableSet types from rustc_data_structuresMichael Woerister-2/+2
2022-07-20Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank"Oli Scherer-24/+3
This reverts commit 6f8fb911ad504b77549cf3256a09465621beab9d, reversing changes made to 7210e46dc69a4b197a313d093fe145722c248b7d.
2022-07-19interpret: rename Tag/PointerTag to Prov/ProvenanceRalf Jung-106/+108
Let's avoid using two different terms for the same thing -- let's just call it "provenance" everywhere. In Miri, provenance consists of an AllocId and an SbTag (Stacked Borrows tag), which made this even more confusing.
2022-07-19Use LocalDefId in OpaqueTypeKeyMichael Goulet-1/+1
2022-07-15Introduce opaque type to hidden type projectionOli Scherer-3/+24
2022-07-15Auto merge of #99013 - RalfJung:dont-poison-my-places, r=oli-obkbors-0/+2
interpret: get rid of MemPlaceMeta::Poison This is achieved by refactoring the projection code (`{mplace,place,operand}_{downcast,field,index,...}`) so that we no longer need to call `assert_mem_place` in the operand handling.
2022-07-14Auto merge of #98975 - jyn514:unstable_opts, r=wesleywiserbors-14/+14
Rename `debugging_opts` to `unstable_opts` This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear. cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Codegen.20options.20.2F.20debugging.20options r? `@Amanieu` cc `@nikic` `@joshtriplett`
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-14/+14
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-13assigning to a union field can never drop nowRalf Jung-6/+0
2022-07-13Auto merge of #98145 - ouz-a:some_branch, r=oli-obkbors-4/+39
Pull Derefer before ElaborateDrops _Follow up work to #97025 #96549 #96116 #95887 #95649_ This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`. r? `@oli-obk`
2022-07-13get rid of MemPlaceMeta::PoisonRalf Jung-0/+2
MPlaceTy::dangling still exists, but now it is only called in places that actually conceptually allocate something new, so that's fine.
2022-07-12add new rval, pull deref earlyouz-a-4/+39
2022-07-11use PlaceRef::iter_projections to fix old FIXMERose Hudson-5/+3
I added this function in 53481a5a8fde83ed1a5d7e8302be028a4c7d8da5
2022-07-10Rollup merge of #99103 - TaKO8Ki:avoid-&str-to-string-conversions, r=oli-obkMatthias Krüger-5/+3
Avoid some `&str` to `String` conversions This patch removes some `&str` to `String` conversions.
2022-07-10avoid some `&str` to `String` conversionsTakayuki Maeda-5/+3
2022-07-09Auto merge of #98957 - RalfJung:zst-are-different, r=lcnr,oli-obkbors-10/+18
don't allow ZST in ScalarInt There are several indications that we should not ZST as a ScalarInt: - We had two ways to have ZST valtrees, either an empty `Branch` or a `Leaf` with a ZST in it. `ValTree::zst()` used the former, but the latter could possibly arise as well. - Likewise, the interpreter had `Immediate::Uninit` and `Immediate::Scalar(Scalar::ZST)`. - LLVM codegen already had to special-case ZST ScalarInt. So I propose we stop using ScalarInt to represent ZST (which are clearly not integers). Instead, we can add new ZST variants to those types that did not have other variants which could be used for this purpose. Based on https://github.com/rust-lang/rust/pull/98831. Only the commits starting from "don't allow ZST in ScalarInt" are new. r? `@oli-obk`
2022-07-09tweak names and output and blessRalf Jung-7/+15
2022-07-09review feedbackRalf Jung-7/+7
2022-07-09don't allow ZST in ScalarIntRalf Jung-10/+10
There are several indications that we should not ZST as a ScalarInt: - We had two ways to have ZST valtrees, either an empty `Branch` or a `Leaf` with a ZST in it. `ValTree::zst()` used the former, but the latter could possibly arise as well. - Likewise, the interpreter had `Immediate::Uninit` and `Immediate::Scalar(Scalar::ZST)`. - LLVM codegen already had to special-case ZST ScalarInt. So instead add new ZST variants to those types that did not have other variants which could be used for this purpose.
2022-07-09Rollup merge of #99050 - JakobDegen:storage-docs, r=tmiaskoMatthias Krüger-13/+13
Clarify MIR semantics of storage statements Seems worthwhile to start closing out some of the less controversial open questions about MIR semantics. Hopefully this is fairly non-controversial - it's what we implement already, and I see no reason to do anything more restrictive. cc ``@tmiasko`` who commented on this when it was discussed in the original PR that added these docs.
2022-07-08Clarify MIR semantics of storage statementsJakob Degen-13/+13
2022-07-08Add `SourceScope::inlined_instance`Tomasz Miąsko-0/+16
2022-07-08Rollup merge of #99019 - pierwill:doc-mir-statement, r=cjgillotMatthias Krüger-1/+4
Add doc comments in `rustc_middle::mir`
2022-07-07Rollup merge of #98979 - RalfJung:more-alloc-range, r=oli-obkMatthias Krüger-60/+51
interpret: use AllocRange in UninitByteAccess also use nice new format string syntax in `interpret/error.rs`, and use the `#` flag to add `0x` prefixes where applicable. r? ``@oli-obk``
2022-07-07Add doc comments in `rustc_middle::mir`pierwill-1/+4
2022-07-07Move `dominators` from Body to BasicBlocksTomasz Miąsko-6/+7
2022-07-07Move `switch_sources` from Body to BasicBlocksTomasz Miąsko-8/+0
2022-07-07Move `predecessors` from Body to BasicBlocksTomasz Miąsko-7/+1
2022-07-07Move `is_cfg_cyclic` from Body to BasicBlocksTomasz Miąsko-6/+0
2022-07-07Make MIR basic blocks field publicTomasz Miąsko-154/+169
This makes it possible to mutably borrow different fields of the MIR body without resorting to methods like `basic_blocks_local_decls_mut_and_var_debug_info`. To preserve validity of control flow graph caches in the presence of modifications, a new struct `BasicBlocks` wraps together basic blocks and control flow graph caches. The `BasicBlocks` dereferences to `IndexVec<BasicBlock, BasicBlockData>`. On the other hand a mutable access requires explicit `as_mut()` call.
2022-07-06Rollup merge of #98984 - pierwill:patch-4, r=RalfJungGuillaume Gomez-1/+1
Remove erroneous doc comment Fixes the formatting issue shown here: <img width="803" alt="Screen Shot 2022-07-06 at 12 50 56 PM" src="https://user-images.githubusercontent.com/19642016/177612734-2d881c6a-2850-4c1b-8f1a-08339ad5bfbc.png">
2022-07-06Remove erroneous doc commentpierwill-1/+1
2022-07-06docs: Add overview of `rustc_middle::mir::TerminatorKind`pierwill-0/+2
2022-07-06interpret: use AllocRange in UninitByteAccessRalf Jung-60/+51
also use nice new format string syntax in interpret/error.rs
2022-07-06Auto merge of #98206 - eggyal:align-to-chalk-folding-api, r=jackh726bors-194/+227
Split TypeVisitable from TypeFoldable Impl of rust-lang/compiler-team#520 following MCP approval. r? `@ghost`
2022-07-06Update TypeVisitor pathsAlan Egerton-3/+3
2022-07-05Explicit TypeVisitable implementationsAlan Egerton-152/+190
2022-07-05impl TypeVisitable in type traversal macrosAlan Egerton-8/+8
2022-07-05Add #[derive(TypeVisitable)]Alan Egerton-32/+27
2022-07-05Rollup merge of #98888 - RalfJung:interpret-checked-bin, r=oli-obkMatthias Krüger-2/+3
interpret: fix CheckedBinOp behavior when overflow checking is disabled Adjusts the interpreter to https://github.com/rust-lang/rust/pull/98738. r? `@oli-obk`
2022-07-05adjust dangling-int-ptr error messageRalf Jung-12/+25
2022-07-05always check overflow in CheckedBinOp in CTFERalf Jung-2/+3
2022-07-05Auto merge of #98910 - Dylan-DPC:rollup-9x82wdg, r=Dylan-DPCbors-27/+23
Rollup of 6 pull requests Successful merges: - #97300 (Implement `FusedIterator` for `std::net::[Into]Incoming`) - #98761 (more `need_type_info` improvements) - #98811 (Interpret: AllocRange Debug impl, and use it more consistently) - #98847 (fix interpreter validity check on Box) - #98854 (clean up the borrowing in rustc_hir_pretty) - #98873 (Suggest `#[derive(Default)]` to enums with `#[default]`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-05Rollup merge of #98811 - RalfJung:interpret-alloc-range, r=oli-obkDylan DPC-27/+23
Interpret: AllocRange Debug impl, and use it more consistently The two commits are pretty independent but it did not seem worth having two PRs for them. r? ``@oli-obk``
2022-07-05Auto merge of #98872 - JakobDegen:no-invalidate, r=davidtwcobors-9/+35
Add method to mutate MIR body without invalidating CFG caches. In addition to adding this method, a handful of passes are updated to use it. There's still quite a few passes that could in principle make use of this as well, but do not at the moment because they use `VisitorMut` or `MirPatch`, which needs additional support for this. The method name is slightly unwieldy, but I don't expect anyone to be writing it a lot, and at least it says what it does. If anyone has a suggestion for a better name though, would be happy to rename. r? rust-lang/mir-opt
2022-07-04Rollup merge of #98878 - lcnr:more-rustc_pass_by_value, r=oli-obkMatthias Krüger-13/+13
add more `rustc_pass_by_value` r? ```@oli-obk``` cc #98766
2022-07-04Rollup merge of #98738 - tmiasko:checked-binop, r=oli-obkMatthias Krüger-4/+12
Clarify MIR semantics of checked binary operations
2022-07-04more `rustc_pass_by_value`lcnr-13/+13