Skip to content

Code Analysis Rust Lifetime Owners

Tu Shaokun edited this page Nov 8, 2026 · 3 revisions

Rust lifetime-only inherent source navigation

Snapshot:8November2026. Draft #1277, head915d528e584a6343ab79284bd274ed11762cf9c9, is independently owned above Rust#1270/3f42ee34b. The latest cumulative six-language candidate is now Draft#1279/996e073de, preserving this original history together with Java#1273/196dd3569. Native stack#1262 has13layers; independent#1277 retains its own owner/base. Labs bf0a29e7 is unchanged; no approval, merge, release or installation.

One developer investigation

At fixed regex9870c06e6c772daaad7ab612faab29130753e41c, Translator::translate called TranslatorI::new(self,pattern) at regex-syntax/src/hir/translate.rs174:25. The source function exists at685, but Rust3 left the call unknown because the type/impl contain lifetime parameters.

Rust4 now follows that call to685:5. Two reserved same-spelled HeapVisitor::new paths stay distinct: ast/visitor119→201 and hir/visitor66→105. The scope gains a source implementation step; Visitor receiver calls retain unknowns. Lifetimes, argument applicability, borrow checking, runtime dispatch and complete callers are not established by constructor source identity.

Source first and exact bounds

Fixed inputs, source corrections, scripts and receipts. Source freeze3cfe09f5f and baseline701cbff06 precede initial rulea150e7682. Two HeapVisitor cases were reserved only from initial rule tuning; the corpus was previously analyzed, not blind. Baseline0correct/0wrong/3known misses+2Visitor unknowns → candidate3correct/0wrong/0missed+same2unknowns.

The original exact-point oracle confused the owned doc-comment range684 with the ordinary fn target685; correctionb569acada precedes candidate replay and preserves the original freeze. Source identity new685:8 never changed. Existing target/sourceRange starts at pub/fn; definition.sourceRange additionally owns attributes/doc comments.

Rust4/adapter4 adds bare nominal/module/import-alias paths to receiver-free inherent declarations on lifetime-only structs/enums. Unbounded impl lifetime names must map one-to-one to owner arguments; no where clause. A shared parameter-shape discriminant reuses the existing candidate inventory; unsupported/conditional siblings and enum variant names block selection. Concrete static/subset/bounded lifetimes, mixed type/const/default parameters, explicit call arguments, aliases/Self, receiver/trait dispatch, macros and full applicability remain unproved. Historical v1/v2/v3 scopes are read without rebinding.

Real samples and independent attribution

Regex preserves1,968old targets,17,995call ranges,3,435functions,166source files and0parse errors.73new calls independently agree with rust-analyzer1.89.0, exactly one LSP location each. The selected3are included in those73.39previously unbound import records point to9captured nominal declarations; fixed source declarations/import spellings reviewed separately, no old resolved import retargeted.

A post-design preservation replay of fixed serde_json4d4f53c3b7de3259b6a8a15ef4d5f4edb47af32f found11new lifetime-only targets per profile, including de.rs→read.rs SliceRead/StrRead constructors. Sources were reviewed before their independent LSP audit; both default and arbitrary_precision have11/11agreements,0different/0unavailable. These are11physical sites across two overlapping profiles, not22independent sites. All95observations across84physical sites agree; this is source definition agreement, not compiler/build/whole-project precision/recall or runtime proof.

Serde preserves127old targets/default and186/arbitrary, all16source files per profile,2,063/2,257call ranges and612/683functions;0parse failures. Each profile gains2source-reviewed import bindings. Older five Map sites retain10correct/0wrong/0missed observations plus4unknowns. Graph findings can change as valid dependencies become visible; this does not establish runtime cycles or loading behavior.

The separate negative control substitutes an incorrect target and is rejected (0agree/1different); it is not a product wrong target. Pinned source/call/function hashes, returned LSP locations, generated audit locks and Cargo guard logs are linked in the repository evidence.

Tooling and replay

Normal CLI still needs installed Cargo/rustc1.71+ and locked helper dependencies; tested Rust/cargo1.89.0 and Node26.12.0. Missing tooling gives explicit extract/rust-unavailable/exit2, not an empty successful capture. Optional rust-analyzer is not a shipped backend. Retained RA executable35,248,592bytes, rust-src, cached crates and prior isolated fixed-source workspaces were reused; no installation. Regex startup+73queries4.34s, each serde startup+11queries3.82s here; fresh installation/download/cross-host audit costs were not measured.

Effective checkOnSave/procMacro/buildScripts=false is verified from analyzer status. Boolean safety values in the old driver mean these false settings were found. The Cargo guard permits only metadata/version here, enforcing locked/offline metadata; other probes are rejected. No upstream build/check/test, proc macro or build script execution. The audit lock is separately generated, not an upstream release lock; the known offline standard-library metadata fallback remains disclosed.

Use run.py with the fixed regex root and normal source CLI, then repeat with unpacked ZIP. pair.py exercises an owned changed body across a renamed Cargo dependency/custom library name:0→3known sites in2caller functions per side, ready/exit0. This is synthetic integration, not a new real upstream change pair; original Go/Rust real-version acceptance keeps its earlier attribution. extras.py reads actual saved Rust1/2/3 without rebinding and probes missing SDK. The older Map recipe accepts an explicit candidate-model4 while retaining its original default. preserve.py compares source/call identity and import declarations; verify.py compares distributions. Exact pins, paths and commands are in the linked README.

Separate acceptance states

  • Local module394/394; extracted affected42/42, zero skips. Canonical Node22 package/release54pass/0fail/2environment skips (non-canonical rejection lane and Windows-only drive paths).
  • Source/ZIP3current raw captures and17current/owned/historical questions agree.21CLIcommands per distribution; only intentional missing-SDK exits2, other20exit0. Overlapping profiles/distributions are not independent accuracy samples.
  • Two canonical Node22.23.3/zlib1.3.1-e00f703 builds match;168module package files match source. ZIP SHA256b588c11911c80ff4fb1a87b292becf80b636a3c6c0f5ca365c200fb74eb5bbfb.
  • Final-head CI42440422852 completed success at915d528e5. Actual analysis job128608361801 log records394tests/394pass/0fail/0skip. All executed full/browser/ZIP/WebM/website, three-platform package and Windows22/24 checks passed; deployment jobs skipped. Earlier e02a1b3f3 CI42440119415 was superseded/cancelled after the serde evidence-only follow-up, not a pass; runtime staysa150e7682. Local/LSP/archive evidence keeps its separate attribution. No Labs integration, formal merge, release or live installation.

Clone this wiki locally