Skip to content

Roll toolchain to nightly-2023-04-15#1904

Draft
thedataking wants to merge 13 commits into
masterfrom
perl/roll-transpiler-to-nightly-2023-04-15
Draft

Roll toolchain to nightly-2023-04-15#1904
thedataking wants to merge 13 commits into
masterfrom
perl/roll-transpiler-to-nightly-2023-04-15

Conversation

@thedataking

@thedataking thedataking commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

This rolls the compiler-coupled workspace from nightly-2022-11-03 to nightly-2023-04-15, updates CI/provisioning/MSRV metadata, and migrates the rustc-private APIs used by PDG, instrumentation, refactor, and analyzer. Generated Edition 2021/2024 pins and the standalone stable tools remain unchanged.

The most important review areas, highest risk first:

  • Refactor AST, macro, and token handling (3a9d1da6f, 2260637ea, 147f7bb86). This reconciles the generated AST model with rustc, adds traversal for interpolated macro arguments, and reparses item headers when rustc does not retain tokens. These paths can silently alter or lose syntax, so macro recovery, node IDs, spans, precedence, and item-header rewriting deserve close attention. 147f7bb86 fixes a pre-existing reversed edge direction in nonterminal ID matching that the macro rewrites depend on. AutoRetype also gained small behavior changes (skipping pre-annotated locals and pre-existing typeck errors), noted in the 2260637ea commit message.
  • Analyzer MIR-to-source rewrite mapping (8f444659e, 9866d7ede). The target compiler splits some expression loads across MIR statements, folds user variables into LocalKind::Temp, and emits PlaceMention. The new ordering/origin logic fixes the current fixtures, but this is where confidence is lowest for larger real-world control-flow graphs. Skipping closure body owners also deserves scrutiny in case downstream analysis expects closures to be handled independently.
  • Dynamic instrumentation (f5ceb92ef). Query, place-projection, pointer-type, terminator, and unwind APIs changed. End-to-end instrumentation passes locally, but drop/unwind behavior on code outside the existing fixtures remains a meaningful risk.
  • Snapshot changes (0b7f451e9, f5cc7f419). PDG changes are limited to allocation identifiers and shifted MIR statement locations; graph topology, permissions, and counts are unchanged. The five refactor snapshots reflect newly working macro traversal/precedence and omission of the default Vec allocator parameter rather than bulk compiler-output churn.

Bisection note: the source cannot support both rustc-private API surfaces at once, so the commits from the pin bump (249ab2ebe) through the last migration commit (9866d7ede) intentionally do not build individually. When bisecting across this range, skip it: git bisect skip 249ab2ebe..9866d7ede.

Local validation includes warning-denied workspace checks/docs/release builds, 220/220 nextest tests, the full legacy refactor suite, 146 translation successes with two expected failures, analyzer FileCheck and old-PDG compatibility tests, debug/release PDG snapshots, end-to-end instrumentation/PDG analysis, Miri, stable Rust 1.70 builds, stable tools, and installed-binary smoke tests under a conflicting default toolchain.

Update CI, provisioning, Fenix, metadata, and documentation around the authoritative workspace pin. Keep generated-code and standalone tools pins unchanged.
Use FieldIdx and the target newtype-index syntax while preserving the serialized u32 representation.
Accept only compiler-representation changes: normalized allocation identifiers and shifted MIR statement locations. Graph nodes, edges, permissions, and counts remain unchanged.
Adapt query access, binders, pointer types, place projections, unwind actions, and target MIR terminators without changing instrumentation semantics.
Reconcile the generated AST schema and handwritten builders, folders, token traversal, macro recovery, equivalence, node IDs, and matcher support with nightly-2023-04-15.
Adapt compiler queries, type reflection, substitutions, ownership analysis, resolution, type maps, and driver callbacks to the target nightly.
Update rewrite, printing, literal, macro, item, ownership, retype, static, and reorganization paths for the target AST APIs. Preserve source tokens by reparsing item headers when rustc does not collect them.
Make the retype string fixture self-contained and require formerly broken macro rewrites and reflected output to compile successfully.
Record macro-argument traversal for literal suffixes and typed matchers, successful nested expression rewrites with correct precedence, and reflected Vec types without the default allocator parameter.
Adapt aliases, binders, predicates, local classification, scalar conversions, MIR terminators, def lookup, and dataflow while preserving pointer and permission semantics.
Handle non-semantic PlaceMention statements, order split loads by MIR location, preserve precise rewrite origins, and update type/shim lowering and target diagnostic matching.
@thedataking thedataking force-pushed the perl/roll-transpiler-to-nightly-2023-04-15 branch from eda7e70 to 4acaf81 Compare July 14, 2026 11:23
@ahomescu

Copy link
Copy Markdown
Contributor

Are we still keeping the instrumentation code updated? We had a discussion at some point to let that fall behind.

enum LitKind {
Str(sym, style),
ByteStr(bytes),
ByteStr(#[rewrite_ignore] bytes, style),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I wonder why it decided to add the attribute here.

@thedataking

Copy link
Copy Markdown
Contributor Author

Are we still keeping the instrumentation code updated? We had a discussion at some point to let that fall behind.

From the meeting discussion: we'll update it for this roll. For next roll, I'll disable unused components first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants