Dead code in PL IR: unused fold_func_param, write-only prev_columns, unreachable display_ids

オープン
#5,793 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust
領域
backend

調査の方向性

Start with the cited locations in prqlc/prqlc/src/ir/pl/fold.rs and prqlc/prqlc/src/ir/pl/lineage.rs, then trace callers and implementations of PlFold, Lineage::clear, and display_lineage. Check whether the fields and branches are intentionally needed before proposing removals; done means each item is either safely removed or its purpose and required follow-up are documented, with relevant tests passing.

索引モデルが issue の本文から書いたものです。

説明

The nightly survey (2026-04-12) identified several pieces of dead code in the PL IR and related modules. These are structural enough that they may warrant maintainer review before removal.

1. fold_func_param is never called

fold.rs:289 exports fold_func_param but it has zero callers. The default fold_func implementation uses struct spread and only folds body and args, skipping FuncParam::default_value and Func::env. This means all PlFold implementors miss expressions within default parameter values and captured environments.

This could be a latent correctness issue if any fold pass needs to visit those fields, or it could be intentional if those fields are always resolved before folding occurs.

2. Lineage::prev_columns is write-only

lineage.rs:21 defines prev_columns which is populated by Lineage::clear() but never read anywhere. The comment says it is "A hack that allows name retention when applying ExprKind::All { except }", but no code reads it. It is also #[serde(skip)].

3. display_ids parameter is always false

lineage.rs:74 display_lineage accepts display_ids: bool but the only call site always passes false, making the true branch unreachable. Appears to be an unfinished debugging aid.

主要言語
Rust
スター
10.9k
フォーク
261
平均マージ
3日 21時間
マージ済み PR(30日)
84

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PRQL/prql のほかの issue

PRQL/prql の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。