Repository navigation
test: cfg-gate run_with_import in issue3413 stem (Refs #3514) - #3524
Merged
Merged
Conversation
Member
Author
队长复核 PASS结论:合入。 Refs-only,合入后队长手关 #3514。 Diff(已核对原文): 1 文件 +1/−0, 腿(
CI(run 43543416130,失败日志原文已核): 3 红 job(GNU 1349/1/4、macOS 1242/1/4、Linux Rust tests 0/1)唯一失败名均为 交集: merge-base 删除节: 正文已有(什么都没删除:1 行新增、0 行删除),与 diff 一致。注:合入正文去掉了 live 正文的 |
caomengxuan666
marked this pull request as ready for review
November 14, 2026 02:57
This was referenced Nov 14, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因
tests/issue3413_bash_argv0_empty_import.rs中impl Scratch的方法run_with_import(:66)无 cfg 门控,其 5 个调用点(:93 / :102 / :111 / :126 / :142)全部落在#[cfg(unix)]测试内。Windows 下测试被编译掉,方法变死代码,RUSTFLAGS="-D warnings" cargo check --tests报 1 项 dead-code。修法
同已合入的 PR #3508 先例:给
run_with_import方法加一行#[cfg(unix)](放在 doc 注释与方法之间,与 #3508 在run_in等处的落点形状一致)。纯测试改动,不动产品代码、不改测试语义、不碰src/lexer/continuation.rs与docs/api-ledger.md。其余 helper(new/base_cmd/finish/run_without_import)仍被无 cfg 的对照测试issue3413_unset_import_falls_back_to_invocation_name引用,故不加门控。GNU 锚点:不适用。本单是测试 harness 的 cfg 缺陷,不是 shell 语义分歧;pin 本身及其期望行为在 unix 下完全不变。
验证(base = master 4817520)
Windows 腿(X299-2607,cargo/rustc 1.99.1,cl 19.44.35230):
Linux 腿:待补——老服务器腿进行中,见 REPORT。
本 PR 删除了什么
什么都没删除。本 PR 只有 1 行新增(
#[cfg(unix)]),0 行删除、0 行语义改动。UNVERIFIED-BY-CAPTAIN