Remove obsolete comments

This commit is contained in:
Ayaz Hafiz 2023-02-13 10:54:05 -06:00
parent a22dcb5784
commit 2903ec4ac2
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -4314,101 +4314,6 @@ pub fn with_hole<'a>(
hole,
assigned,
)
// let mut field_symbols = Vec::with_capacity_in(fields.len(), env.arena);
// let mut can_fields = Vec::with_capacity_in(fields.len(), env.arena);
// #[allow(clippy::enum_variant_names)]
// enum Field {
// // TODO: rename this since it can handle unspecialized expressions now too
// FunctionOrUnspecialized(Symbol, Variable),
// ValueSymbol,
// Field(roc_can::expr::Field),
// }
// for (label, variable, _) in sorted_fields.into_iter() {
// // TODO how should function pointers be handled here?
// use ReuseSymbol::*;
// match fields.remove(&label) {
// Some(field) => {
// match can_reuse_symbol(env, procs, &field.loc_expr.value, field.var) {
// Imported(symbol)
// | LocalFunction(symbol)
// | UnspecializedExpr(symbol) => {
// field_symbols.push(symbol);
// can_fields.push(Field::FunctionOrUnspecialized(symbol, variable));
// }
// Value(symbol) => {
// let reusable = procs.get_or_insert_symbol_specialization(
// env,
// layout_cache,
// symbol,
// field.var,
// );
// field_symbols.push(reusable);
// can_fields.push(Field::ValueSymbol);
// }
// NotASymbol => {
// field_symbols.push(env.unique_symbol());
// can_fields.push(Field::Field(field));
// }
// }
// }
// None => {
// // this field was optional, but not given
// continue;
// }
// }
// }
// // creating a record from the var will unpack it if it's just a single field.
// let layout = match layout_cache.from_var(env.arena, record_var, env.subs) {
// Ok(layout) => layout,
// Err(_) => return runtime_error(env, "Can't create record with improper layout"),
// };
// let field_symbols = field_symbols.into_bump_slice();
// let mut stmt = if let [only_field] = field_symbols {
// let mut hole = hole.clone();
// substitute_in_exprs(env.arena, &mut hole, assigned, *only_field);
// hole
// } else {
// Stmt::Let(assigned, Expr::Struct(field_symbols), layout, hole)
// };
// for (opt_field, symbol) in can_fields.into_iter().rev().zip(field_symbols.iter().rev())
// {
// match opt_field {
// Field::ValueSymbol => {
// // this symbol is already defined; nothing to do
// }
// Field::FunctionOrUnspecialized(symbol, variable) => {
// stmt = specialize_symbol(
// env,
// procs,
// layout_cache,
// Some(variable),
// symbol,
// env.arena.alloc(stmt),
// symbol,
// );
// }
// Field::Field(field) => {
// stmt = with_hole(
// env,
// field.loc_expr.value,
// field.var,
// procs,
// layout_cache,
// *symbol,
// env.arena.alloc(stmt),
// );
// }
// }
// }
// stmt
}
EmptyRecord => let_empty_struct(assigned, hole),