Skip to content

35 Move code blocks are labelled rust - #27925

Draft
jessiemongeon1 wants to merge 1 commit into
MystenLabs:mainfrom
jessiemongeon1:jessiemongeon1/docs/move-code-fences
Draft

35 Move code blocks are labelled rust#27925
jessiemongeon1 wants to merge 1 commit into
MystenLabs:mainfrom
jessiemongeon1:jessiemongeon1/docs/move-code-fences

Conversation

@jessiemongeon1

Copy link
Copy Markdown
Contributor

Description

Found while sweeping the sections this audit had not yet reached.

35 Move examples across 6 pages sit in ```rust fences, so they render with Rust syntax highlighting. The clearest case is custom-indexer/bring-your-own-store.mdx, where the first line inside the rust fence is:

// Move smart contract
File Blocks
references/ts-asset-tokenization.mdx 23
onchain-finance/examples-patterns/kiosk.mdx 6
develop/objects/transfers/simulating-refs.mdx 3
develop/cryptography/groth16.mdx 1
develop/accessing-data/custom-indexer/bring-your-own-store.mdx 1
sui-stack/suins/developer.mdx 1

Relabelling exposed 11 more stale structs

The public struct sweep in #27922 only looked inside ```move fences, so it could not see these. Applying the same Move 2024 rule to the newly relabelled blocks fixed 11 more. No file overlap with #27922, so the two merge independently.

ts-asset-tokenization.mdx also declared transfer_policy as public(friend), the visibility the Move book heads as DEPRECATED. Changed to public(package), matching the fix in #27910.

Excluded

sui-stack/seal/using-seal.mdx has the same problem. That directory is gitignored and generated from MystenLabs/seal, so editing it here would be overwritten. The fix belongs upstream in the Seal repository.

A detector bug worth recording

My first pass skipped suins/developer.mdx because it treats let mut as a Rust marker. let mut is Move 2024 syntax, documented in the Move book's variables chapter. Anyone writing a similar heuristic should not use it to tell the two apart.

Test plan

  • Every relabelled block confirmed to contain Move-only markers (public fun, has key, &mut TxContext, module a::b {) and no Rust markers (fn, impl, pub fn).
  • Re-ran the sweep: 0 Move blocks remain in rust fences outside generated content.
  • No new broken links.

Move examples across 6 pages sit in ```rust fences, so they render with
Rust highlighting. The clearest case is
custom-indexer/bring-your-own-store.mdx, where the first line inside the
rust fence is the comment "// Move smart contract".

references/ts-asset-tokenization.mdx carries 23 of them, kiosk.mdx 6,
simulating-refs.mdx 3, and 1 each on groth16.mdx,
bring-your-own-store.mdx, and suins/developer.mdx.

Relabelling exposed 11 struct declarations that the earlier public struct
sweep could not see, because that sweep only looked inside ```move
fences. Applied the same 2024 rule to them here.

ts-asset-tokenization.mdx also declared transfer_policy as
public(friend), the visibility the Move book heads as deprecated.
Changed to public(package).

sui-stack/seal/using-seal.mdx has the same problem and is excluded. That
directory is gitignored and generated from MystenLabs/seal, so the fix
belongs upstream.

One block needed a second pass. My first detector treated `let mut` as a
Rust marker and skipped suins/developer.mdx, but `let mut` is Move 2024
syntax, documented in the Move book's variables chapter.
@jessiemongeon1
jessiemongeon1 deployed to sui-typescript-aws-kms-test-env September 8, 2026 23:25 — with GitHub Actions Active
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sui-docs Ready Ready Preview Sep 8, 2026 11:28pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
multisig-toolkit Ignored Ignored Preview Sep 8, 2026 11:28pm UTC
sui-kiosk Ignored Ignored Preview Sep 8, 2026 11:28pm UTC

Request Review

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

Labels

Type: Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant