Skip to content

Commit d0cba3d

Browse files
committed
Do not fetch type to check generator.
1 parent 108dece commit d0cba3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_mir_transform/src/const_prop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
8484
return;
8585
}
8686

87-
let is_generator = tcx.type_of(def_id.to_def_id()).instantiate_identity().is_generator();
8887
// FIXME(welseywiser) const prop doesn't work on generators because of query cycles
8988
// computing their layout.
89+
let is_generator = def_kind == DefKind::Generator;
9090
if is_generator {
9191
trace!("ConstProp skipped for generator {:?}", def_id);
9292
return;

0 commit comments

Comments
 (0)