Skip to content

Commit

Permalink
Fix clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yannham committed Oct 10, 2023
1 parent d2fcea3 commit 7d2622c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/typ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -966,9 +966,9 @@ impl Type {
var_kind: VarKind::Type,
body,
} if polarity == Polarity::Positive => {
let mut env = vars_elide.clone();
env.insert(var);
let result = optimize(*body, &env, polarity);
let mut var_owned = vars_elide.clone();
var_owned.insert(var);
let result = optimize(*body, &var_owned, polarity);
// we keep the position of the body, not the one of the forall
pos = result.pos;
result.typ
Expand All @@ -980,7 +980,7 @@ impl Type {
} => TypeF::Forall {
var,
var_kind,
body: Box::new(optimize(*body, &vars_elide, polarity)),
body: Box::new(optimize(*body, vars_elide, polarity)),
},
TypeF::Var(id) if vars_elide.contains(&id) => TypeF::Dyn,
v @ TypeF::Var(_) => v,
Expand Down

0 comments on commit 7d2622c

Please sign in to comment.