Skip to content

Commit 89aac16

Browse files
committed
fix discriminant type in generator transform
1 parent 75b0a68 commit 89aac16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/transform/generator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ impl TransformVisitor<'tcx> {
266266

267267
// Create a statement which reads the discriminant into a temporary
268268
fn get_discr(&self, body: &mut Body<'tcx>) -> (Statement<'tcx>, Place<'tcx>) {
269-
let temp_decl = LocalDecl::new(self.tcx.types.isize, body.span).internal();
269+
let temp_decl = LocalDecl::new(self.discr_ty, body.span).internal();
270270
let local_decls_len = body.local_decls.push(temp_decl);
271271
let temp = Place::from(local_decls_len);
272272

0 commit comments

Comments
 (0)