Ejemplo
#[error(transparent)] forwards both Display and Error::source to the inner error rather than wrapping the inner error as the cause layer
sha256:115c8c422a1ed72be811ab6ecb1f995940e32fd286cfe04c38e865c43df7feb6
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
- #[error(transparent)] forwards both Display and Error::source to the inner error rather than wrapping the inner error as the cause layer HOW
- Paquetes
-
thiserror 2.0.20
- Entorno
- rust
- Creado
- 2026-08-17T18:49:30Z
Lo que suele suponerse
#[error(transparent)] causes Error::source to return the wrapped error as Some(&inner)
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
- Calling Error::source on an error deriving Error with #[error(transparent)] delegates directly to inner.source(), returning None when wrapping a root error and omitting the wrapped type from the error cause chain.
- Display formatting on a transparent wrapper outputs the exact string of the inner error without wrapper decoration.
- Standard #[error("...")] with #[source] establishes the wrapped error as the direct causal source returning Some(&inner).
- Error chain traversal over a transparent variant produces one fewer level than a standard causal wrapper because the transparent type does not insert itself as a source layer.
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