mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
fix extra ampersands
This commit is contained in:
parent
b6116eeb98
commit
899cbeabd7
79 changed files with 372 additions and 376 deletions
|
@ -1108,7 +1108,7 @@ fn expr_spec<'a>(
|
|||
let index = (*index) as u32;
|
||||
let tag_value_id = env.symbols[structure];
|
||||
|
||||
let type_name_bytes = recursive_tag_union_name_bytes(&union_layout).as_bytes();
|
||||
let type_name_bytes = recursive_tag_union_name_bytes(union_layout).as_bytes();
|
||||
let type_name = TypeName(&type_name_bytes);
|
||||
|
||||
let union_id = builder.add_unwrap_named(block, MOD_APP, type_name, tag_value_id)?;
|
||||
|
@ -1128,7 +1128,7 @@ fn expr_spec<'a>(
|
|||
|
||||
let tag_value_id = env.symbols[structure];
|
||||
|
||||
let type_name_bytes = recursive_tag_union_name_bytes(&union_layout).as_bytes();
|
||||
let type_name_bytes = recursive_tag_union_name_bytes(union_layout).as_bytes();
|
||||
let type_name = TypeName(&type_name_bytes);
|
||||
|
||||
let variant_id =
|
||||
|
@ -1234,7 +1234,7 @@ fn layout_spec_help(
|
|||
| UnionLayout::NullableUnwrapped { .. }
|
||||
| UnionLayout::NullableWrapped { .. }
|
||||
| UnionLayout::NonNullableUnwrapped(_) => {
|
||||
let type_name_bytes = recursive_tag_union_name_bytes(&union_layout).as_bytes();
|
||||
let type_name_bytes = recursive_tag_union_name_bytes(union_layout).as_bytes();
|
||||
let type_name = TypeName(&type_name_bytes);
|
||||
|
||||
Ok(builder.add_named_type(MOD_APP, type_name))
|
||||
|
|
|
@ -924,7 +924,7 @@ fn pick_path<'a>(branches: &'a [Branch]) -> &'a Vec<PathInstruction> {
|
|||
for (path, pattern) in &branch.patterns {
|
||||
// NOTE we no longer check for the guard here
|
||||
// if !branch.guard.is_none() || needs_tests(&pattern) {
|
||||
if needs_tests(&pattern) {
|
||||
if needs_tests(pattern) {
|
||||
all_paths.push(path);
|
||||
} else {
|
||||
// do nothing
|
||||
|
@ -996,7 +996,7 @@ where
|
|||
let mut min_paths = vec![first_path];
|
||||
|
||||
for path in all_paths {
|
||||
let weight = small_defaults(branches, &path);
|
||||
let weight = small_defaults(branches, path);
|
||||
|
||||
use std::cmp::Ordering;
|
||||
match weight.cmp(&min_weight) {
|
||||
|
@ -1219,7 +1219,7 @@ fn test_to_equality<'a>(
|
|||
test: Test<'a>,
|
||||
) -> (StoresVec<'a>, Symbol, Symbol, Option<ConstructorKnown<'a>>) {
|
||||
let (rhs_symbol, mut stores, test_layout) =
|
||||
path_to_expr_help(env, cond_symbol, &path, *cond_layout);
|
||||
path_to_expr_help(env, cond_symbol, path, *cond_layout);
|
||||
|
||||
match test {
|
||||
Test::IsCtor { tag_id, union, .. } => {
|
||||
|
@ -1328,7 +1328,7 @@ fn stores_and_condition<'a>(
|
|||
tests.push(test_to_equality(
|
||||
env,
|
||||
cond_symbol,
|
||||
&cond_layout,
|
||||
cond_layout,
|
||||
&path,
|
||||
test,
|
||||
))
|
||||
|
@ -1540,7 +1540,7 @@ fn decide_to_branching<'a>(
|
|||
match decider {
|
||||
Leaf(Jump(label)) => {
|
||||
let index = jumps
|
||||
.binary_search_by_key(&label, |ref r| r.0)
|
||||
.binary_search_by_key(&label, |r| r.0)
|
||||
.expect("jump not in list of jumps");
|
||||
|
||||
Stmt::Jump(jumps[index].1, &[])
|
||||
|
|
|
@ -187,7 +187,7 @@ impl<'a, 'i> Env<'a, 'i> {
|
|||
pub fn unique_symbol(&mut self) -> Symbol {
|
||||
let ident_id = self.ident_ids.gen_unique();
|
||||
|
||||
self.home.register_debug_idents(&self.ident_ids);
|
||||
self.home.register_debug_idents(self.ident_ids);
|
||||
|
||||
Symbol::new(self.home, ident_id)
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ impl<'a, 'i> Env<'a, 'i> {
|
|||
fn manual_unique_symbol(home: ModuleId, ident_ids: &mut IdentIds) -> Symbol {
|
||||
let ident_id = ident_ids.gen_unique();
|
||||
|
||||
home.register_debug_idents(&ident_ids);
|
||||
home.register_debug_idents(ident_ids);
|
||||
|
||||
Symbol::new(home, ident_id)
|
||||
}
|
||||
|
|
|
@ -740,7 +740,7 @@ impl<'a> Context<'a> {
|
|||
) -> (&'a Stmt<'a>, LiveVarSet) {
|
||||
use Expr::*;
|
||||
|
||||
let mut live_vars = update_live_vars(&v, &b_live_vars);
|
||||
let mut live_vars = update_live_vars(&v, b_live_vars);
|
||||
live_vars.remove(&z);
|
||||
|
||||
let new_b = match v {
|
||||
|
@ -750,7 +750,7 @@ impl<'a> Context<'a> {
|
|||
| Array { elems: ys, .. } => self.add_inc_before_consume_all(
|
||||
ys,
|
||||
self.arena.alloc(Stmt::Let(z, v, l, b)),
|
||||
&b_live_vars,
|
||||
b_live_vars,
|
||||
),
|
||||
|
||||
Call(crate::ir::Call {
|
||||
|
|
|
@ -809,7 +809,7 @@ impl<'a, 'i> Env<'a, 'i> {
|
|||
pub fn unique_symbol(&mut self) -> Symbol {
|
||||
let ident_id = self.ident_ids.gen_unique();
|
||||
|
||||
self.home.register_debug_idents(&self.ident_ids);
|
||||
self.home.register_debug_idents(self.ident_ids);
|
||||
|
||||
Symbol::new(self.home, ident_id)
|
||||
}
|
||||
|
@ -2468,7 +2468,7 @@ fn specialize_solved_type<'a>(
|
|||
|
||||
// for debugging only
|
||||
let attempted_layout = layout_cache
|
||||
.from_var(&env.arena, fn_var, env.subs)
|
||||
.from_var(env.arena, fn_var, env.subs)
|
||||
.unwrap_or_else(|err| panic!("TODO handle invalid function {:?}", err));
|
||||
|
||||
let raw = match attempted_layout {
|
||||
|
@ -2509,7 +2509,7 @@ fn specialize_solved_type<'a>(
|
|||
debug_assert_eq!(
|
||||
attempted_layout,
|
||||
layout_cache
|
||||
.from_var(&env.arena, fn_var, env.subs)
|
||||
.from_var(env.arena, fn_var, env.subs)
|
||||
.unwrap_or_else(|err| panic!("TODO handle invalid function {:?}", err))
|
||||
);
|
||||
|
||||
|
@ -3855,7 +3855,7 @@ pub fn with_hole<'a>(
|
|||
let mut arg_symbols = Vec::with_capacity_in(args.len(), env.arena);
|
||||
|
||||
for (_, arg_expr) in args.iter() {
|
||||
arg_symbols.push(possible_reuse_symbol(env, procs, &arg_expr));
|
||||
arg_symbols.push(possible_reuse_symbol(env, procs, arg_expr));
|
||||
}
|
||||
let arg_symbols = arg_symbols.into_bump_slice();
|
||||
|
||||
|
@ -3885,7 +3885,7 @@ pub fn with_hole<'a>(
|
|||
let mut arg_symbols = Vec::with_capacity_in(args.len(), env.arena);
|
||||
|
||||
for (_, arg_expr) in args.iter() {
|
||||
arg_symbols.push(possible_reuse_symbol(env, procs, &arg_expr));
|
||||
arg_symbols.push(possible_reuse_symbol(env, procs, arg_expr));
|
||||
}
|
||||
let arg_symbols = arg_symbols.into_bump_slice();
|
||||
|
||||
|
@ -5540,7 +5540,7 @@ fn store_pattern_help<'a>(
|
|||
layout_cache,
|
||||
outer_symbol,
|
||||
&layout,
|
||||
&arguments,
|
||||
arguments,
|
||||
stmt,
|
||||
);
|
||||
}
|
||||
|
@ -5557,7 +5557,7 @@ fn store_pattern_help<'a>(
|
|||
layout_cache,
|
||||
outer_symbol,
|
||||
*layout,
|
||||
&arguments,
|
||||
arguments,
|
||||
*tag_id,
|
||||
stmt,
|
||||
);
|
||||
|
@ -6374,7 +6374,7 @@ fn call_by_name_help<'a>(
|
|||
// the variables of the given arguments
|
||||
let mut pattern_vars = Vec::with_capacity_in(loc_args.len(), arena);
|
||||
for (var, _) in &loc_args {
|
||||
match layout_cache.from_var(&env.arena, *var, &env.subs) {
|
||||
match layout_cache.from_var(env.arena, *var, env.subs) {
|
||||
Ok(_) => {
|
||||
pattern_vars.push(*var);
|
||||
}
|
||||
|
|
|
@ -1317,7 +1317,7 @@ fn layout_from_flat_type<'a>(
|
|||
}
|
||||
} else if tag_layouts.len() == 1 {
|
||||
// drop the tag id
|
||||
UnionLayout::NonNullableUnwrapped(&tag_layouts.pop().unwrap())
|
||||
UnionLayout::NonNullableUnwrapped(tag_layouts.pop().unwrap())
|
||||
} else {
|
||||
UnionLayout::Recursive(tag_layouts.into_bump_slice())
|
||||
};
|
||||
|
@ -2114,7 +2114,7 @@ impl<'a> LayoutIds<'a> {
|
|||
});
|
||||
|
||||
// Get the id associated with this layout, or default to next_id.
|
||||
let answer = ids.by_id.get(&layout).copied().unwrap_or(ids.next_id);
|
||||
let answer = ids.by_id.get(layout).copied().unwrap_or(ids.next_id);
|
||||
|
||||
// If we had to default to next_id, it must not have been found;
|
||||
// store the ID we're going to return and increment next_id.
|
||||
|
@ -2145,7 +2145,7 @@ impl<'a> LayoutIds<'a> {
|
|||
// Get the id associated with this layout, or default to next_id.
|
||||
let answer = ids
|
||||
.toplevels_by_id
|
||||
.get(&layout)
|
||||
.get(layout)
|
||||
.copied()
|
||||
.unwrap_or(ids.next_id);
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ impl<'a, 'i> Env<'a, 'i> {
|
|||
fn unique_symbol(&mut self) -> Symbol {
|
||||
let ident_id = self.ident_ids.gen_unique();
|
||||
|
||||
self.home.register_debug_idents(&self.ident_ids);
|
||||
self.home.register_debug_idents(self.ident_ids);
|
||||
|
||||
Symbol::new(self.home, ident_id)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue