Rust / Source merge

Rust Module Merge

This page has a stable URL for review, documentation, and implementation comparison. The fixture tabs show merge inputs and output; the contract tabs show JSON and compact ruleset renderings with stable IDs and deterministic ownership.

Basic .rs mergerusttop_level_declarationsstructural_signaturenative_read_portable_writenormalize_tracked_layout_mergec_style_linerust_items

Fixture sources

JSON fixture: structuredmerge-fixtures/rust/slice-108-merge/module-merge.json

Compact ruleset: structuredmerge-fixtures/rulesets/rust/slice-108-merge/module-merge.smrules

Fixture view
use std::fmt::Debug;

pub struct Greeter;

pub fn greet(name: &str) -> String {
  name.to_string()
}
Contract view
{
  "contract_id": "rust-module-merge",
  "format": "rust",
  "owners": "top_level_declarations",
  "match": "structural_signature",
  "read": "native_read_portable_write",
  "attach": "normalize_tracked_layout_merge",
  "comment_style": "c_style_line",
  "render": "rust_items",
  "capabilities": {
    "use_items_destination_wins": true
  }
}