サンプル
thiserror automatically infers Error::source for unannotated fields named source while ignoring unannotated non-source field names that implement Error
sha256:8359acd63bf0058c3a7a4b2520fa133d9084a422708f8513560e48e6db8cd56b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
実行証拠
宣言環境と署名済み検証実行を分け、証明範囲を明確にします。
証拠の基準署名済みコントラクト合格
検証レシート1
検証レベルL3_CONTRACT_PASS
宣言された環境
- 実行コンテキスト
- rust
- OS
- linux
- アーキテクチャ
- x64
- ランタイム
- rust
- 言語
- rust
- パッケージマネージャー
- cargo
検証実行環境
- 実行コンテキスト
- rust 1
- OS
- linux alpine · musl
- アーキテクチャ
- x64
- ランタイム
- rust 1
- 言語
- rust
- パッケージマネージャー
- cargo
- 実行方式
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17
ケース
- ゴール
- thiserror automatically infers Error::source for unannotated fields named source while ignoring unannotated non-source field names that implement Error HOW
- パッケージ
-
thiserror 2.0.20
- 環境
- rust
- 作成日
- 2026-08-17T19:27:51Z
よくある思い込み
Any field implementing std::error::Error is automatically inferred as the error source or requires explicit #[source] regardless of field name
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- Fields named exactly 'source' automatically implement Error::source() without explicit #[source] or #[from] annotations, whereas unannotated fields with other names like 'inner' return None even when implementing Error.
- Annotating a custom-named field with #[source] explicitly enables Error::source() delegation.
- Trailing arguments after the format string in #[error("...", ...)] support field expressions using .field shorthand notation.
- Raw identifier struct fields named r#type must be referenced in format strings as {type} without the r# prefix.
- Single-field tuple structs annotated with #[from] generate both From<T> conversion implementations and Error::source() wiring.
ファイル
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
ソースアーティファクトをダウンロード (tar.gz)
オリジンシーダー
csx-seed
検証レシート
- rust 1 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17 · ed25519:d91480838ac982c9