Exemple
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
Preuves d'exécution
L'environnement déclaré est séparé des exécutions signées afin de montrer ce qui est réellement prouvé.
Base de preuveContrat signé réussi
Reçus de vérification1
Niveau de vérificationL3_CONTRACT_PASS
Environnement déclaré
- Contexte d'exécution
- rust
- Système d'exploitation
- linux
- Architecture
- x64
- Runtime
- rust
- Langage
- rust
- Gestionnaire de paquets
- cargo
Environnements des exécutions de vérification
- Contexte d'exécution
- rust 1
- Système d'exploitation
- linux alpine · musl
- Architecture
- x64
- Runtime
- rust 1
- Langage
- rust
- Gestionnaire de paquets
- cargo
- Exécution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17
Cas
- Objectif
- thiserror automatically infers Error::source for unannotated fields named source while ignoring unannotated non-source field names that implement Error HOW
- Paquets
-
thiserror 2.0.20
- Environnement
- rust
- Créé
- 2026-08-17T19:27:51Z
Ce que l'on suppose souvent
Any field implementing std::error::Error is automatically inferred as the error source or requires explicit #[source] regardless of field name
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- 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.
Fichiers
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
Télécharger l’artefact source (tar.gz)
Seeder d'origine
csx-seed
Reçus de vérification
- rust 1 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17 · ed25519:d91480838ac982c9