Skip to content

Commit

Permalink
rename to make push clearer
Browse files Browse the repository at this point in the history
addresses previous concern
  • Loading branch information
nikomatsakis committed Feb 6, 2024
1 parent a57a94f commit aea1c01
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/type_system/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl Env {
Ok(())
}

pub fn with_in_flight_stored_to_fresh_variable(&self, ty: impl Upcast<Ty>) -> (Self, Var) {
pub fn push_fresh_variable_with_in_flight(&self, ty: impl Upcast<Ty>) -> (Self, Var) {
let (mut env, var) = self.push_fresh_variable(ty);
env = env.with_in_flight_stored_to(&var);
(env, var)
Expand Down
4 changes: 2 additions & 2 deletions src/type_system/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ judgment_fn! {
(
// Start by typing the `this` expression, store into `@temp(0)`
(type_expr(env, flow, live_after.before(&exprs), &*receiver) => (env, flow, receiver_ty))
(let (env, this_var) = env.with_in_flight_stored_to_fresh_variable(&receiver_ty))
(let (env, this_var) = env.push_fresh_variable_with_in_flight(&receiver_ty))

// Use receiver type to look up the method
(resolve_method(&env, &receiver_ty, &method_name, &parameters) => (this_input_ty, inputs, output, predicates))
Expand Down Expand Up @@ -308,7 +308,7 @@ judgment_fn! {
(
// Type the expression and then move `@in_flight` to `@input_temp`
(type_expr(env, flow, live_after.before(&exprs), expr) => (env, flow, expr_ty))
(let (env, input_temp) = env.with_in_flight_stored_to_fresh_variable(&expr_ty))
(let (env, input_temp) = env.push_fresh_variable_with_in_flight(&expr_ty))
(let () = tracing::debug!("type_method_arguments_as: expr_ty = {:?} input_temp = {:?} env = {:?}", expr_ty, input_temp, env))

// The expression type must be a subtype of the field type
Expand Down
4 changes: 2 additions & 2 deletions src/type_system/statements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ judgment_fn! {

(
(type_expr(env, flow, &live_after, expr) => (env, flow, ty))
(let (env, temp) = env.with_in_flight_stored_to_fresh_variable(&ty))
(let (env, temp) = env.push_fresh_variable_with_in_flight(&ty))
(env_permits_access(env, flow, &live_after, Access::Drop, &temp) => (env, flow))
(parameter_permits_access(env, flow, &ty, Access::Drop, &temp) => (env, flow))
(let env = env.pop_fresh_variable(&temp))
Expand Down Expand Up @@ -90,7 +90,7 @@ judgment_fn! {
// FIXME: should be live_after.without(place) -- or at least if place is just a variable
(place_ty(&env, &place) => ty)
(type_expr_as(&env, &flow, &live_after, &expr, &ty) => (env, flow))
(let (env, temp) = env.with_in_flight_stored_to_fresh_variable(&ty))
(let (env, temp) = env.push_fresh_variable_with_in_flight(&ty))
(env_permits_access(env, flow, &live_after, Access::Lease, &place) => (env, flow))
(let flow = flow.assign_place(&place))
(let env = env.with_var_stored_to(&temp, &place))
Expand Down

0 comments on commit aea1c01

Please sign in to comment.