Avoid cloning LocalDecls
This commit is contained in:
parent
5998c2e9ad
commit
7bcc9ae422
2 changed files with 6 additions and 7 deletions
|
@ -427,6 +427,11 @@ impl<'tcx> Body<'tcx> {
|
|||
(arg_count + 1..local_count).map(Local::new)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn drain_vars_and_temps<'a>(&'a mut self) -> impl Iterator<Item = LocalDecl<'tcx>> + 'a {
|
||||
self.local_decls.drain(self.arg_count + 1..)
|
||||
}
|
||||
|
||||
/// Changes a statement to a nop. This is both faster than deleting instructions and avoids
|
||||
/// invalidating statement indices in `Location`s.
|
||||
pub fn make_statement_nop(&mut self, location: Location) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue