Skip to content

Commit

Permalink
Do not fetch type to check generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Sep 12, 2023
1 parent 108dece commit d0cba3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/const_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
return;
}

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

0 comments on commit d0cba3d

Please sign in to comment.