Module rustc_mir::transform::cleanup_post_borrowck[][src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

This module provides two passes:

The CleanEndRegions "pass" is actually implemented as two traversals (aka visits) of the input MIR. The first traversal, GatherBorrowedRegions, finds all of the regions in the MIR that are involved in a borrow.

The second traversal, DeleteTrivialEndRegions, walks over the MIR and removes any EndRegion that is applied to a region that was not seen in the previous pass.

The CleanUserAssertTy pass runs at a distinct time from the CleanEndRegions pass. It is important that the CleanUserAssertTy pass runs after the MIR borrowck so that the NLL type checker can perform the type assertion when it encounters the UserAssertTy statements.

Re-exports

use rustc_data_structures::fx::FxHashSet;
use rustc::middle::region;
use rustc::mir::BasicBlock;
use rustc::mir::Location;
use rustc::mir::Mir;
use rustc::mir::Rvalue;
use rustc::mir::Statement;
use rustc::mir::StatementKind;
use rustc::mir::visit::MutVisitor;
use rustc::mir::visit::Visitor;
use rustc::mir::visit::TyContext;
use rustc::ty::Ty;
use rustc::ty::RegionKind;
use rustc::ty::TyCtxt;
use transform::MirPass;
use transform::MirSource;

Structs

CleanEndRegions [
Experimental
]
CleanUserAssertTy [
Experimental
]
DeleteTrivialEndRegions [
Experimental
]
DeleteUserAssertTy [
Experimental
]
GatherBorrowedRegions [
Experimental
]