Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions compiler/crates/hy-check/src/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,14 @@ impl<'a> Checker<'a> {

fn check_place_builtin_args(&mut self, place: &Place) {
match &place.kind {
PlaceKind::Index { index, .. } => self.check_expr_builtin_args(index),
PlaceKind::Field { .. } | PlaceKind::Ident(_) | PlaceKind::AddrOf { .. } => {}
PlaceKind::Ident(_) => {}
PlaceKind::Index { base, index } => {
self.check_place_builtin_args(base);
self.check_expr_builtin_args(index);
}
PlaceKind::Field { base, .. } | PlaceKind::AddrOf { base } => {
self.check_place_builtin_args(base);
}
}
}

Expand Down
18 changes: 0 additions & 18 deletions compiler/crates/hy-check/src/closures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,6 @@ fn collect_stmt_direct_fnlits<'a>(
) {
let mut flits = Vec::new();
crate::walk::own_fnlits(stmt, &mut flits);
if let Stmt::Assign { targets, .. } = stmt {
for t in targets {
collect_place_direct_fnlits(t, &mut flits);
}
}
for flit in flits {
if let Expr::FnLit { params, results, body, .. } = crate::model::unwrap_parens(flit) {
nested.push((
Expand All @@ -274,19 +269,6 @@ fn collect_stmt_direct_fnlits<'a>(
}
}

fn collect_place_direct_fnlits<'a>(place: &'a hy_syntax::Place, out: &mut Vec<&'a Expr>) {
match &place.kind {
hy_syntax::PlaceKind::Ident(_) => {}
hy_syntax::PlaceKind::Index { base, index } => {
collect_place_direct_fnlits(base, out);
crate::walk::expr_fnlits(index, out);
}
hy_syntax::PlaceKind::Field { base, .. } | hy_syntax::PlaceKind::AddrOf { base } => {
collect_place_direct_fnlits(base, out);
}
}
}

fn check_stmt_own_uses(ck: &mut Checker<'_>, st: &mut FnState, stmt: &Stmt, managed: bool) {
let mut uses = Vec::new();
crate::walk::own_uses_with_results(stmt, &st.named_results, &mut uses);
Expand Down
Loading
Loading