Ejemplo
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
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- rust
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- rust
- Lenguaje
- rust
- Gestor de paquetes
- cargo
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- rust 1
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- rust 1
- Lenguaje
- rust
- Gestor de paquetes
- cargo
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17
Caso
- Objetivo
- thiserror automatically infers Error::source for unannotated fields named source while ignoring unannotated non-source field names that implement Error HOW
- Paquetes
-
thiserror 2.0.20
- Entorno
- rust
- Creado
- 2026-08-17T19:27:51Z
Lo que suele suponerse
Any field implementing std::error::Error is automatically inferred as the error source or requires explicit #[source] regardless of field name
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- 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.
Archivos
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- rust 1 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17 · ed25519:d91480838ac982c9