diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2017-02-17 13:38:42 +0100 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2017-06-12 13:06:42 +0200 |
| commit | 1d315cf7da85911dfa239331fab30607ce2d1dce (patch) | |
| tree | edd5fdd2b0ac1704287b87ebfa155c499b3d7e64 /src/librustc/ich | |
| parent | 7c0c4cde80ef871858d5e9dcef506157fcdcc21c (diff) | |
| download | rust-1d315cf7da85911dfa239331fab30607ce2d1dce.tar.gz rust-1d315cf7da85911dfa239331fab30607ce2d1dce.zip | |
Add `EndRegion` statement kind to MIR.
* Emit `EndRegion` for every code-extent for which we observe a borrow. To do this, we needed to thread source info back through to `fn in_scope`, which makes this commit a bit more painful than one might have expected. * There is `end_region` emission in `Builder::pop_scope` and in `Builder::exit_scope`; the first handles falling out of a scope normally, the second handles e.g. `break`. * Remove `EndRegion` statements during the erase_regions mir transformation. * Preallocate the terminator block, and throw an `Unreachable` marker on it from the outset. Then overwrite that Terminator as necessary on demand. * Instead of marking the scope as needs_cleanup after seeing a borrow, just treat every scope in the chain as being part of the diverge_block (after any *one* of them has separately signalled that it needs cleanup, e.g. due to having a destructor to run). * Allow for resume terminators to be patched when looking up drop flags. (In particular, `MirPatch::new` has an explicit code path, presumably previously unreachable, that patches up such resume terminators.) * Make `Scope` implement `Debug` trait. * Expanded a stray comment: we do not emit StorageDead on diverging paths, but that end behavior might not be desirable.
Diffstat (limited to 'src/librustc/ich')
| -rw-r--r-- | src/librustc/ich/impls_mir.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc/ich/impls_mir.rs b/src/librustc/ich/impls_mir.rs index ae2bea3027d..cb017b7f886 100644 --- a/src/librustc/ich/impls_mir.rs +++ b/src/librustc/ich/impls_mir.rs @@ -226,6 +226,9 @@ for mir::StatementKind<'tcx> { mir::StatementKind::StorageDead(ref lvalue) => { lvalue.hash_stable(hcx, hasher); } + mir::StatementKind::EndRegion(ref extents) => { + extents.hash_stable(hcx, hasher); + } mir::StatementKind::Nop => {} mir::StatementKind::InlineAsm { ref asm, ref outputs, ref inputs } => { asm.hash_stable(hcx, hasher); |
