From a183f27ac05b1b8cec90698b77b658c954b32d1d Mon Sep 17 00:00:00 2001 From: tamnd <1218621+tamnd@users.noreply.github.com> Date: Tue, 20 Oct 2026 18:07:35 +0700 Subject: [PATCH 1/2] Build again with Rust 1.88, without if let guards --- crates/rupg-analyze/src/select.rs | 24 +++++++++++------------ crates/rupg-analyze/src/sort.rs | 28 +++++++++++++++------------ crates/rupg-session/src/connection.rs | 10 +++++----- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/crates/rupg-analyze/src/select.rs b/crates/rupg-analyze/src/select.rs index f5e87a59..010fe226 100644 --- a/crates/rupg-analyze/src/select.rs +++ b/crates/rupg-analyze/src/select.rs @@ -235,21 +235,21 @@ impl Analyzer<'_> { for target in targets { if let ExprKind::Var(var) = &target.expr.kind { let relation = &self.level(var.levels_up).relations[var.relation]; - target.origin = match &relation.subquery { - None if let Some(cte) = relation.cte.as_ref().filter(|c| c.write.is_some()) => { - usize::try_from(var.attnum - 1) - .ok() - .and_then(|i| cte.origins.get(i).copied().flatten()) - } - None if relation.function.is_some() - || relation.values.is_some() - || relation.cte.is_some() => + let written = relation.cte.as_ref().filter(|c| c.write.is_some()); + target.origin = match (&relation.subquery, written) { + (None, Some(cte)) => usize::try_from(var.attnum - 1) + .ok() + .and_then(|i| cte.origins.get(i).copied().flatten()), + (None, None) + if relation.function.is_some() + || relation.values.is_some() + || relation.cte.is_some() => { None } - None => Some((relation.oid, var.attnum)), - Some(_) if relation.oid != 0 => Some((relation.oid, var.attnum)), - Some(sub) => usize::try_from(var.attnum - 1) + (None, None) => Some((relation.oid, var.attnum)), + (Some(_), _) if relation.oid != 0 => Some((relation.oid, var.attnum)), + (Some(sub), _) => usize::try_from(var.attnum - 1) .ok() .and_then(|i| sub.targets.iter().filter(|t| !t.junk).nth(i)) .and_then(|t| t.origin), diff --git a/crates/rupg-analyze/src/sort.rs b/crates/rupg-analyze/src/sort.rs index c2587a84..6a0b6428 100644 --- a/crates/rupg-analyze/src/sort.rs +++ b/crates/rupg-analyze/src/sort.rs @@ -169,12 +169,14 @@ fn flatten_top<'a>(list: &'a List, has_sets: &mut bool) -> Vec> { )); } } - Some(node) if let Some(args) = implicit_row(node) => { - let mut items = Vec::new(); - row_items(args, &mut items); - out.extend(items.into_iter().map(Flat::Item)); - } - node => out.push(Flat::Item(node.as_ref())), + node => match node.as_ref().and_then(implicit_row) { + Some(args) => { + let mut items = Vec::new(); + row_items(args, &mut items); + out.extend(items.into_iter().map(Flat::Item)); + } + None => out.push(Flat::Item(node.as_ref())), + }, } } out @@ -191,12 +193,14 @@ fn flatten_content(list: &List) -> Vec> { Some(Node::GroupingSet(set)) => { out.push(Flat::Set(set.kind, flatten_content(&set.content), place(set.location))); } - Some(node) if let Some(args) = implicit_row(node) => { - let mut items = Vec::new(); - row_items(args, &mut items); - out.push(Flat::Row(items)); - } - node => out.push(Flat::Item(node.as_ref())), + node => match node.as_ref().and_then(implicit_row) { + Some(args) => { + let mut items = Vec::new(); + row_items(args, &mut items); + out.push(Flat::Row(items)); + } + None => out.push(Flat::Item(node.as_ref())), + }, } } out diff --git a/crates/rupg-session/src/connection.rs b/crates/rupg-session/src/connection.rs index 327bed63..07f22dd0 100644 --- a/crates/rupg-session/src/connection.rs +++ b/crates/rupg-session/src/connection.rs @@ -613,8 +613,8 @@ impl Connection { let mut updated = (Vec::new(), Vec::new()); let upsert = info.on_conflict.as_ref().filter(|conflict| !conflict.arbiters.is_empty()); let mut batches = Vec::new(); - let (tag, count) = match info.kind { - WriteKind::Merge => { + let (tag, count) = match (info.kind, upsert) { + (WriteKind::Merge, _) => { let Some(merge) = info.merge.as_ref() else { return Err(Error::internal("a MERGE with no clauses")); }; @@ -624,14 +624,14 @@ impl Connection { view = done.view; (CommandTag::Merge, done.count) } - WriteKind::Insert if let Some(conflict) = upsert => { + (WriteKind::Insert, Some(conflict)) => { let done = self.upsert(plan, info, conflict, params, &view, rows)?; written = done.written; new_rows = done.inserted; updated = (done.new, done.old); (CommandTag::Insert, done.count) } - WriteKind::Insert => { + (WriteKind::Insert, None) => { let count = rows.len() as u64; if info.returning.is_some() { written.clone_from(&rows); @@ -652,7 +652,7 @@ impl Connection { } (CommandTag::Insert, count) } - kind => { + (kind, _) => { let update = kind == WriteKind::Update; let (mut changes, mut given) = row_changes(rows, info)?; let mut kept = Vec::new(); From c9b30fd7ad73d9ac6d9a3bdcc4c7f2a172777184 Mon Sep 17 00:00:00 2001 From: tamnd <1218621+tamnd@users.noreply.github.com> Date: Tue, 20 Oct 2026 18:08:00 +0700 Subject: [PATCH 2/2] Add the changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a7364b..8dd68ba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ All changes that a user can see are in this file. The version is 0.M.patch, wher - The facade takes a checkpoint when all the log rings together hold more than `Options::max_wal_size` bytes, default 1 GiB, as `max_wal_size` does in PostgreSQL. `Options::checkpoint_log` is now the limit of one ring (#454). +### Fixed + +- The workspace builds again with Rust 1.88, the lowest supported version. Four match arms used `if let` guards, which need a newer Rust (#457). + ## 0.1.53 (2026-10-20) ### Added