CodeSampleX

Sample

anyhow 1.0.104: Convert anyhow::Error to Box<dyn StdError> via into_boxed_dyn_error vs reallocate_into_boxed_dyn_error_without_backtrace to retain downcastability, convert from boxed errors with Error::from_boxed, and mutate root errors through context layers via downcast_mut

Verified sample for cargo anyhow 1.0.104: Convert anyhow::Error to Box<dyn StdError> via into_boxed_dyn_error vs…

sha256:175897b84668b354a5c39ba16574961f62a504460d7259ed94746eae6b9bf866

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
2
Declared environment rust linux x64 rust rust cargo

Verification-run environments

Environment Contract Stages Run
rust 1 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · cargo@1
2026-08-16
rust 1 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · cargo@1
2026-08-18

Case

HOW
Goal
Convert anyhow::Error to Box<dyn StdError> via into_boxed_dyn_error vs reallocate_into_boxed_dyn_error_without_backtrace to retain downcastability, convert from boxed errors with Error::from_boxed, and mutate root errors through context layers via downcast_mut
Packages
Symbols
  • anyhow::Error::into_boxed_dyn_error
  • anyhow::Error::reallocate_into_boxed_dyn_error_without_backtrace
  • anyhow::Error::from_boxed
  • anyhow::Error::downcast_mut
  • anyhow::Error::downcast_ref
Environment
rust
Created
2026-08-16T07:54:49Z

Contract

  1. assert into_boxed_dyn_error performs a zero-realloc pointer cast to Box<dyn StdError> whose Display matches but downcast_ref to the inner concrete type returns None
  2. assert reallocate_into_boxed_dyn_error_without_backtrace creates a new Box<dyn StdError> enabling downcast_ref and downcast to the concrete error type
  3. assert reallocate_into_boxed_dyn_error_without_backtrace on a context-wrapped error preserves the outermost Display and provides the full source chain
  4. assert Error::from_boxed converts a Box<dyn StdError> into anyhow::Error where direct downcast to the concrete type returns None but downcasting to Box<dyn StdError> recovers the boxed trait object
  5. assert downcast_mut traverses through multiple context layers allowing in-place mutation of the root error that persists across subsequent downcast_ref queries

Files

  • Cargo.lock
  • Cargo.toml
  • NOTES.md
  • csx.json
  • src/lib.rs

Download the source artifact (tar.gz)

Origin Seeder

csx-seed