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:
CleanEndRegions
, that reduces the set ofEndRegion
statements in the MIR.CleanUserAssertTy
, that replaces allUserAssertTy
statements withNop
.
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.
Structs
CleanEndRegions |
[ Experimental ]
|
CleanUserAssertTy |
[ Experimental ]
|
DeleteTrivialEndRegions |
[ Experimental ]
|
DeleteUserAssertTy |
[ Experimental ]
|
GatherBorrowedRegions |
[ Experimental ]
|