Rollup merge of #60991 - spastorino:local-decls-push, r=oli-obk

LocalDecl push returns Local len

r? @oli-obk
This commit is contained in:
Mazdak Farrokhzad 2019-05-22 03:47:37 +02:00 committed by GitHub
commit 705b040ea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,8 +212,8 @@ fn set_discr(&self, state_disc: VariantIdx, source_info: SourceInfo) -> Statemen
// Create a statement which reads the discriminant into a temporary
fn get_discr(&self, mir: &mut Mir<'tcx>) -> (Statement<'tcx>, Place<'tcx>) {
let temp_decl = LocalDecl::new_internal(self.tcx.types.isize, mir.span);
let temp = Place::Base(PlaceBase::Local(Local::new(mir.local_decls.len())));
mir.local_decls.push(temp_decl);
let local_decls_len = mir.local_decls.push(temp_decl);
let temp = Place::Base(PlaceBase::Local(local_decls_len));
let self_place = Place::Base(PlaceBase::Local(self_arg()));
let assign = Statement {